Page Contents

In LoopBack 3, a component is essentially a function that extends and/or patches the target application.

LoopBack 3 components can contribute:

  • additional models
  • new REST API endpoints (Express routes)
  • mixin to be used by application models

They can also modify application’s models to

In LoopBack 4, a component is typically a class providing artifacts it wants to contribute to the application. It is responsibility of the target application to import those artifacts.

LoopBack 4 components can contribute:

As the last resort, LoopBack 4 components can also modify the target application directly by calling Application APIs (this is similar to LoopBack 3 approach).

To make the migration guide easier to navigate, we split component-related instructions into several sub-sections.

  1. Migrating component project layout describes how to migrate your LoopBack 3 extension project infrastructure to LoopBack 4 style and how to update the instructions for using your component.

  2. Migrating components contributing Models, Entities and Repositories explains how to migrate a LB3 component contributing Models into a LB4 component that contributes Entites and Repositories.

  3. Migrating access to current context describes how to migrate code accessing contextual information shared by different parts of a LoopBack application.

  4. Migrating components contributing Model mixins explains how to migrate a component that’s contributing Model mixins.

  5. Migrating components contributing REST API endpoints explains how to migrate different kinds of REST API endpoints.

There is no migration guide written for the following areas yet, please up-vote the referenced GitHub issues to let us know if you are looking for such content: