-
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
[Spike] Drop LB3 model files into LB4 app #2224
Comments
work in progress: https://github.com/strongloop/loopback-next/tree/spike/lb3 |
the pull request: #2274 |
Cross-posting #2274 (comment) I have discussed the spike with @raymondfeng & @dhmlau and we agreed to stop pursuing this direction. While it does provide relatively easy migration path for LB3 users, there are too many downsides for us. Most importantly, we are re-introducing LB3 codebase that we wanted to get rid of, plus we are delaying the time when LB3 users will finally move to the new LB4 design. As a short-term solution, we will allow LB3 users to mount their entire LB3 app in an LB4 project - see #2301, #2318 and the list of follow-up tasks posted in #2318 (comment):
For longer-term, we will look into ways how to simplify migration from LB3 models to LB4. I'll create follow-up spike stories for that soon. |
The list of follow-up stories:
|
I am closing the spike as done. |
The migration approaches described in #485 and #1849 have a major problem: they require developers to migrate everything in one big change, there is no way how to migrate in smaller self-contained steps. I would like to look into ways how to make the migration more incremental.
Background
Essentially, LB3 consists of three parts:
loopback-datasource-juggler
providing ORM (data modelling and database access),strong-remoting
providing REST API layer, andloopback
glueing all things together. In LB4, we are still using the same juggler under the hood.strong-remoting
was replaced with@loopback/rest
and the "glue" has been completely rewritten.The idea
Carry over LB3 models (
.json
and.js
files) into LB4. Use juggler v4 under the hood, there were very little changes from LB3 there. Write a compatibility layer that will process strong-remoting metadata and build LB4 controllers and/or handler routes to expose LB3-flavored models via the new REST API layer.The envisioned user experience
@loopback/compat-v3
extension to the LB4 appThe plan
Things we will need to implement (or copy from LB3):
app.registry
)Model
andPersistedModel
)loopback-boot
responsible for model definition & registrationThings to implement anew:
loopback-swagger
to convert strong-remoting metadata into OpenAPI spec that's used as the remoting format by LB4.Things that will not work (in the first version)
Task list
@loopback/rest
The text was updated successfully, but these errors were encountered: