-
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
refactor: move non-core booters to their own packages #5618
Conversation
bc2d8c0
to
997dd0d
Compare
997dd0d
to
a30c458
Compare
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.
+1 to make @loopback/boot
more lightweight.
-1 to make other existing packages more heavy weight.
So far, packages likes @loopback/repository
and @loopback/rest-crud
can be used independently from @loopback/boot
, allowing applications to define their own bootstrapping strategy. I'd like to preserve that behavior.
If we want to extract the booter to their own packages, then please do that literally and create new packages to host the booters. For example: @loopback/repository-booters
and @loopback/rest-crud-booters
.
@raymondfeng can you please post a short overview of booters to show which booters are going to stay in |
Please note that the booters are contributions to the boot extension point. I don't think having their own booters in the same package will interfere with its functions.
I wonder if it's over-engineering here. Consider the user experience - I would expect The core booters left in
|
a30c458
to
319f809
Compare
319f809
to
a9ad6e3
Compare
a9ad6e3
to
081b9af
Compare
I see your points. I agree there is a value in My main concern is about dependencies. As a user adding When I was designing Model API Builder/Booter, I solved this issue as follows:
Can we perhaps adopt a similar solution for
This looks reasonable 👍 I have a question regarding the datasource booter. Both repositories ( |
I think this is a good use case of
|
I agree. There are quite a bit common code that should be ideally extracted from |
I initially had If There is an interesting connection between |
081b9af
to
8873690
Compare
8873690
to
13c4343
Compare
13c4343
to
7ff6810
Compare
7ff6810
to
4bc457f
Compare
@bajtos I have rebased this PR against the latest master. I also adopted the peerDependencies for |
7103c15
to
fc5beeb
Compare
fc5beeb
to
f32df14
Compare
@bajtos Thank you for the input. I have refactored common types/interfaces for booters into PTAL. |
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.
Following discussions, the latest refactor looks reasonable to me 👍 Had a chat with Raymond, the next step could be extracting the datasource booter to a standalone package.
@@ -44,8 +33,4 @@ describe('controller booter acceptance tests', () => { | |||
rest: givenHttpServerConfig(), | |||
}); | |||
} | |||
|
|||
async function stopApp() { |
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.
no need to app.stop()
?
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(...args: any[]) { | ||
super(...args); | ||
const ctx = (this as unknown) as Context; |
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.
is it safe to assume the RepositoryMixin always applies to a Context?
Thank you @raymondfeng for addressing my comments. I am afraid I won't be able to continue the review in a timely manner and at the same time, I don't want to block progress. I am ok to leave the final review and approval to @jannyHou. One use case to consider for testing - I think it's showing that the current design of dependencies & peer dependencies is not going to work as desired. The idea is to create a small application that depends only on
|
Signed-off-by: Raymond Feng <[email protected]> BREAKING CHANGE: Model/DataSource/Repository/ModelApi booters are moved to `@loopback/repository` and `@loopback/model-api-builder` packages. There are no breaking changes for other APIs. Existing applications should continue to work unless they use such booters explicitly.
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
Signed-off-by: Raymond Feng <[email protected]>
7100ea4
to
0cf4cff
Compare
This pull request has been marked stale because it has not seen activity within two months. It will be closed within 14 days of being stale unless there is new activity. |
This pull request has been closed due to continued inactivity. If you are interested in finishing the proposed changes, then feel free to re-open this pull request or open a new one. |
Inspired by the discussion at #5550, this PR cleans up
@loopback/boot
by moving non-core booters to their own packages.The current
@loopback/boot
is becoming a kitchen sink for all booters and it drags in unnecessary dependencies to prevent itself from being a standalone package.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈