Leanpub Header

Skip to main content

Angular Microfrontends with Nx and Native Federation

Building, Connecting, and Independently Deploying Angular Apps at Scale

Angular Microfrontends with Nx and Native Federation
This book is 100% completeLast updated on 2026-10-24

A hands-on guide to building Angular microfrontends with Nx and Native Federation, from an empty workspace to deployment, with every claim run against a real repository.

Minimum price

$11.00

$15.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

Buying multiple copies for your team? See below for a discount!

PDF
EPUB
About

About

About the Book

Several teams, one product, separate deployments. This book builds Storefront, an online store in which a shell loads separately built Angular remotes at runtime with Native Federation, and it takes the case study from an empty Nx workspace to a deployed, tested and observable system. Angular 22, Nx 23 and Native Federation 22 are the versions in use. Every listing, measurement and screenshot comes from running the code.

Older tutorials no longer match the tools: Nx's Module Federation generators for Angular are deprecated, and Native Federation is the supported path. The book is written against the tools as they are today, and it says where they fall short.

What you will learn
  • How static and dynamic (manifest-driven) federation work, and when a static remote map stops being enough
  • How shared dependencies resolve, how version skew produces a blank page, and three defenses against it
  • A Platform API, a typed event bus with ordered replay, and module boundaries enforced by lint
  • State that survives a reload through a backend, and how to choose between the three ways to share it
  • Manifests served per tenant, with a bundled fallback when the server is down
  • Failure handling when a remote does not load or crashes while rendering
  • Independent deployment of one remote, what an open browser tab does when files change, and Nx affected builds in continuous integration
  • Sign-in with cookie sessions, rate limits, and error reports that name the remote at fault
  • A remote that lives in another repository, and a strangler migration of a legacy page

Share this book

Categories

Team Discounts

Team Discounts

Get a team discount on this book!

  • Up to 3 members

    Minimum price
    $27.00
    Suggested price
    $37.00
  • Up to 5 members

    Minimum price
    $44.00
    Suggested price
    $60.00
  • Up to 10 members

    Minimum price
    $77.00
    Suggested price
    $105
  • Up to 15 members

    Minimum price
    $110
    Suggested price
    $150
  • Up to 25 members

    Minimum price
    $165
    Suggested price
    $225

Bundle

Bundles that include this book

Author

About the Author

Sandeep Kumar Patel

Sandeep Kumar Patel is a senior web developer with more than 17 years of experience building web applications in object-oriented JavaScript and JSON. In 2012 he founded tutorialsavvy, a programming blog that developers have been reading ever since.

He is GATE-2005 Information Technology (IT) qualified and holds a Master's degree from VIT University, Vellore.

Contents

Table of Contents

Table of contents

Front matter
  • Preface
Part 1: Foundations
  • 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
Part 2: Static Federation
  • 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
Part 3: Contracts and Communication
  • 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
Part 4: Dynamic Federation
  • 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
Part 5: Running It for Real
  • 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
Part 6: At Scale
  • 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
Back matter
  • 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

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub