Since the release of Developer Preview #1 in November 2017, the LoopBack team have been focusing on adding features for application developers to define and implement REST APIs with Controllers and Repositories. We also continue to improve the core modules of the framework, such as Decorator/Metadata and Context/Dependency Injection. A lot of efforts are put into documentation and developer productivity. We’re pleased to announce that Developer Preview #2 of LoopBack 4 is available today!
Highlights of Developer Preview 2
- New LoopBack logo determined by our community
- BootStrapper and booters for Repository and Controller
- OpenAPI v3 support for staying with the latest technologies
- Enhanced command-line interfaces for better developer experience
- Decorator and metadata utilities
- Improved IoC container and Dependency Injection
- Improved documentation
- Simplified and improved development process
- Generation of JSON schema from models
Let’s take a closer look at each highlight.
New LoopBack 4 Logo Determined by our Community
Based on the feedback from the community, we settled on the new logo for LoopBack 4, representing the framework being rewritten from the ground-up with better extensibility and flexibility. Big shout out to our design team!
Repository and Controller BootStrapper
In Developer Preview #1, application developers have to register artifacts such as controllers and repositories by code. We have added
@loopback/boot to automatically discover artifacts and bind them to your Application’s Context
by convention. In this release, we have implemented the
Controller booters. This reduces the amount of manual effort required to bind artifacts for dependency injection at scale. Check out this blog for more details.
OpenAPI v3 Support
OpenAPI Specification provides a standard format to unify how an industry defines and describes RESTful APIs. To keep up with the latest technologies, LoopBack 4 has upgraded OpenAPI from v2 (Swagger) to v3 of the specification. Now you can use OpenAPI v3 syntax when defining your controllers using decorators.
Enhanced Command-line Interfaces
Decorator and Metadata Utilities
To leverage TypeScript decorators for metadata management and dependency injection, we have introduced the
@loopback/metadata package, which contains utilities to help developers implement TypeScript decorators, define/merge metadata, and inspect metadata.
Improved IoC Container and Dependency Injection
We have made significant improvements to the IoC container for better dependency injection capabilities, such as:
- Context objects now have names
- Optional dependencies are allowed
@inject.contextfor Context object injection
- Ability to track binding resolution and dependency injection tree to detect circular dependencies. See this blog for more details
- More flexible
findmethods to match bindings within a context
- Strong-typed binding creation and resolution for type safety
In addition to our continued effort to improve LoopBack 4 documentation, we’ve revamped the Getting Started tutorial to include step-by-step instructions in creating your first LoopBack 4 application. We also moved the documentation source to the
loopback-next github repository under
docs. See this blog for more details. API references for all LoopBak 4 packages are also generated into the
docs as well. It is published to NPM as
@loopback/docs. The loopback.io site now serves documentation for LoopBack 4 from the npm module.
Simplified and Improved Development Process
We have made a few changes to keep us on top of the latest technology stack and simplify our development process and infrastructure. It also improves developer productivity.
- Dropping Node 6 support
- Switching to 0.x.y versions from 4.0.0-alpha.X to better indicate breaking changes
packages: core modules
examples: example apps
sandbox: sandbox testing
- Refine the build scripts for performance and much better VSCode integration (error reporting, debugging, formatting)
Generation of JSON Schema from Models
We also created a new module
@loopback/repository-json-schema which leverages TypeScript’s decorator metadata in building a standard representation of LoopBack 4 models as JSON schema and creating legacy juggler model definitions. Visit this blog for more detailed look and implications!
Going forward, we’ll be progressively providing richer functionalities to the framework, such as model relation and type conversion. Stay tuned for our plan. Please note that we may make adjustment along the way.
Call for Action
LoopBack’s future success counts on you. We appreciate your continuous support and engagement to make LoopBack even better and meaningful for your API creation experience. Please join us and help the project by: