Table of contents
Front matter- Preface
- Chapter 1: Why Microfrontends
- What a microfrontend is
- What you gain
- What it costs
- When not to use it
- Meet Storefront
- Chapter 2: Nx Workspace Fundamentals
- Projects, targets, and the workspace root
- The project graph
- Caching: why Nx can skip work
- Affected: running only what changed
- Chapter 3: Static and Dynamic Federation: The Mental Model
- The parts of a federated application
- What happens when a host loads a remote
- Static federation: the directory printed with the building
- Dynamic federation: asking a live directory
- What really changes
- Which one to start with
- Chapter 4: Creating the Workspace
- Choosing a starting point
- Create the workspace
- Remove the demonstration projects
- Generate the shell and the catalog
- Keep the workspace honest
- Chapter 5: Adding Native Federation
- Installing Native Federation
- Turning catalog into a remote
- Turning shell into a host
- Exposing routes and loading them
- What the generator did to the targets
- Run it
- Upgrading Angular and Native Federation together
- Chapter 6: Anatomy of the Generated Setup
- The build, phase by phase
- What is in the output folder
- The remote entry
- The import map and the module loader
- Caching during development
- A checklist for a remote that misbehaves
- Chapter 7: Exposing and Loading Routes
- Three names, three ways to break
- Expose routes, not components
- Checking the boundary at runtime
- Conventions the rest of the book depends on
- Choosing what not to expose
- Chapter 8: Shared Dependencies and Version Skew
- What a shared declaration says
- How the loader decides
- Reproducing skew
- Which combinations fail
- Defense one: declare a range
- Defense two: strict mode
- Defense three: check before you deploy
- Workspace libraries are shared too
- Chapter 9: Local Development
- The servers
- Starting everything
- Two loops
- localhost, but not 127.0.0.1
- Cross-origin requests in development
- Working on a subset
- Stale artifacts
- A development checklist
- Chapter 10: The Platform API: A Shared Contract
- A third place for the agreement
- Creating the library
- The contract
- The host implements it
- A remote consumes it
- It works across the boundary
- Standalone is a feature
- Testing both sides
- What belongs in a platform API
- Chapter 11: Module Boundaries and Ownership
- Three ingredients
- Tagging the projects
- The rules
- Reading the violations
- Selector prefixes and visible ownership
- Ownership beyond lint
- What lint cannot see
- Growing the rules
- Chapter 12: A Typed Event Bus
- Events between applications that do not know each other
- The first version, and the failure
- The fix: a log, and a replay on request
- The trap: replay must be one ordered pass
- What the pattern costs
- When to use events
- Chapter 13: Backend-Mediated State
- The design shift
- A small API that runs TypeScript directly
- One client for every remote
- The events change their job
- Checkout and the order
- The new failure: the backend is gone
- What this pattern costs
- Chapter 14: Choosing a Communication Pattern
- Three contracts, three kinds of coupling
- What each pattern does, measured
- Three questions, in order
- Applying the questions to Storefront
- Misuses that make a federated application brittle
- Using the three together
- Chapter 15: Why Static Federation Hits a Wall
- What "static" ties together
- Wall one: every new remote is a shell release
- Wall two: the URLs are inside the build
- Wall three: a remote that is down
- Wall four: what the design cannot say
- What the design needs instead
- Chapter 16: The Manifest
- The manifest
- The shell, rewritten around the data
- Adding and removing a remote is a data change
- Turning a failing remote off
- A cost that Chapter 3 flagged: asking twice
- The new failure: the manifest is gone
- What changed
- Chapter 17: Backend-Driven Manifests
- Who decides which remotes a user gets
- The shell asks, with a deadline and a way out
- What the tests and the probe check
- What the fallback costs
- When the fallback is not enough, and what a manifest is not
- What changed
- Chapter 18: Error Isolation and Resilience
- Three ways to fail
- The failure, as it was
- Making the failure a page
- Verifying it, and the probe that failed
- Recovery, and the failure the fix does not cover
- What a remote that is down still costs
- Chapter 19: Performance
- What a page costs
- Why a remote costs 2 kB
- Starting early: prefetch on hover
- What a bundle budget does not see
- Chapter 20: Independent Deployment
- What it means to deploy a remote
- The probe
- What a deployment changes
- Caching rules for a federated deployment
- The tab that was already open
- Rolling back
- What independent deployment does not guarantee
- Chapter 21: Affected-Based CI
- Caching a federation build
- What an edit affects
- The pipeline
- What it saves
- What an affected pipeline trusts
- The first runs on GitHub
- Chapter 22: Authentication and Sessions
- Two ways to carry an identity
- The API signs users in
- Credentialed CORS
- The client asks for credentials, and tells failures apart
- Three patterns on one feature
- What the user sees
- What the probe checks
- What this does not secure
- Chapter 23: Observability
- An identifier on every request
- A request log, and following one request
- Telemetry: errors that nobody would see
- Who reports
- A crash the report cannot attribute
- What the probe checks
- What is too open
- Chapter 24: Testing Across the Boundary
- A project for the whole
- Telling Nx what the tests depend on
- The nine tests
- What a green run does not prove
- Breaking the application on purpose
- What this suite does not cover
- Chapter 25: Cross-Repository Microfrontends
- What a second repository changes
- The remote
- The contract, when nothing can be imported
- The platform's side
- Verifying the combination
- An agreement made of strings
- What it costs
- Chapter 26: Strangler Migration
- The situation
- Two implementations, one route
- Cutting over
- Rolling back
- What the migration changed for everyone
- What a strangler migration does not move
- Chapter 27: Capstone: Storefront End to End
- The finished application
- One action, end to end
- Running everything
- The book on one page
- Closing the gaps
- What is still not finished
- Starting your own
- Appendix A: Troubleshooting
- Installing and creating the workspace
- A blank page, or a page that does not change
- Versions and sharing
- Servers, ports, and browsers
- Talking to the API
- Tests and probes
- Lint and configuration
- Continuous integration
- Glossary
- Index
