FSD Frontend System Design

Part VI β€” The Blueprint Β· Lesson 11.13

Microfrontend

In one lineSplit the frontend by team ownership, compose at runtime, and pay for it in shared-dependency discipline.

Where you've seen itA retail site where the search team ships twice a day and the checkout team ships twice a month, independently.

  • Time20 min
  • DiagramShell + remotes composition, and the version-skew problem
  • Chapter11 Β· High Level Design

Diagram

diagram
1–2 Β· WHEN THIS IS THE RIGHT ANSWER

  in scope   independent deploys Β· team autonomy Β· gradual migration
  out        "it sounds modern" β€” that is not a reason
  scale      the honest threshold: 4+ teams, or a legacy app being
             strangled route by route

  Under 3 teams, a well-structured monorepo beats microfrontends
  on every axis. Say this out loud β€” it's a senior signal.
diagram
3 Β· RUNTIME COMPOSITION β€” shell plus remotes

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Shell (host) ─────────────────────┐
  β”‚  routing Β· auth Β· design tokens Β· shared layout       β”‚
  β”‚                                                       β”‚
  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
  β”‚  β”‚  search    β”‚  β”‚   cart     β”‚  β”‚   checkout     β”‚  β”‚
  β”‚  β”‚  remote    β”‚  β”‚   remote   β”‚  β”‚   remote       β”‚  β”‚
  β”‚  β”‚  team A    β”‚  β”‚   team B   β”‚  β”‚   team C       β”‚  β”‚
  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
  β”‚   own repo        own repo        own repo            β”‚
  β”‚   own deploy      own deploy      own deploy          β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  Module Federation loads remotes at RUNTIME from their own URLs β€”
  the shell never rebuilds when a remote ships.
diagram
6a Β· DEEP DIVE β€” THE SHARED DEPENDENCY PROBLEM

  βœ— each remote bundles its own React
      3 remotes Γ— 45KB = 135KB, plus TWO React instances
      β†’ hooks break, context doesn't cross boundaries

  βœ“ shared singletons declared by the shell
      shared: { react: { singleton: true, requiredVersion: '^18' } }
      β†’ one instance, one copy, context works

  version skew is the recurring cost: team A wants React 19,
  teams B and C are on 18 β†’ a coordinated upgrade, i.e. exactly
  the coupling microfrontends were supposed to remove.
diagram
6b Β· DEEP DIVE β€” COMMUNICATION BETWEEN REMOTES

  βœ“ URL                      the best channel β€” shareable, debuggable
  βœ“ custom events / event bus  loose coupling, typed contract
  βœ“ shell-provided context     auth, locale, theme (one owner)
  βœ— shared global store        recreates the coupling you removed
  βœ— direct imports             remote A importing from remote B
                               destroys independent deployability

How it works

  1. Split by business domain and team, never by technical layer β€” "the checkout team", not "the components team".
  2. Shell owns routing, authentication, design tokens, and shared singletons.
  3. Remotes are independently built and deployed, loaded at runtime by URL.
  4. Contract-test the boundary so a remote's breaking change fails its own CI, not production.
  5. Budget performance centrally (4.5): three teams each adding "just 40KB" is how these sites get slow.

Trade-offs

GainCost
Independent deploysRuntime integration failures
Team autonomyDuplicate dependencies, version skew
Gradual legacy migrationMore infra: registry, versioning, CI per remote
Tech-stack freedom per teamInconsistent UX unless tokens are enforced

Interview angle

"Would you use microfrontends here?"

  • Only above roughly four teams, or to strangle a legacy app route by route β€” otherwise a monorepo with clear module boundaries gives the same isolation with none of the runtime risk.
  • If yes: shell owns routing, auth, and shared singletons; remotes deploy independently; communication goes through the URL and events, never a shared store.
  • The recurring cost is shared-dependency version skew, and I'd plan an upgrade cadence for it upfront.

Recap

  • Split by team and domain; compose at runtime through a shell.
  • Shared singletons are mandatory, and their versioning is the ongoing tax.
  • Recommending against microfrontends for a small team is the stronger answer.