Angular 21 Microfrontend POC Infinite Loop Issue

🚨 The “Infinite Loop” that almost broke my Angular 21 Microfrontend POC I started building a GitHub POC to explore 𝗠𝗶𝗰𝗿𝗼𝗳𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝘄𝗶𝘁𝗵 𝗔𝗻𝗴𝘂𝗹𝗮𝗿 𝟮𝟭 — especially with the shift toward 𝘚𝘪𝘨𝘯𝘢𝘭𝘴-𝘧𝘪𝘳𝘴𝘵 and 𝘻𝘰𝘯𝘦𝘭𝘦𝘴𝘴 𝘳𝘶𝘯𝘵𝘪𝘮𝘦. Within minutes… my host app went into an 𝗲𝗻𝗱𝗹𝗲𝘀𝘀 𝗰𝗼𝗺𝗽𝗶𝗹𝗲 𝗹𝗼𝗼𝗽. CPU 🔥. Fans screaming. Dev server unusable. At first, I blamed: ❌ Signals ❌ Zoneless change detection ❌ Module Federation itself But the real issue? 👉 𝗗𝗲𝘃 𝘀𝗲𝗿𝘃𝗲𝗿 + 𝗠𝗼𝗱𝘂𝗹𝗲 𝗙𝗲𝗱𝗲𝗿𝗮𝘁𝗶𝗼𝗻 𝗰𝗼𝗻𝗳𝗹𝗶𝗰𝘁 --- 💡 𝗧𝗵𝗲 𝗙𝗶𝘅 (𝗔𝗻𝗴𝘂𝗹𝗮𝗿 𝟮𝟭 + 𝗠𝗼𝗱𝘂𝗹𝗲 𝗙𝗲𝗱𝗲𝗿𝗮𝘁𝗶𝗼𝗻) Check your angular.json: "publicHost": "localhost:4200", "liveReload": false, "hmr": false --- 🧠 𝗪𝗵𝘆 𝘁𝗵𝗶𝘀 𝘄𝗼𝗿𝗸𝘀 ✔ 𝗽𝘂𝗯𝗹𝗶𝗰𝗛𝗼𝘀𝘁 Stabilizes how the browser resolves remote chunks → Prevents incorrect remoteEntry resolution ✔ 𝗹𝗶𝘃𝗲𝗥𝗲𝗹𝗼𝗮𝗱: 𝗳𝗮𝗹𝘀𝗲 ✔ 𝗵𝗺𝗿: 𝗳𝗮𝗹𝘀𝗲 Stops the feedback loop: Remote updates → Host detects change → Reload → Remote reload → Repeat ♻️ --- 🎯 𝗧𝗵𝗲 𝗥𝗲𝗮𝗹 𝗟𝗲𝘀𝘀𝗼𝗻 Even with modern Angular 21: 👉 Microfrontend issues are rarely just “framework problems” 👉 They’re 𝗿𝘂𝗻𝘁𝗶𝗺𝗲 + 𝘁𝗼𝗼𝗹𝗶𝗻𝗴 + 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝗶𝗻𝘁𝗲𝗿𝗮𝗰𝘁𝗶𝗼𝗻𝘀 Sometimes the fix is not adding more features… It’s 𝗱𝗶𝘀𝗮𝗯𝗹𝗶𝗻𝗴 𝘁𝗵𝗲 𝗼𝗻𝗲𝘀 𝘁𝗵𝗮𝘁 𝗶𝗻𝘁𝗲𝗿𝗳𝗲𝗿𝗲. ---  🚀 𝗪𝗵𝗮𝘁 𝗜 𝗹𝗲𝗮𝗿𝗻𝗲𝗱  • Module Federation ≠ plug-and-play  • Dev server behavior matters as much as architecture  • Stability > convenience (especially in MFE setups) --- I’m documenting this Angular 21 microfrontend journey in my repo. If you’re working with MFEs or exploring Module Federation, let’s connect 👇 #Angular21 #Microfrontends #ModuleFederation #WebArchitecture #Frontend #SoftwareEngineering #Debugging

I would really like to see your results testing native Federation. https://www.npmjs.com/package/@angular-architects/native-federation I made a simpler proof-of-concept on my Github with some approaches and even sharing state; I think native is an interesting solution to modules because it decouples the dependency with webpack. Repo link: https://github.com/oluizcarvalho/mfe-playground

To view or add a comment, sign in

Explore content categories