Skip to content
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

Module federation remote loader #1041

Open
ScriptedAlchemy opened this issue Aug 27, 2022 · 5 comments
Open

Module federation remote loader #1041

ScriptedAlchemy opened this issue Aug 27, 2022 · 5 comments

Comments

@ScriptedAlchemy
Copy link

Hi, I've recently developed a better solution to loading remote scripts.

Consider require.loadChunk or webpack_require.l(url,event,id)

This will leverage webpacks own chunk loader for loading remote containers the same way import(remote/module) does within webpack module factories.

It's by far the most reliable solution.

@thet
Copy link
Member

thet commented Sep 21, 2022

@ScriptedAlchemy thanks for the heads-up! I've grepped the webpack and module-federation-examples repos for any examples but didn't find any occurrences or examples. Can you point me to something?

@thet
Copy link
Member

thet commented Sep 21, 2022

The https://github.com/module-federation/module-federation-examples/tree/master/advanced-api/automatic-vendor-sharing are quite the use case which we're tackling here.
Except that I do not even want to expose/load individual modules from my separate bundles, but everything which is defined in them and which they depend on :)

@ScriptedAlchemy
Copy link
Author

This is on npm as module-federation/utilities

Might need some adjustments to the file since it's got a loop for runtime remotes on there. (Send a pr if you want me to maintain script injection)

https://github.com/module-federation/nextjs-mf/blob/main/packages/utilities/src/utils/common.ts

@ScriptedAlchemy
Copy link
Author

Ive published it to npm, so you can use it via module-federation/utilities.

@thet
Copy link
Member

thet commented Oct 7, 2022

Just a heads up - I‌ still have this on my radar, but I'm short on time diving into that right now. Have to prepare next week's Plone conference training and my talk about module federation in Plone (resp. Patternslib) where I will revisit this proposal for sure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants