Angular Micro Frontends: concepts and trade-offs
What you’ll learn
Section titled “What you’ll learn”- What a micro frontend (MFE) is, and which organizational problem it actually solves.
- How a shell application composes independently deployed remotes at runtime.
- Who provides federation for Angular: community tooling, not the Angular framework.
- How Native Federation and webpack Module Federation differ, and which one this section recommends.
- When micro frontends are the wrong answer, and what to use instead.
Summary
Section titled “Summary”A micro frontend architecture splits one user-facing web application into several separately built and separately deployed frontend applications that are composed into a single experience in the browser. One application, the shell (or host), owns the page frame, top-level navigation and sign-in. The others, the remotes, each own a business area and are loaded on demand when the user navigates to it.
Angular does not ship a federation feature. Runtime composition comes from community tooling, chiefly the Angular Architects packages: @angular-architects/native-federation (built on browser-standard ES modules and import maps, and working with the Angular CLI’s esbuild-based application builder) and @angular-architects/module-federation (an adapter for webpack Module Federation). For a new Angular 22 system this section recommends Native Federation. Use webpack Module Federation when you are extending an existing webpack-based federation system. Exact versions are listed once, in Prerequisites.
Throughout the section we use one invented example: OrdersPortal, a back-office shell (orders-portal) that loads an orders-mfe remote owned by a separate team, deployed to hosts under example.test.
Context and forces
Section titled “Context and forces”Micro frontends are an answer to a people problem before they are a technical pattern. A single Angular application scales well technically: standalone components, lazy routes and the esbuild builder keep build times and bundles under control well into hundreds of thousands of lines. What does not scale as smoothly is coordination. When five teams commit to one repository and one release train, every release needs everyone to be ready, a regression in one area blocks shipping in all the others, and upgrades of Angular or shared libraries become a multi-team negotiation.
The forces that push an organization toward micro frontends are therefore:
- Independent release cadence. The orders team wants to ship on Tuesday without waiting for the customers team’s Friday release.
- Team autonomy and ownership. Each team owns a vertical slice (UI, its backend for frontend, its tests, its pipeline) and is on call for it.
- Fault isolation. A broken build or a failed deployment in one area should not prevent the rest of the product from shipping or loading.
- Incremental migration. A large legacy frontend can be replaced one area at a time, with old and new parts composed in the same shell.
The forces pulling the other way are just as real: a consistent user experience, a single design system, shared authentication, acceptable page weight, and the cost of running many pipelines. Every micro frontend design is a negotiation between these two sets of forces.
The design
Section titled “The design”
A federated Angular system has four moving parts:
- Shell (host). A normal Angular application that renders the layout and top-level router. It does not import remote code at build time. It knows remotes only by name and by the URL of their metadata file.
- Remotes. Normal Angular applications that additionally expose some entry points, typically a
Routesarray or a standalone component. Each remote can also run on its own, which is how its team develops and tests it. - Federation metadata. At build time the federation tooling emits a small metadata file per remote. With Native Federation it is
remoteEntry.json(plus animportmap.json); with webpack Module Federation it isremoteEntry.js. The file lists what the remote exposes and which shared libraries it was built against. - Runtime loader. Before Angular bootstraps, the shell initializes federation: it reads a manifest that maps remote names to metadata URLs, negotiates shared dependencies, and later loads exposed modules when a route needs them.
The flow at runtime for OrdersPortal looks like this:
- The browser loads the shell’s
index.htmlandmain.ts. main.tscallsinitFederation('federation.manifest.json'), which fetches the manifest and each remote’sremoteEntry.json, then builds an import map that decides which copy of@angular/core,@angular/router,rxjsand other shared packages every application will use.- Only then is the real bootstrap file imported and
bootstrapApplication()called. This ordering is why generated projects splitmain.tsandbootstrap.ts: Angular itself is a shared library and must not be loaded before negotiation finishes. - When the user navigates to
/orders, a lazy route callsloadRemoteModule('orders-mfe', './routes'), receives the remote’sRoutes, and the router continues as if the routes were local.
The key property is that the shell’s build never contains the remote’s code. The orders team can deploy a new orders-mfe build, and the next browser session picks it up without the shell being rebuilt.
Who provides federation
Section titled “Who provides federation”It is worth being precise, because many articles blur this:
| Piece | Provided by |
|---|---|
Standalone components, bootstrapApplication, provideRouter, loadChildren, loadComponent |
Angular (framework) |
esbuild-based application builder and dev server (@angular/build) |
Angular CLI |
Native Federation builder, schematics, initFederation, loadRemoteModule |
@angular-architects/native-federation (community, Angular Architects) |
| Module Federation runtime and container format | webpack (and the Module Federation project) |
| Angular CLI integration for webpack Module Federation | @angular-architects/module-federation plus @angular-builders/custom-webpack (community) |
Angular’s own documentation acknowledges the scenario. Its versioning page describes compiler ABI stability across patch versions of the same minor version as something that “unblocks use cases like microfrontends”, and its custom build pipeline page points to Native Federation as the bundler-agnostic option. Neither makes federation an Angular feature, and support comes from the tool maintainers, not from the Angular team.
That has a practical consequence worth stating neutrally: both Angular adapters are maintained mainly by one consultancy, Angular Architects, with community contributors, and each release tracks an Angular minor. Before you commit, look at the release history and issue activity of the packages you will depend on, and keep your own code (routes, contracts, fallbacks) independent of the adapter so that a migration stays possible.
Native Federation or webpack Module Federation
Section titled “Native Federation or webpack Module Federation”Both implement the same mental model: remotes expose modules, hosts load them at runtime, and shared libraries are negotiated so they load once. The difference is the build pipeline.
- Native Federation delegates to the Angular CLI’s esbuild application builder, which is the default for new Angular projects. Remotes are plain ES modules wired together with an import map (polyfilled by
es-module-shims). This keeps you on the standard toolchain and its performance. - webpack Module Federation requires switching the project back to a webpack builder through
@angular-builders/custom-webpack. Its runtime is the Module Federation project’s@module-federation/enhanced2.x, which webpack and Rspack builds share. When you run the Angular Architectsng addagainst an esbuild project, the schematic itself warns that it uses the traditional webpack implementation and suggests Native Federation for new projects.
The Native Federation README states that SSR, incremental hydration and i18n are supported out of the box; with the webpack path you leave the CLI’s esbuild builder behind, along with the SSR and build-speed work that targets it.
Pick webpack Module Federation when you must join an existing Module Federation estate, for example a shell that already loads React or Vue remotes through remoteEntry.js files. The details live in Webpack Module Federation.
Realistic worked example
Section titled “Realistic worked example”OrdersPortal is an internal tool for an invented distributor. The platform team owns the shell: header, navigation, sign-in, error pages and the design system. The orders team owns orders-mfe, which exposes a Routes array with an order list and an order detail page. A customers team will add customers-mfe next quarter.
The shell’s route table contains one lazy entry per remote. The orders team can run orders-mfe on its own at http://localhost:4201/orders and ship it to https://orders.example.test/ on its own pipeline. The shell’s manifest names that stable URL, so a normal orders release replaces the files behind it and touches neither the manifest nor the shell; a rollback redeploys the previous orders build. Before deploying, the orders pipeline checks that the build still exposes what the shell expects and uses the shell’s Angular minor. If orders-mfe is down, the shell still loads and shows a “temporarily unavailable” message with a reload button on /orders while the rest of the portal works. The pages that follow build exactly this system: project setup, the remote, the shell, local testing and deployment to Azure.
Trade-offs and alternatives
Section titled “Trade-offs and alternatives”| Approach | Independent deploys | Runtime cost | Consistency | Good fit |
|---|---|---|---|---|
| Single Angular app with lazy routes | No | Lowest | Easiest | One or two teams, one release train |
| Monorepo with libraries (Angular CLI or Nx) and enforced boundaries | No (one deployable) | Lowest | Easy | Many teams that can share a release |
| Build-time composition via versioned npm packages | No (host must rebuild) | Low | Medium | Shared widgets with slow change rates |
| Runtime federation (Native or webpack MF) | Yes | Medium (manifest, negotiation, extra requests) | Needs governance | Several autonomous teams, one product |
| Web components (Angular Elements) loaded by script | Yes | Higher if each bundles its own framework | Harder | Mixed frameworks, widget-style embedding |
| iframes | Yes | High; isolated | Hardest (focus, routing, sizing) | Strong isolation, third-party content |
| Server-side or edge composition | Yes | Depends | Medium | Content-heavy sites, SEO-critical pages |
Failure modes and operations
Section titled “Failure modes and operations”- Version drift. A remote built with a different Angular minor than the shell loads its own copy of Angular, and its area breaks at render time; with the runtime’s strict mode switched on, the whole shell refuses to start instead. Only a check before deployment protects users.
- Contract breaks. The exposed
Routesor component inputs are a public API between teams. Nothing checks them at compile time across repositories, so they break at runtime. - Partial outages. A remote that is unreachable must degrade to a fallback, not a blank screen. See Host application setup.
- Deployments under open tabs. A tab that loaded the previous
remoteEntry.jsonasks for hashed files the new deployment removed. Hosting and the shell both need to handle it (Azure deployment). - Operational load. Every remote needs its own pipeline, environments, monitoring and on-call rotation.
Advanced concepts covers each of these in depth.
When not to use it
Section titled “When not to use it”Do not adopt micro frontends to fix slow builds, large bundles or messy code; lazy loading, the esbuild builder and library boundaries fix those more cheaply. Avoid them when one team owns the whole UI, when every feature change touches every area anyway, or when you cannot afford a platform team to own the shell, the shared design system and the federation upgrade path.
Know what independence you are not getting. The shell and every remote must share one Angular minor, because Angular promises compiler ABI compatibility only across patches. Every Angular minor or major upgrade is therefore a coordinated release of all applications, gated by the slowest team; the options when a team misses the date are described in Advanced concepts. If your teams cannot agree on an upgrade calendar, federation will make that disagreement visible with every Angular minor (four to six a year, per Angular’s release schedule) and every yearly major.
A useful rule: if you cannot name which team would deploy each remote independently next month, you do not need federation yet.
Senior interview scenarios
Section titled “Senior interview scenarios”“Three teams share one Angular app and releases keep slipping. Do we need micro frontends?” Start by measuring where the coupling is. If it is in the release process, a monorepo with enforced module boundaries, trunk-based development and feature flags may solve it. Federation is justified when teams need different release cadences and you are ready to fund a platform team.
“How does the shell avoid loading Angular twice?” Shared dependencies are declared in each federation config (singleton, strict version). At startup the runtime negotiates one version per shared package and builds an import map so every remote resolves @angular/core to the same file. That works only when every build uses the same Angular minor: with default options, a skewed remote quietly gets its own copy of Angular and breaks at render time, so a strong answer adds that the agreed minor is enforced in each remote’s pipeline before deployment.
“A remote is down in production. What does the user see?” A well-designed shell catches the failed remote load in the lazy route and renders a fallback component, while the rest of the portal keeps working, and it reports the failure to monitoring.
“A product manager wants the new customers area as a remote ‘so it can ship faster’. The same team owns orders and customers.” Federation buys independence between teams, and here there is one team. A second remote would add a pipeline, a contract, a CORS and CSP entry and a share in every Angular upgrade, while the team still releases both. Recommend a lazy-loaded route in the existing remote (or a library) and revisit when a separate team owns customers.
Key takeaways
Section titled “Key takeaways”- Micro frontends trade runtime and operational complexity for team autonomy and independent deployment.
- The shell owns layout, navigation and sign-in; remotes own business areas and expose routes or components.
- Federation is community tooling. For new Angular 22 projects on the esbuild builder, start with Native Federation.
- Shared dependencies, contracts and failure handling decide whether the architecture works in production.
- Angular upgrades stay a coordinated, all-teams release; plan for it from day one.
- If you do not have independently deploying teams, prefer a modular monolith.
Related pages
Section titled “Related pages”- Section guide and reading path
- Prerequisites and toolchain
- Webpack Module Federation
- Advanced concepts
- Angular application architecture
- Standalone components
- Microservices overview
Official references
Section titled “Official references”- Angular v22: Versioning and releases (compiler ABI stability)
- Angular v22: Custom build pipelines
- Angular v22: Lazy-loaded routes
@angular-architects/native-federation22.2.5: npm package and README@angular-architects/module-federation22.0.0: npm package and README- Native Federation v4 documentation
- webpack Module Federation concepts