Micro-frontend architecture applies the microservices idea to the frontend: a large web application is split into smaller, independently developed and deployed frontend applications, each owned by a team responsible for one business area. A shell (host or container) application composes them into one user experience. Example: an e-commerce site where the Search, Product Details, Cart, Checkout and Account areas are separate micro-frontends built by different teams, all appearing as one website. How micro-frontends are integrated 1. Runtime integration with Module Federation or Native Federation - The shell loads remote modules at runtime from separately deployed bundles. Common with Angular (@angular-architects/module-federation or native-federation) and React (Webpack or Rspack Module Federation, Vite federation plugins). 2. Web Components - Each micro-frontend is packaged as a custom element (<cart-widget>), framework-agnostic and usable in any page (Angular Elements, or React wrappers). 3. Server-side or edge composition - Fragments assembled by the server or CDN (server-side includes, edge-side includes, or frameworks that compose pages on the server). 4. Iframes - Strong isolation but limited integration, routing and styling. Used for legacy or third-party content. 5. Build-time integration - Micro-frontends published as packages and bundled together; simpler, but loses independent deployment. Benefits - Independent deployments and release cycles per team. - Team autonomy aligned with business domains. - Smaller, more understandable codebases with faster builds. - Incremental migration from legacy frameworks. - Failure isolation: a broken widget can show a fallback. Challenges - Larger bundles if frameworks are duplicated (shared dependencies must be configured carefully). - Consistent UX needs a shared design system. - Cross-app communication (events, URL state, shared services) and shared authentication. - More complex local development, testing and deployment pipelines. - Versioning contracts between shell and remotes. When to use: large organisations with several teams on one product and frequent independent releases. For a single team, a well-structured modular monolithic frontend is usually simpler.
Ravindra Wadile · · 0 likes