-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update "LB4 Component Migration" spike proposal #5427
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
lang: en | ||
title: 'Migrating components contributing Models' | ||
keywords: LoopBack 4, LoopBack 3, Migration, Extensions, Components, Models | ||
sidebar: lb4_sidebar | ||
permalink: /doc/en/lb4/migration-extensions-models.html | ||
--- | ||
|
||
{% include note.html content=" | ||
This is a placeholder page, the task of adding content is tracked by the | ||
following GitHub issue: | ||
[loopback-next#3955](https://github.com/strongloop/loopback-next/issues/3955) | ||
" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,26 +130,25 @@ coming from._ | |
17. Add a new local service (a class providing JS/TS API), e.g. Push service or | ||
(database) Migration service. | ||
|
||
- The service must be configurable by the target app (e.g. Apple & Google | ||
credentials for push notifications, transport config for logger | ||
frameworks, Amazon S3 credentials for storage component, etc.). | ||
The service must be configurable by the target app (e.g. Apple & Google | ||
credentials for push notifications, transport config for logger frameworks, | ||
Amazon S3 credentials for storage component, etc.). | ||
|
||
_LB3 typically uses component configuration. I think in LB4, we can use | ||
`@configure` specific to each service (see the logger extension for an | ||
example)._ | ||
_LB3 typically uses component configuration. I think in LB4, we can use | ||
`@configure` specific to each service (see the logger extension for an | ||
example)._ | ||
|
||
18. Inject LB3 models (LB4 entities & repositories) to the service. These models | ||
can be provided either by the extension or by the target application. When | ||
using models from the target application, the developer needs an option to | ||
specify which models (entities) and associated repositories to use. | ||
|
||
_Note: In LB4, models/entities are not injectable now, we used them | ||
primarily for the type information (to describe the shape of model data). As | ||
part of the follow-up research, we will need to decide if it's enough to | ||
inject LB4 Repository to a component or if we need to make model/entity | ||
classes injectable too. Also note that `DefaultCrudReposiory` class provides | ||
a public instance property `entityClass` referencing the model/entity it's | ||
bound to._ | ||
_Note: In LB4, models/entities are used primarily for the type information | ||
(to describe the shape of model data). As part of the follow-up research, we | ||
will need to decide if it's enough to inject LB4 Repository to a component | ||
or if we need to inject model/entity classes too. Also note that | ||
`DefaultCrudReposiory` class provides a public instance property | ||
`entityClass` referencing the model/entity it's bound to._ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the text to accommodate #5361 |
||
|
||
19. Provide a service factory to create services dynamically at runtime, e.g. | ||
named child loggers created via `app.log('name')` in LB3. | ||
|
@@ -259,19 +258,48 @@ downloads, I feel it's not necessary to provide migration guide for this case. | |
|
||
### Migrate Services (local and remote) | ||
|
||
TBD | ||
Created a follow-up epic | ||
[loopback-next#5424](https://github.com/strongloop/loopback-next/issues/5424) to | ||
look into this area later, when there is user demand. | ||
|
||
### Migrate API transports | ||
|
||
TBD | ||
Created a follow-up epic | ||
[loopback-next#5425](https://github.com/strongloop/loopback-next/issues/5425) to | ||
look into this area later, when there is user demand. | ||
|
||
### Migrate Authentication & authorization | ||
|
||
TBD | ||
Considering the huge difference between the auth & auth design in LB3 and LB4, I | ||
think it's not feasible to migrate existing LB3 auth extension(s) to in way that | ||
will preserve the high-level design. Instead, users need to approach the auth | ||
layer with a fresh perspective and structure their extensions around the new | ||
architecture of auth & auth. | ||
|
||
In that light, I don't see much value in describing how to migrate techniques | ||
from LB3 auth extensions to LB4, because such techniques are very likely to be | ||
irrelevant in LB4 world. | ||
|
||
Let's see what questions LoopBack 4 users come with and write content that's | ||
useful to current LB4 applications & extensions, instead of documenting | ||
techniques that used to be useful in the past. | ||
|
||
> 24. Add a custom step to the default LB3 authentication/authorization | ||
> workflow, so that we can compute additional information about the current | ||
> user (e.g. groups the user belongs to). | ||
> | ||
> _Note: I think this step could be replaced by lazy initialization, where | ||
> the current user groups are computed on the first access and cached for | ||
> subsequent use._ | ||
> | ||
> 25. A new role resolver (e.g. using groups), the app developer needs a way how | ||
> to configure which models/repositories to use for role resolution. | ||
|
||
### Migrate Introspection | ||
|
||
TBD | ||
Created a follow-up epic | ||
[loopback-next#5426](https://github.com/strongloop/loopback-next/issues/5426) to | ||
look into this area later, when there is user demand. | ||
|
||
## Overview of existing LB3 components | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those two blocks are just whitespace changes, I removed the extra
-
bullet point.