angular-architects / module-federation-plugin

MIT License
735 stars 203 forks source link

Load a Webpack Module-Federated Micro-Frontend in a Native Federated Shell App #682

Open sajay-g opened 3 weeks ago

sajay-g commented 3 weeks ago

For which library do you need help?

native-federation, module-federation

Question

Current Stage

Future Stage

Questions

manfredsteyer commented 3 weeks ago

Hi,

This is a good an important question. The good message is, we can use the Module Federation runtime API to load MF-based Micro Frontends. Hence, we can create a shell that loads Module Federation stuff via this runtime API and Native Federation stuff via Native Federation.

I don't have an example yet -- it's on my list. If you create a prototype, feel free to share the link here.

sajay-g commented 3 weeks ago

@manfredsteyer The initFederation function is expecting JSON remote entry files, whereas Module Federation uses JS files. Any guidance on this would be appreciated.

manfredsteyer commented 2 weeks ago

Module Federation, meanwhile, has a separate runtime API. We could use it in addition to Native Federation. This means the shell needs to init both on startup and then it needs to know which remote to load with NF and which to load with MF.

This indirection makes sense in general, as there might also be further ways for providing Micro Frontends.

Please find more info here: https://module-federation.io/

I'm going to work on an official example soon.