-
-
Notifications
You must be signed in to change notification settings - Fork 374
feat: initRawContainer method #2011
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
feat: initRawContainer method #2011
Conversation
| node_remote: 'node_remote@http://localhost:3002/remoteEntry.js', | ||
| // node_local_remote: '__webpack_require__.federation.instance.moduleCache.get("node_local_remote")', | ||
| node_remote: | ||
| '__webpack_require__.federation.instance.moduleCache.get("node_remote")@http://localhost:3002/remoteEntry.js', |
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.
| container: RemoteEntryExports, | ||
| ): Module { | ||
| const remoteInfo = getRemoteInfo({ name, entry: url }); | ||
| const module = new Module({ host: this, remoteInfo }); |
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.
@2heal1, could you give me your input on this solution? I believe there are relevant use cases for when a user may sideload a container, and we need a way to convert it to a module instance.
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.
Not encounter the case , but I think this solution is okay :D

Description
This pull request adds the initRawContainer method to allow sideloading or conversion of containers into wrapped modules, which can be injected into the cache. The method improves runtime and debugging.
For server use cases or dynamic scenarios, like webpack built in script loading, its possible for the container to be loaded another way or injected into the module cache by other means.
Related Issue
Types of changes
Checklist