Tip: Missing instructions for your LoopBack 3 use case? Please report a Migration docs issue on GitHub to let us know.
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
- register new Operation Hooks
- register new Remote Hooks
- define new relations
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:
- Model and Entity classes
- Mixins
- Decorators
- Sequence Actions
- Controllers
- Life cycle observers
- Repositories
- Service proxies
- Servers
- HTTP request parsers
- Extensions for Extension Points
- Booters
- Model API builders
- Extensions for Extension Points defined by 3rd-party component
- Any other values to be bound in
Application
’s context:- Classes
- Providers
- Arbitrary bindings (instances of
Binding
class)
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.
-
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.
-
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.
-
Migrating access to current context describes how to migrate code accessing contextual information shared by different parts of a LoopBack application.
-
Migrating components contributing Model mixins explains how to migrate a component that’s contributing Model mixins.
-
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:
-
Migrating services (local and remote): loopback-next#5424
-
API transports (websockets, pub/sub message consumers): loopback-next#5425
-
Introspection of application artifacts: loopback-next#5426