-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(module-sdk): Shared modules loading #4611
Conversation
🦋 Changeset detectedLatest commit: 7b1919b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I have tested on @pKorsholm pr and it works with all the module being shared, which wasn't working previously |
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.
LGTM
What
Makes the modules container completely isolated no matter the
resources
module declaration. Register in the isolated container all the dependencies that are required by the modules and always includemanager
andconfigModule
when the resources are set toshared
.The shared resources should only share the mutualized manager and config module, it makes no sense that the module shares the entire container from the core and should be prevented as it can lead to unintentional behaviors and circumvent the purpose of a module which is to isolate a domain or a feature. Also, if something needs to be shared, it can be passed as a dependency through the configuration. This was also the intention first behind the implementation of the shared concept.
Also, now the product module can be shared if needed in the future (shared knex/driver connection reused by the internal ORM). The module does not export the models since we don't want the internal module models to be shared with the medusa package, nor the migrations.