# Learn the idea before the tools
Each lesson is a few short steps. Read it simply, or open the detailed and deep-dive layers when you want more. Every claim links to its sources.
## Lessons
1. Lesson 1
### [What are micro frontends](https://microfrontends.dev/learn/what-are-micro-frontends)
Explain micro frontends as independently developed and deployed frontend pieces, owned by different teams, that come together as one experience.
5 steps · ~5 min
2. Lesson 2
### [Problems they solve](https://microfrontends.dev/learn/problems-they-solve)
Identify the real drivers for micro frontends, team autonomy, independent deploys, scaling across many teams and incremental migration, and tell them apart from problems micro frontends don't fix.
5 steps · ~4 min
3. Lesson 3
### [When NOT to use them](https://microfrontends.dev/learn/when-not-to-use)
Recognize the costs of micro frontends, complexity, performance, UX consistency and tooling overhead, and why small teams rarely benefit.
5 steps · ~5 min
## Already know the basics?
Ten questions tell you whether your team needs micro frontends at all.
[Take the decision check](https://microfrontends.dev/decide)
Source: https://microfrontends.dev/learn
---
# What are micro frontends
_Objective: Explain micro frontends as independently developed and deployed frontend pieces, owned by different teams, that come together as one experience._
## Step 1: One app, many teams
Picture an online shop. One team works on search, another on the cart, another on checkout. They all change the same frontend codebase and ship it as one app.
That works well for a while. As the app and the number of people grow, the frontend gets harder to maintain. Michael Geers calls this the **frontend monolith**: one frontend layer that keeps growing, often built by a separate team from the backends it sits on.
**Detailed.**
The trouble is rarely the size of the code on its own. It is that every team changes the same thing: a shared build, shared release dates and shared dependencies. A small change from one team can wait on another team's unfinished work.
**Deep dive.**
Geers describes how the microservice idea split the backend into services owned by different teams, while the frontend often stayed one layer on top of them. Micro frontends apply the same thinking to the frontend.
## Step 2: Split by feature, not by layer
Micro frontends start from teams, not technology. Instead of one team for the whole frontend, each team owns a feature, such as search or checkout, and builds it **end to end**, from its data to what the user sees.
Geers calls this organizing in **verticals**: each team is cross-functional and works through the whole stack for its feature.
Where you draw the line between teams decides how often they have to talk to each other. Try it: give four shop features to two teams and watch which conversations cross the boundary.
**Demo: Split the monolith.**
Four features of a shop, Search, Cart, Checkout and Profile, start in one codebase, and you give each one to Team A or Team B. Four lines connect them, weighted by how much they talk: Cart and Checkout the most (line items and totals, 3), Search and Cart (add to cart, 2) and Checkout and Profile (address and payment, 2) less, and Profile and Search the least (personalisation, 1). Every line that ends up between two teams adds its weight to the cross-team coupling, out of 8. Putting Search and Checkout on one team and Cart and Profile on the other makes every line cross: 8 of 8, high coupling. Giving Search to Team A and the other three to Team B leaves only the light lines crossing: 3 of 8, low. Giving everything to one team is still a monolith. The weights are illustrative.
Takeaway: Boundaries matter more than tools. In our view, chatty features like Cart and Checkout belong on one team, with the split where communication is rare. No framework fixes a boundary that cuts through a conversation.
**Detailed.**
Cam Jackson makes the same point about team structure: teams own vertical slices of the product, often a whole page. He warns against horizontal teams, such as a team that only does styling, because they bring back the coordination micro frontends are meant to remove.
You will also meet "vertical" and "horizontal" used for how pieces are composed. Natalia Venditto calls it a vertical split when each app loads at its own URL, and a horizontal split when pieces from several teams share one page or view.
## Step 3: Delivered separately, seen as one
Cam Jackson's article on martinfowler.com defines micro frontends as an architectural style in which frontend applications that can be **delivered independently** are **composed into a greater whole**.
Two parts of that matter. Each piece can be built, tested and released without waiting for the others. And the user should not notice the seams: they see one shop, not five apps.
**Detailed.**
"Independently deliverable" is the important phrase. Splitting code into packages or folders is not enough on its own. If every piece still goes out in one shared release, the teams have not gained the independence the style is about.
**Deep dive.**
Geers lists principles that follow from this, among them: each team chooses and upgrades its own stack without coordinating, team code is isolated even when everyone uses the same framework, and the site stays useful even when JavaScript fails or has not run yet.
## Step 4: Where the pieces come together
Something has to put the pieces on one page. This step is called **composition**, and it can happen in different places:
- **At build time**: each piece is a package, and the shell bundles them all into one app.
- **On the server**: the server stitches HTML fragments from each team into one page.
- **In the browser, at runtime**: a shell loads each team's code while the page runs, through JavaScript, Web Components or iframes.
The demo below puts the two ends of that list side by side: a shell that loads each team's app while the page runs, and one that bundles every team's package at build time. Ship one change in each and count what has to be redeployed.
**Demo: Runtime composition.**
A shell at shop.example.com has two empty slots. With runtime composition, the shell asks each team's own server for its entry file, remoteEntry.js, while the page runs, and the team's app mounts in its slot; the shell itself is never rebuilt. When Team A ships v2, it deploys to its own server and the shell fetches the new version on the next load: only Team A's code ships, 1 of 3. With build-time integration, both apps are npm packages compiled into the shell's one bundle, so the same change rebuilds and redeploys the shell's bundle, and the code of all 3 apps ships again: Team B redeployed nothing, but its unchanged code rides along. Runtime composition saves that rebuild, and costs extra requests when the page loads, an entry file and a chunk per team app.
Takeaway: Team A shipped alone. The shell only knows a URL, so nothing else was rebuilt. Runtime composition buys independent deploys, paid for with extra requests at page load.
**Detailed.**
Where composition happens decides how independent the teams really are. Jackson points out that build-time integration brings back a lockstep release process: to change one piece, the whole app is rebuilt and released, which is why he recommends against it for micro frontends. Runtime composition lets a team release its piece without rebuilding the shell, at the cost of more moving parts in the browser.
**Deep dive.**
Jackson describes runtime integration through JavaScript, where each piece exposes an entry function the shell calls to mount it, as the most flexible option and the one he sees teams adopting most often. iframes give strong isolation but make routing, deep links and responsive layouts harder. The approach pages on this site compare these options in detail.
## Step 5: A style, not a tool
Micro frontends are a way to organize teams and releases, not a library you install. Tools such as Module Federation or single-spa are ways to put the pieces together, and each team can still choose how it builds its own piece.
Jackson ends his article by saying that micro frontends are far from the only way to scale a frontend. The next lessons cover the problems they solve and, just as important, when they are not worth it.
**Detailed.**
A useful test: if your teams already ship independently and rarely wait on each other, you may not need micro frontends at all. The style earns its cost when coordination between teams is the thing slowing you down. That is our view, and the decision check walks through it.
## Step 6: Recap and check
- **Teams split by feature, not by layer.** Each team owns a feature such as search or checkout, from its data to what the user sees.
- **Each piece is delivered on its own.** A team builds, tests and releases its piece without waiting for the others, and users still see one product.
- **Where the pieces meet decides how independent teams are.** Bundling every piece at build time ties releases together again; composing on the server or in the browser keeps them apart.
**Quick check (not scored).** Which of these is a micro frontend architecture?
- A. One React app, split into many components that one team builds and releases together.
- B. A checkout page and a search page built by two teams, each released on its own, shown together in one site.
- C. A frontend that calls several backend microservices.
Answer: B. A checkout page and a search page built by two teams, each released on its own, shown together in one site.
- A: Components are a way to organize code. If everything is built and released together by one team, it is a well-structured single app, not micro frontends.
- B: Separate teams, separate releases, one experience for the user. That is the core of the idea.
- C: Many single frontends talk to microservices. The question is how the frontend itself is split and released, not how many services it calls.
Covers: Delivered separately, seen as one
**Quick check (not scored).** Team A publishes its part as an npm package that the shell installs and bundles. When Team A fixes a bug, what has to happen before users see it?
- A. Nothing more. Team A deploys its package and users get it on the next page load.
- B. The shell updates the package version, rebuilds and redeploys.
Answer: B. The shell updates the package version, rebuilds and redeploys.
- A: Not with build-time integration. The package only reaches users inside the shell's bundle, so the shell has to be rebuilt.
- B: With build-time integration every change ships through the shell's build. That is simple, but it ties Team A's release to the shell's.
Covers: Where the pieces come together
## Sources
- [Micro Frontends](https://martinfowler.com/articles/micro-frontends.html), Cam Jackson · martinfowler.com
- [Micro Frontends – extending the microservice idea to frontend development](https://micro-frontends.org/), Michael Geers · micro-frontends.org
- [Module Federation](https://webpack.js.org/concepts/module-federation/), webpack documentation
- [Getting Started with single-spa](https://single-spa.js.org/docs/getting-started-overview/), single-spa.js.org
- [Micro-frontend Architecture](https://microfrontend.dev/architecture/micro-frontends-architecture/), Natalia Venditto · microfrontend.dev
- [Micro-Frontends Splits - Vertical Split](https://microfrontend.dev/architecture/vertical-micro-frontend-split/), Natalia Venditto · microfrontend.dev
https://microfrontends.dev/learn/what-are-micro-frontends
---
# Problems they solve
_Objective: Identify the real drivers for micro frontends, team autonomy, independent deploys, scaling across many teams and incremental migration, and tell them apart from problems micro frontends don't fix._
## Step 1: The real driver is people
Micro frontends are mostly about **teams**, not code. When several teams work on one frontend, they keep stepping on each other: the same build, the same release, the same files.
The idea is to let each team own a part of the product completely, so it can decide and ship without waiting for others. Cam Jackson calls these **autonomous teams**, each owning a slice of the product from idea to production.
Natalia Venditto makes the same point: splitting a frontend mainly solves organizational problems, such as teams working on features with different development cycles. Her advice is to ask whether you really have those problems before choosing micro frontends.
**Detailed.**
Jackson recommends slicing teams around what users see, often a whole page or feature, rather than around technical layers. A team that owns "checkout" can change its page end to end; a team that owns "styling" has to coordinate with everyone.
**Deep dive.**
Geers adds that each team should be able to choose and upgrade its own stack without coordinating with other teams. In practice many organizations keep one framework for consistency and hiring, and use the separation mainly for ownership and release independence.
## Step 2: Shipping without waiting
In one shared frontend, every change rides in the same release. If one team's work is not ready, others wait, or the release goes out with a half-finished feature hidden behind a flag.
With micro frontends, each piece has its **own pipeline to production**. Jackson's point is that a team's release should not depend on the state of anyone else's codebase.
The demo below plays one week of finished work both ways: on a shared release train, and with each team deploying on its own.
**Demo: Independent deploys.**
Two teams finish three changes in one week: Team A's v2 on Monday, Team B's fix v1.1 on Wednesday and Team A's v3 on Thursday. With a release train, everything ships together on Friday, so finished work waits: v2 for 4 days, the fix for 2 and v3 for 1, 7 team-days in all, for one release. With independent deploys, each change goes live the day it is ready: three releases, no waiting, and Team B never has to coordinate with Team A. The days are illustrative.
Takeaway: Same work, 7 team-days sooner. Independent deploys don't make teams faster: they stop finished work from waiting for everyone else. In our view, if your teams rarely wait, this benefit is small.
**Detailed.**
This only holds when the pieces are composed at runtime or on the server. If each piece is a package bundled into the shell at build time, the shell still has to rebuild and release for any change to reach users, and teams are back to sharing a release.
**Deep dive.**
Independent deploys move work elsewhere: each team now needs its own pipeline, environments and a way to roll back its piece without breaking the page.
## Step 3: Smaller codebases
Each micro frontend is a smaller codebase than the whole app. A team can understand all of its own code, and it is harder to reach into another team's code by accident.
Jackson notes a side effect: sharing domain models between micro frontends becomes harder on purpose, which pushes teams toward clearer, more explicit contracts.
**Detailed.**
Smaller does not mean simpler overall. The total amount of code, pipelines and infrastructure usually grows. What shrinks is what each team has to hold in its head.
## Step 4: Changing an old frontend piece by piece
Rewriting a large legacy frontend in one go is risky and slow. Micro frontends offer another path: replace **one part at a time**, while the rest keeps running.
Jackson describes this as an incremental upgrade: a new piece built with new tools sits next to the old ones, and the old app shrinks piece by piece instead of everything stopping for one big upgrade.
Try both plans on the same shop and compare when users first get something new.
**Demo: Strangler fig migration.**
A router sits in front of a legacy shop that serves /search, /product, /cart and /checkout. Route by route, the team rebuilds one route at a time, about two weeks each, and points the router at the new code as soon as it is ready: /search goes live at week 2, /product at week 4, /cart at week 6 and /checkout at week 8, while the legacy app keeps serving everything not yet moved. If a new route misbehaves, the router sends it back to legacy without a rebuild, and once nothing routes to legacy, the legacy app can be removed. A big-bang rewrite takes the same eight weeks, but nothing reaches users until all four routes switch at once at week 8. By then, route by route has had 12 route-weeks live, against none. The weeks are illustrative.
Takeaway: Migrate one route at a time, not all at once. Each route reaches users as soon as it is ready, and a bad one can be routed back. In our view, the first route you move is the experiment that tells you whether to move the rest.
**Detailed.**
The same works for framework upgrades. One team can move its piece to a new framework version while others stay where they are, instead of the whole app upgrading on one date.
**Deep dive.**
This is the strangler fig pattern applied to the frontend. Martin Fowler's version of the idea: build the new system around the edges of the old one and let it grow, until the old system can be switched off.
## Step 5: What they don't solve
Micro frontends are a fix for **coordination between teams**. In our view they are not a fix for:
- **Slow pages.** Separately loaded pieces usually add requests and can duplicate libraries.
- **A messy codebase in one team.** Splitting it adds deploys without removing the mess; better module boundaries are cheaper.
- **Unclear ownership.** If nobody knows who owns what, splitting the code just moves the confusion.
**Detailed.**
A quick test before adopting them: name the teams that would own each piece, and the waiting you expect to remove. If you can't name more than one team, or there is no waiting, the next lesson is the one to read.
## Step 6: Recap and check
- **The real driver is people.** Micro frontends remove waiting between teams that share one frontend, not problems in the code itself.
- **Each team ships without waiting.** A finished change reaches users through its own pipeline, as long as the pieces are composed at runtime or on the server.
- **Old frontends can be replaced piece by piece.** New code takes over one part at a time while the legacy app keeps running, so users get something new sooner.
- **They don't fix slow pages, messy code or unclear ownership.** Splitting adds deploys without removing those causes; in our view cheaper fixes come first.
**Quick check (not scored).** Team B finishes a fix on Monday. In a shared frontend release, Team A's half-done feature blocks the Tuesday release. Which benefit of micro frontends targets this?
- A. Independent deployment
- B. Smaller bundles
- C. Better code quality
Answer: A. Independent deployment
- A: With its own pipeline, Team B's fix goes out when Team B is ready, whatever state Team A's code is in.
- B: Micro frontends often make total download size larger, not smaller. The problem here is waiting on another team, not bytes.
- C: Splitting can make accidental coupling harder, but nothing here is about quality. Team B is waiting on a shared release.
Covers: Shipping without waiting
**Quick check (not scored).** A single team of five has a slow, messy frontend. Which problem would micro frontends most likely solve for them?
- A. The slow page loads
- B. The messy code
- C. Probably neither
Answer: C. Probably neither
- A: Splitting into separately loaded pieces usually adds requests and can duplicate libraries. Performance work is a separate job.
- B: One team splitting its own code into separately deployed apps adds pipelines and coordination without removing the mess. Better module boundaries are cheaper.
- C: In our view, yes. Micro frontends solve coordination between teams. One team has little of that to remove, so it pays the costs without the main benefit.
Covers: What they don't solve
## Sources
- [Micro Frontends](https://martinfowler.com/articles/micro-frontends.html), Cam Jackson · martinfowler.com
- [Micro Frontends – extending the microservice idea to frontend development](https://micro-frontends.org/), Michael Geers · micro-frontends.org
- [Strangler Fig](https://martinfowler.com/bliki/StranglerFigApplication.html), Martin Fowler · martinfowler.com
- [Micro-frontend Architecture](https://microfrontend.dev/architecture/micro-frontends-architecture/), Natalia Venditto · microfrontend.dev
- [Pros and cons of micro-frontends](https://microfrontend.dev/architecture/micro-frontends-pros-and-cons/), Natalia Venditto · microfrontend.dev
https://microfrontends.dev/learn/problems-they-solve
---
# When NOT to use them
_Objective: Recognize the costs of micro frontends, complexity, performance, UX consistency and tooling overhead, and why small teams rarely benefit._
## Step 1: Every split has a price
Each micro frontend brings its own repository or package, pipeline, environment and hosting. That is more to build, monitor and keep up to date.
Cam Jackson calls this **operational and governance complexity**. His advice is to ask honestly whether your organization has the automation and maturity to run many small frontends without chaos.
**Detailed.**
The cost grows with the number of pieces, not just the size of the app. Five micro frontends mean five pipelines to keep green, five sets of dependencies to update, and a shell that has to work with all of them.
**Deep dive.**
Governance is the quieter cost. Someone has to decide how pieces talk to each other, which shared libraries exist and who maintains them. Jackson suggests a custodian for shared component libraries, and keeping communication between pieces minimal.
## Step 2: More bytes, more requests
When each piece is built separately, it may bundle its own copy of the same libraries. The user then downloads them more than once. Jackson calls this the **payload size** problem.
Sharing libraries across pieces avoids the duplication, but it brings back coupling: teams have to agree on versions again. How much you pay, and where, depends on how the pieces are put together. Try three ways of building the same page below.
**Demo: Performance waterfall.**
The same page is built three ways, here with three team apps. With iframes, every app is a full page with its own HTML, its own copy of React and its own code: three apps mean three Reacts, 257 KB in all, and the page is interactive at about 750 ms, while first paint at 220 ms shows only the shell. With Module Federation, one shell and one shared React load first, then each remote adds a small entry file and a chunk: 149 KB, interactive at about 600 ms, with the slots empty at first paint. With server composition, the server fetches every fragment before it sends one composed page, so the content is already in the HTML at first paint, around 270 ms, and the browser only loads styles, React and small hydration scripts: 117 KB, interactive at about 470 ms, with the fragment fetches now happening on your servers. The model fetches fragments in parallel, as nginx SSI does; Fastly's ESI processes includes one after another, so there every fragment adds to the wait. The model and its numbers are illustrative, not a benchmark.
Takeaway: Every approach moves the cost somewhere. iframes download a framework per app, federation adds round trips per remote, and server composition moves the work to your servers. Measure the page your users actually load.
**Detailed.**
Loading pieces at runtime can also mean extra round trips before the page is complete: first the shell, then each piece. Jackson notes that splitting can also speed up some first loads, since a page only needs its own code, and that the net effect has to be measured, not assumed.
**Deep dive.**
Measure with real pages, not demos: total JavaScript per page, the number of requests before the main content shows, and how a slow or failing piece affects the rest. Setting a performance budget per team keeps duplication visible.
## Step 3: Consistency gets harder
Users expect one product: the same buttons, the same spacing, the same behavior. When several teams release on their own schedules, small differences creep in.
CSS makes this harder because it is **global by nature**. Jackson notes that styles from one piece can leak into another unless teams isolate them on purpose.
**Detailed.**
Jackson also warns about **environment differences**: a piece developed on its own may look and behave differently once it runs next to the others, especially with global styles. He recommends integrating often in an environment that looks like production.
**Deep dive.**
A shared design system helps, but it is itself a shared dependency. Jackson's advice is to share only presentational building blocks, not domain logic, and not to create the shared library too early.
## Step 4: Small teams rarely benefit
Micro frontends remove **waiting between teams**. If there is only one team, there is little waiting to remove, but all the costs above still apply. As Natalia Venditto warns, adopting them without a real problem to solve can do more harm than good.
In our view, a single team, or a few teams that rarely block each other, should usually stay with one well-structured app. The decision check follows the same view: it never rates one team a reasonable fit, and for a few teams that rarely block each other it recommends one app or, at most, starting small with one pilot, unless a legacy app is being replaced piece by piece. It is also the choice this site makes for itself.
**Detailed.**
Signs you might need micro frontends: several teams regularly wait on each other's releases, parts of the app need different release speeds, or a legacy frontend has to be replaced piece by piece. Signs you don't: one team, one release rhythm, and pain that comes from code structure rather than coordination.
## Step 5: Try the cheaper options first
Most of the ownership benefits can come from a **modular monolith**: one app and one deploy, split into modules that teams own, with rules that stop modules from reaching into each other. Natalia Venditto calls modularization a valid way to decouple a monolith, and argues it is more often than not the most suitable one.
Monorepo tools can check those rules for you. Nx can enforce module boundaries with tags and lint rules, and Turborepo has a boundaries check for packages. Both run in CI, so a forbidden import fails the build instead of reaching production.
**Detailed.**
A modular monolith keeps one build and one release, so teams still share a release train. If that shared release becomes the bottleneck, the module boundaries you already have are a good place to start splitting, one piece at a time.
**Deep dive.**
Jackson argues against integrating micro frontends at build time because it brings back lockstep releases. That criticism is about micro frontends that need independent deploys. If you don't need independent deploys, one build is not a drawback but the simplest option.
## Step 6: Recap and check
- **Every piece adds something to run.** Each micro frontend brings its own pipeline, environment and hosting to build, monitor and keep up to date.
- **Separate builds can mean more bytes.** Pieces that bundle the same library make users download it more than once, and sharing it brings back version coupling.
- **One team rarely benefits.** In our view a single team should usually stay with one well-structured app, with module boundaries checked in CI.
**Quick check (not scored).** Three micro frontends each bundle their own copy of the same UI library. What happens to the page?
- A. Nothing. The browser only downloads the library once.
- B. The user downloads the library up to three times.
Answer: B. The user downloads the library up to three times.
- A: Copies bundled into different files are different downloads. The browser can't tell they hold the same library.
- B: Jackson calls this payload size. Sharing the library avoids it, but sharing brings back coordination between teams.
Covers: More bytes, more requests
**Quick check (not scored).** One team of six owns a frontend and wants clear boundaries between its features. What is the cheaper first step, in our view?
- A. Split into three micro frontends with their own pipelines.
- B. Keep one app, and enforce module boundaries with tooling.
Answer: B. Keep one app, and enforce module boundaries with tooling.
- A: That adds pipelines, environments and runtime composition, and the team still coordinates with itself. The cost buys little here.
- B: Boundary rules checked in CI give clear ownership inside one app, with one build and one deploy.
Covers: Try the cheaper options first
## Sources
- [Micro Frontends](https://martinfowler.com/articles/micro-frontends.html), Cam Jackson · martinfowler.com
- [Enforce Module Boundaries](https://nx.dev/docs/features/enforce-module-boundaries), Nx documentation
- [boundaries](https://turborepo.dev/docs/reference/boundaries), Turborepo documentation
- [Modularization of a Monolith](https://microfrontend.dev/architecture/monolith-modularization/), Natalia Venditto · microfrontend.dev
- [Pros and cons of micro-frontends](https://microfrontend.dev/architecture/micro-frontends-pros-and-cons/), Natalia Venditto · microfrontend.dev
https://microfrontends.dev/learn/when-not-to-use
---
# Ways to put a frontend together
From one app with clear modules to fully isolated iframes. Each card rates complexity, team independence and runtime performance from 1 to 5. Open one for how it works, the trade-offs and the reasoning behind every rating.
[Compare side by side](https://microfrontends.dev/compare) [Not sure? Take the check](https://microfrontends.dev/decide)
## All approaches
- Build-time
### [Build-time packages](https://microfrontends.dev/approaches/build-time-packages)
Versioned npm packages, built into one bundle.
complexity 1
independence 2
performance 5
- Runtime
### [Module Federation](https://microfrontends.dev/approaches/module-federation)
Separate bundles, loaded at runtime with shared deps.
complexity 4
independence 4
performance 3
- Runtime
### [Native Federation / import maps](https://microfrontends.dev/approaches/native-federation-import-maps)
Plain ES modules wired up by an import map.
complexity 3
independence 4
performance 3
- Runtime
### [single-spa](https://microfrontends.dev/approaches/single-spa)
A root router that mounts apps in any framework.
complexity 4
independence 4
performance 2
- Runtime
### [Web Components](https://microfrontends.dev/approaches/web-components)
Custom elements as the contract between teams.
complexity 3
independence 3
performance 3
- Runtime
### [iframes](https://microfrontends.dev/approaches/iframes)
Each app in its own frame. Total isolation, full cost.
complexity 2
independence 5
performance 1
- Server
### [Server and edge composition](https://microfrontends.dev/approaches/server-and-edge-composition)
HTML fragments stitched on the server or edge.
complexity 4
independence 4
performance 4
- Alternative
### [Modular monolith and monorepo](https://microfrontends.dev/approaches/alternatives)
One app, one deploy, team-owned modules.
complexity 2
independence 2
performance 5
Ratings 1–5 are editorial judgement for a typical team. Complexity: higher means harder to build and run. Independence and performance: higher is better.
Source: https://microfrontends.dev/approaches
---
# Build-time packages
Each team publishes its feature as a versioned npm package. The shell installs those packages, builds once, and ships a single bundle.
## How it works
1. **Teams publish packages.** Team A and Team B each release a versioned package to a registry.
2. **The shell installs them.** The shell raises the package versions in its package.json and installs them.
3. **One build, one bundle.** A single build compiles every team's code and the shared dependencies into one bundle. Shared libraries are included once, as long as every package accepts the same version.
4. **One release.** The bundle ships. Any team's change goes through steps 2 to 4 again.
## Pros
- Simplest model and tooling: packages and one ordinary build.
- One build, so shared dependencies are deduplicated when the packages agree on versions.
- Teams import each other's code with normal, type-checked imports.
## Cons
- Every change needs the shell to rebuild and release.
- Releases happen in lockstep: teams wait on one release train.
- Package versions can drift between teams.
## Best when
- A few teams that are fine with a shared release.
- Performance-critical pages where one optimized bundle matters.
- Sharing a component library or design system.
## Avoid when
- Teams must deploy on their own schedule.
- Several frameworks need to live in one product.
- One team needs to ship fixes many times a day.
## In code
`shell/package.json · shell/src/App.jsx`
```jsx
// shell/package.json (excerpt)
{
"dependencies": {
"@shop/team-a": "^1.4.0",
"@shop/team-b": "^2.0.0"
}
}
// shell/src/App.jsx
import { Search } from "@shop/team-a";
import { Cart } from "@shop/team-b";
```
## Ratings
_Editorial judgement for a typical team, from 1 to 5._
- **Team independence: 2/5** (higher is better). Teams publish packages on their own, but nothing reaches users until the shell rebuilds and releases.
- **Runtime performance: 5/5** (higher is better). One build produces one bundle, with shared dependencies deduplicated when the packages accept the same versions.
- **Complexity: 1/5** (lower is simpler). Only packages and a normal build; there is no runtime loader to run.
- **SSR / SEO support: 5/5** (higher is better). The result is one ordinary app, so any server rendering setup works as usual.
- **Tech-agnostic: 1/5** (higher is better). Packages are compiled into the shell, so they share its framework and version.
- **Isolation: 1/5** (higher is better). All code runs in one bundle and one page, so styles, globals and errors are shared.
- **UX consistency: 5/5** (higher is better). One app with one design system makes a consistent experience the default.
- **Tooling maturity: 5/5** (higher is better). Uses the standard package registry and build tooling every frontend team already has.
## Tooling and ecosystem
There is no special tooling: any package registry (npm, a private registry or a monorepo's workspace packages) and any bundler work. Cam Jackson's article describes this approach and recommends against it for micro frontends, because releases happen in lockstep: a change to one part means recompiling and releasing all of them. It is still a reasonable choice when independent deployment is not what you need.
## Sources
- [Micro Frontends](https://martinfowler.com/articles/micro-frontends.html), Cam Jackson · martinfowler.com
https://microfrontends.dev/approaches/build-time-packages
---
# Module Federation
Each team builds and deploys its own bundle. The shell loads those bundles at runtime and can share common dependencies, such as React, as a single copy.
## How it works
1. **Shell loads.** The browser loads the shell, which knows where each remote's entry file lives.
2. **Fetch the remote entry.** When a slot is needed, the shell requests team A's remote entry and the chunks it points to.
3. **Share dependencies.** Shared modules come from a common share scope. With a singleton, everyone uses one copy and a version mismatch prints a warning.
4. **Mount.** Team A's module renders into its slot. Team B loads the same way, from its own deployment.
## Try it
**Demo: Shared dependency conflict.**
Team A and Team B both use React, and both start on 18.3, so the browser downloads one shared copy and both apps render. Move Team B to React 19.0 and the two versions no longer share a major version. With no singleton, each app brings its own copy: everything works, but users download a second React, about 45 KB more, and a component from one copy can't render inside the other copy's tree or read its context. Force a singleton instead and only the higher version, 19.0, is loaded, so Team A, built for 18.3, runs on a React it wasn't built for and may break. In Module Federation a singleton version mismatch only prints a warning, and with strictVersion it is a runtime error. Native Federation uses the shared copy silently, and with strictVersion gives that team its own copy instead, so the forced singleton no longer holds. The sizes are illustrative.
Takeaway: Dependency sharing is a real cost. Either teams coordinate versions, or users download duplicates, or a forced singleton breaks someone at runtime. Pick one on purpose.
## Pros
- Teams deploy their remotes independently; the shell picks up new versions at runtime.
- Shared dependencies can be loaded once instead of once per team.
- Remote modules load on demand, when a slot needs them.
## Cons
- Version mismatches in shared dependencies show up at runtime, not at build time.
- More moving parts: remote URLs per environment and fallbacks for remotes that fail to load.
- Extra network requests when a remote first loads.
## Best when
- Several teams on the same framework.
- Teams regularly blocked by a shared release.
- CI/CD and monitoring mature enough to own runtime failures.
## Avoid when
- One or two teams.
- Strict performance budgets without a plan for preloading.
- Domain boundaries that are still unclear.
## In code
`webpack.config.js · shell/src/bootstrap.js`
```js
// webpack.config.js, in plugins: the shell declares where team A's build lives
new ModuleFederationPlugin({
name: "shell",
remotes: {
teamA: "teamA@https://team-a.example.com/remoteEntry.js",
},
shared: { react: { singleton: true } },
});
// shell/src/bootstrap.js, at runtime: load team A's exposed module and mount it
async function mountTeamA() {
const { mount } = await import("teamA/App");
mount(document.querySelector("#team-a"));
}
```
## Ratings
_Editorial judgement for a typical team, from 1 to 5._
- **Team independence: 4/5** (higher is better). Each remote is a separate build that deploys on its own; the shell loads whatever is deployed at runtime.
- **Runtime performance: 3/5** (higher is better). Each remote adds requests when it loads, while shared singletons avoid downloading the same library twice.
- **Complexity: 4/5** (lower is simpler). You negotiate shared versions, manage remote URLs per environment, and handle remotes that fail to load.
- **SSR / SEO support: 3/5** (higher is better). Server rendering is possible but needs extra setup beyond the client-side loading the docs describe.
- **Tech-agnostic: 2/5** (higher is better). Mixing frameworks is technically possible, but sharing works best when every build uses the same framework.
- **Isolation: 2/5** (higher is better). Remotes run in the same page and share globals, styles and the share scope.
- **UX consistency: 4/5** (higher is better). Remotes render into one page and can share a design system as a shared dependency.
- **Tooling maturity: 4/5** (higher is better). Built into webpack and supported by Rspack and a Vite plugin, with a dedicated project that adds a runtime, manifest and devtools.
## Tooling and ecosystem
Module Federation is built into webpack 5 as `ModuleFederationPlugin`. The [Module Federation project](https://module-federation.io/guide/start/index.html) maintains Module Federation 2.0, which adds a federation runtime, a manifest (`mf-manifest.json`), dynamic type hints, a runtime plugin system and Chrome DevTools support; its introduction lists Rspack and webpack as supported build tools. The project also documents a [Vite integration](https://module-federation.io/integrations/build-tool/vite.html), `@module-federation/vite` (1.23 as of November 2026). Its Next.js plugin, `@module-federation/nextjs-mf`, has been in maintenance mode since November 2024: the core team does no new development on it and expects to stop tracking it in the second half of 2026 ([module-federation/core#3153](https://github.com/module-federation/core/issues/3153)).
In webpack's shared configuration, `singleton: true` keeps one copy of a library such as React and prints a warning when the chosen version doesn't satisfy a consumer's `requiredVersion`; adding `strictVersion: true` turns that warning into a runtime error.
## Sources
- [Module Federation](https://webpack.js.org/concepts/module-federation/), webpack documentation
- [ModuleFederationPlugin](https://webpack.js.org/plugins/module-federation-plugin/), webpack documentation
- [Module Federation — Introduction](https://module-federation.io/guide/start/index.html), module-federation.io
- [Vite — Module Federation integrations](https://module-federation.io/integrations/build-tool/vite.html), module-federation.io
- [Next.js Support is in maintenance mode (issue](https://github.com/module-federation/core/issues/3153), Zack Jackson · GitHub, module-federation/core
https://microfrontends.dev/approaches/module-federation
---
# Native Federation / import maps
Each team builds its app into plain ES modules. An import map tells the browser where every remote and shared library lives, so the shell loads them at runtime without a bundler-specific loader.
## How it works
1. **Read the manifest.** The shell starts by reading a manifest that maps each remote's name to the URL of its remoteEntry.json.
2. **Build the import map.** From every remote entry, the runtime collects exposed modules and shared libraries and hands the browser one import map.
3. **Import a remote.** When a route needs team A's component, the browser imports it as an ES module from team A's server.
4. **Shared copies resolve once.** Imports of a shared library resolve through the import map to one copy. Team B loads the same way, from its own deployment.
## Try it
**Demo: Shared dependency conflict.**
Team A and Team B both use React, and both start on 18.3, so the browser downloads one shared copy and both apps render. Move Team B to React 19.0 and the two versions no longer share a major version. With no singleton, each app brings its own copy: everything works, but users download a second React, about 45 KB more, and a component from one copy can't render inside the other copy's tree or read its context. Force a singleton instead and only the higher version, 19.0, is loaded, so Team A, built for 18.3, runs on a React it wasn't built for and may break. In Module Federation a singleton version mismatch only prints a warning, and with strictVersion it is a runtime error. Native Federation uses the shared copy silently, and with strictVersion gives that team its own copy instead, so the forced singleton no longer holds. The sizes are illustrative.
Takeaway: Dependency sharing is a real cost. Either teams coordinate versions, or users download duplicates, or a forced singleton breaks someone at runtime. Pick one on purpose.
## Pros
- Teams deploy remotes independently; the manifest points the shell at whatever is deployed.
- Built on ES modules and import maps, so the browser does the module wiring rather than a bundler runtime.
- Same mental model and a similar API to Module Federation, with a migration path from it.
## Cons
- Most of the tooling and examples target Angular; other stacks need the core library or the esbuild adapter.
- Shared library versions still have to be negotiated between teams.
- Remotes share one page, so styles and globals can collide.
## Best when
- Angular teams on the esbuild-based CLI who want runtime composition.
- You want federation without tying every team to webpack.
- Several teams need independent deploys with shared libraries loaded once.
## Avoid when
- One or two teams who could share code as packages.
- Teams on many different frameworks, where sharing libraries brings little.
- You need strong isolation between untrusted parts.
## In code
`main.ts · app.routes.ts (shell)`
```ts
// main.ts: read the manifest, then start the app with the result
initFederation("federation.manifest.json")
.then((nf) => import("./bootstrap").then((m) => m.bootstrap(nf)))
.catch((err) => console.error(err));
// app.routes.ts: load team A's exposed component on demand
export const routes = ({ loadRemoteModule }: NativeFederationResult): Routes => [{
path: "flights",
loadComponent: () =>
loadRemoteModule("mfe1", "./Component").then((m) => m.AppComponent),
}];
// federation.manifest.json
// { "mfe1": "https://team-a.example.com/remoteEntry.json" }
```
## Ratings
_Editorial judgement for a typical team, from 1 to 5._
- **Team independence: 4/5** (higher is better). Each remote builds and deploys on its own, and the shell finds it through the manifest at runtime.
- **Runtime performance: 3/5** (higher is better). Each remote adds module requests when it loads, while shared libraries resolve to one copy through the import map.
- **Complexity: 3/5** (lower is simpler). Schematics set up hosts and remotes, but shared versions, manifests per environment and failing remotes are still yours to handle.
- **SSR / SEO support: 3/5** (higher is better). The Angular adapter supports server rendering and hydration, with setup beyond a client-only host.
- **Tech-agnostic: 2/5** (higher is better). The core is framework-agnostic, but sharing works best when every remote uses the same framework, and most tooling is Angular's.
- **Isolation: 2/5** (higher is better). Remotes run as modules in the same page and share globals and styles.
- **UX consistency: 4/5** (higher is better). Remotes render into one page and can share a design system as a shared library.
- **Tooling maturity: 3/5** (higher is better). Maintained documentation, schematics and adapters, with a smaller ecosystem than Module Federation outside Angular.
## Tooling and ecosystem
Native Federation is maintained at [native-federation.com](https://native-federation.com/docs/v4/core/) and is in its v4 line as of November 2026. The framework-agnostic core is `@softarc/native-federation` (4.9). It bundles shared libraries and exposed modules into standalone ES modules, writes a `remoteEntry.json` per remote and an import map for the browser, and provides an esbuild adapter and a contract for writing your own. The Angular adapter, `@angular-architects/native-federation` (22.2), follows Angular's version numbers and builds on the Angular CLI's esbuild-based builder. For Angular 20 and 21, the same adapter is published under another name, `@angular-architects/native-federation-v4`.
The adapter's docs describe it as Module Federation's mental model on browser standards, with a similar API to `@angular-architects/module-federation`. They warn against mixing imports from the two in one app. In v4, `initFederation` (imported from `@angular-architects/native-federation`) resolves to a result whose `loadRemoteModule` the app passes to its routes and services. The older top-level `loadRemoteModule` import is deprecated. Import maps are a standard browser feature ([MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap)). By default the adapter uses es-module-shims in shim mode, which also lets you add remotes after the page has started.
Version mismatches on a `singleton: true` dependency work differently from Module Federation. Native Federation's [version resolver](https://native-federation.com/docs/v4/orchestrator/version-resolver/) lets a remote whose range rejects the shared version silently use the shared copy, which may break at runtime. With `strictVersion: true`, that remote gets its own copy instead. Loading fails only when `strictExternalCompatibility` is turned on.
## Sources
- [Angular adapter — Native Federation Docs](https://native-federation.com/docs/v4/angular-adapter/), native-federation.com
- [Core — Native Federation Docs](https://native-federation.com/docs/v4/core/), native-federation.com
- [Runtime — Native Federation Docs](https://native-federation.com/docs/v4/angular-adapter/runtime/), native-federation.com
- [Native Federation & Module Federation — Native Federation Docs](https://native-federation.com/docs/v4/native-and-module-federation/), native-federation.com
- [Version Resolver — Native Federation Docs](https://native-federation.com/docs/v4/orchestrator/version-resolver/), native-federation.com
- [
```
## Ratings
_Editorial judgement for a typical team, from 1 to 5._
- **Team independence: 5/5** (higher is better). Every frame is a separate app, served and deployed by its own team.
- **Runtime performance: 1/5** (higher is better). Each frame loads its own document and resources and needs extra memory.
- **Complexity: 2/5** (lower is simpler). Embedding is easy; sizing, routing and messaging between frames are the hard parts.
- **SSR / SEO support: 2/5** (higher is better). A frame's page can be server-rendered, but search engines index it separately from the page that embeds it, so the embedding page doesn't get credit for that content.
- **Tech-agnostic: 5/5** (higher is better). Anything that can render a web page can be framed.
- **Isolation: 5/5** (higher is better). Each frame has its own document, so styles and globals don't interfere, and sandbox can restrict it further. A same-site frame can still share the page's main thread, so a frame that hangs can freeze the page.
- **UX consistency: 1/5** (higher is better). Integrating parts across frames is difficult, and responsive layout and deep links get harder.
- **Tooling maturity: 5/5** (higher is better). Built into every browser, with no framework or build tool needed.
## Tooling and ecosystem
iframes are old, but that is also why they are well proven. Natalia Venditto still counts them as a valid choice when encapsulation is the priority, because a frame comes with a full sandbox out of the box, and notes they can be combined with other techniques such as web components.
There is nothing to install: `