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

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!

LoopBack new logo

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 Repository and 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

You can now use lb4 controller to generate controllers and lb4 example to download examples. For details, see the CLI documentation.

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:

  1. Context objects now have names
  2. Optional dependencies are allowed
  3. @inject.context for Context object injection
  4. Ability to track binding resolution and dependency injection tree to detect circular dependencies. See this blog for more details
  5. More flexible find methods to match bindings within a context
  6. Strong-typed binding creation and resolution for type safety

Improved Documentation

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.

Features includes:

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!

What’s Next?

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: