-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
chore(): Autoload module resources #7291
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
|
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.
At first glance, this is an incredible improvement – nice work!!
Imo, we can push this through, just want to keep it open for others to glance over it too
) | ||
|
||
if (!hasConnectionLoader && models.length > 0) { | ||
const connectionLoader = ModulesSdkUtils.mikroOrmConnectionLoaderFactory({ |
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.
would be good to get rid of MikroORM here eventually
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.
This is the default connection loader, since we are using mikro orm by default. Could you elaborate on your idea?
Next up is the module service boilerplate 😉 |
Yes, it will be the last one, then only the custom loaders will remain to export if you have any. This is because we need to keep the order in which they are exported as it might have an impact. Maybe we can think of something there too 👍 |
@olivermrbl should be good to re review if you want 👍 |
Will do! |
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
@shahednasser just for info it is merged now |
What
initializeFactory
in favor of usingmedusaApp
Should drastically improve the module building DX by removing a lot of boilerplate to handle by the user, that plus the base entity should simplify quite a lot the flow cc @shahednasser
Note
I had to choose a way to identify connection and container loader from the exported loader from the module. I decided to go with named function
connectionLoader
andcontainerLoader
, also, now the factories will return named function so if the user use the factories we are providing to build those loaders, the function will also be named and identified