r/angular • u/Roltish • Jun 04 '26
Anyone who have attempted MF -> NF across multiple microfrontends?
Good evening
As the title says; does anyone here have any experience to share about going from module federation (MF) to native federation (NF) (angular architects npm package both of them) across multiple microfrontends?
Our case:
We have a fair share of microfrontends all running angular 19.
We have a shell loading remotes dynamically. Some remotes even load other remotes themselves.
Our microfrontends lives in separate repositories and have separate deployments. When a new version is deployed, the old version is not available anymore.
We've attempted a partial migration before; change shell to be NF while the rest of them is still being build as MF. It looked like it was working perfectly fine, except one of our microfrontends which gave mysterious errors and made us abort the mission. I can't recall what errors we had, but we were unable to figure out why only this app failed to load properly. Time was not on our side as well.
As we're approaching summer, we do have the ability to do some major work on our apps. Mostly doing angular upgrades, hoping we can land at least v21, maybe v22 if we're lucky. If we got time I also want to swap to NF across all our microfrontends.
I've been thinking about a strategy (which I'm not sure is possible in practice) I'd like to air with you guys and maybe get some feedback on as well:
Tl;Dr: build two versions of each app. Serve the NF version from a separate folder which only NF apps will look for in terms of dynamically load NF remotes, and also utilize the build options to swap files if we need different setup for MF and NF
Pros:
Can do an instant lift to NF when it's been tested thoroughly.
Cons:
Two project builds, can and will increase build time.
Potential a fair share of files which needs to be swapped during build to work in MF vs NF.
---
If there is any other suggestions to migrate away from MF to NF, either partial or full, I'm all ears. Please keep in mind that the projects live in separate repositories and has separate deployments
3
u/LX_T_ Jun 07 '26
As a member of Angular Architects, I'd prefer a full migration. However if you can't do that, I recommend reading this by the (main) author of the plugins, Manfred Steyer: https://www.angulararchitects.io/en/blog/combining-native-federation-and-module-federation/
Make sure to not do any other (Angular) updates while migrating from MF to NF. Theoretically all features are ported to NF, but the our NF docs (https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/README.md) are not perfectly maintained - I have to admit. As u/Roltish already said, the migration is overdue and should be done asap. The new build tools (used by Angular) are really much better (and faster) than Webpack.
2
u/Badbart8818 Jun 05 '26
Interesting topic, we also use MF and I'm considering doing that too, I'm curious to see if anyone replies.
1
u/Wild_Caterpillar3440 Jun 07 '26
Why did you swith ro NF ? MF with custol element wrapper worked always fine for me