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

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

Open
sajay-g opened this issue Oct 30, 2024 · 3 comments

Comments

@sajay-g
Copy link

sajay-g commented Oct 30, 2024

For which library do you need help?

native-federation, module-federation

Question

Current Stage

  • Shell Application: Using Angular 17 with the Module Federation plugin.
  • Micro-Frontend (MFE): Using Angular 17 with Module Federation plugin, and React 18 with Module Federation.

Future Stage

  • Shell Application: Upgrade to Angular 18 with the Native Federation plugin.
  • Micro-Frontend (MFE): Remains on Angular 17 with Module Federation plugin and React 18 with Module Federation.

Questions

  • Is achieving the planned future stage feasible with these configurations? If yes, links to relevant samples would be greatly appreciated.
  • Should both the Shell and MFE migrate to Native Federation at same time ?
@manfredsteyer
Copy link
Contributor

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
Copy link
Author

sajay-g commented Nov 4, 2024

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

@manfredsteyer
Copy link
Contributor

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.

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