One app, many packages
Micro-frontends solve org problems. The person using the product still sees one app, so build one app out of many packages.
The problem
Micro-frontends usually show up for good reasons. Teams want to ship without waiting on each other, one slow test suite shouldn’t block everyone, and a rewrite shouldn’t need a company-wide freeze. Splitting the frontend into separately deployed apps fixes all of that.
Then the costs arrive, and they land on the person using the product:
- The seams show. Each app ships its own copy of the design system, a version or two apart. Buttons, dates and empty states drift.
- Shared state gets hard. The signed-in user, preferences, a selected record, a draft. Anything that crosses apps needs a message bus or a global object somebody owns by accident.
- Cross-cutting features stall. A command palette, an inspector you can open from anywhere, or an assistant that works on every page. Each one has to be built once per app, or bolted onto a shell that knows nothing about the pages inside it.
- Deploys go back to being coupled. A shared contract changes and five apps have to ship in the right order.
The org problem got solved by moving it into the product.
What I concluded
Keep the boundaries, but make them build-time boundaries, not runtime ones. One app, one deploy, one router, one store. Inside it, packages with owners and strict import rules.
micro-frontends one app, many packages
───────────────── ──────────────────────
shell ─ app A (deploy) app
─ app B (deploy) ├─ features/orders (team A)
─ app C (deploy) ├─ features/billing (team B)
boundary: runtime └─ core/ design system,
shared state: a bus data, format, session
design system: N copies boundary: import rules
shared state: one store
design system: one copy
Each thing micro-frontends promised still has an answer:
| They wanted | One app answers with |
|---|---|
| Team ownership | Package owners and code review rules |
| No stepping on each other | One-way import layers, enforced in CI |
| Ship independently | Fast CI and per-PR canary deploys |
| Pick your own tools | Mostly given up, and that’s the point |
When micro-frontends are still right
There are a few cases where I’d still pick micro-frontends: genuinely separate products that happen to share a login, an acquisition that’s still being integrated, or a part of the product with a hard rule about release cadence. If people move between the pieces all day, it’s one product, and it should be one app.
Rules
- Decide by the user’s experience, not the org chart. If a person treats it as one product, it’s one app.
- Boundaries are imports. A feature can’t reach into another feature. Shared things move down into core.
- One copy of core. Design system, data layer, formatting and session exist once, so every page agrees.
- Make the single deploy cheap. The case for splitting deploys mostly disappears once CI is fast and every PR gets a preview.
What you get
Teams keep their ownership and the product stops showing its seams. Global things like the inspector, the palette, URL state and the assistant get built once and work everywhere. That matters even more with an assistant: an agent that drives the real UI needs one app it can see all of.
Related: Layers, Data access, URL state.