Enterprise Angular: Micro Frontends and Moduliths with Angular
Minimum price
Suggested price

Enterprise Angular: Micro Frontends and Moduliths with Angular

Module Federation - Nx - DDD

About the Book

Important: Book moved!

This book moved to our website at ANGULARarchitects.io. Please also register here to get notified about news versions:

Download book or register to get notified after updates!


In the last years, I've helped numerous companies with implementing Angular based large scale enterprise applications. To handle the complexity of such applications, it's vital to decompose the whole system into smaller libraries. 

However, if you end up with lots of libraries which are too much intermingled with each other, you don't win much. If everything depends on everything else, you cannot easily change or extend your system without introducing breaking changes.

Domain-driven Design, esp. it's discipline strategic design helps with this and it also can be the foundation for building micro frontends.

In this book, which bases upon several blog articles I've written about Angular, DDD, and Micro Frontends, I show how to use these ideas. 

Workshops and Consultancy

If you are interested into on-site workshops or consultancy for your Angular projects, feel free to reach out to us. You find further information here.

  • Share this book

  • Categories

    • Computers and Programming
    • AngularJS
    • JavaScript
    • Software Architecture
  • Feedback

    Email the Author(s)

About the Author

Manfred Steyer
Manfred Steyer

Trainer, consultant and programming architect with focus on Angular. Google Developer Expert (GDE) and Trusted Collaborator in the Angular team who writes for O'Reilly, the German Java Magazine, and windows.developer. Regularly speaks at conferences.

Provides Angular workshops and consultancy.

Table of Contents

  • Introduction
    • Structure of This Book
    • Trainings and Consultancy
    • Help to Improve this Book!
    • Thanks
  • Strategic Domain-Driven Design
    • What is Domain-Driven Design?
    • Finding Domains with Strategic Design
    • Domains are Modelled Separately
    • Context-Mapping
    • Sub Domains vs. Bounded Contexts
    • Team Topologies and Strategic Design
    • Conclusion
  • Architectures with Sheriff and Standalone Components
    • The Architecture Matrix
    • Project Structure for the Architecture Matrix
    • Enforcing your Architecture with Sheriff
    • Lightweight Path Mappings
    • Conclusion
  • Build Performance with Nx
    • Incremental Builds – Getting Started
    • More comfortable and more powerful: Nx
    • Incremental Builds with Nx
    • Side Note: Micro Frontends
    • Distributed Cache with Nx Cloud
    • Even Faster: Parallelization with Nx Cloud
    • Conclusion
  • Nx & Sheriff - Friends for Life
    • Module Boundaries in Nx
    • Recap: Different Types of Boundaries
    • Options with Sheriff
    • Conclusion
  • From Domains to Micro Frontends
    • Deployment Monoliths
    • Micro Frontends
    • UI Composition with Hyperlinks
    • UI Composition with a Shell
    • The Hero: Module Federation
    • Finding a Solution
    • Consequences of Micro Frontends
    • Conclusion
  • The Micro Frontend Revolution: Using Module Federation with Angular
    • Example
    • Activating Module Federation for Angular Projects
    • The Shell (aka Host)
    • The Micro Frontend (aka Remote)
    • Trying it out
    • A Further Detail
    • More Details: Sharing Dependencies
    • More on This
    • Conclusion and Evaluation
  • Dynamic Module Federation
    • A Simple Dynamic Solution
    • Going “Dynamic Dynamic”
    • Some More Details
    • Conclusion
  • Plugin Systems with Module Federation: Building An Extensible Workflow Designer
    • Building the Plugins
    • Loading the Plugins into the Workflow Designer
    • Providing Metadata on the Plugins
    • Dynamically Creating the Plugin Component
    • Wiring Up Everything
    • Conclusion
  • Using Module Federation with Nx Monorepos and Angular
    • Multiple Repos vs. Monorepos
    • Multiple Repositories: Micro Frontends by the Book
    • Micro Frontends with Monorepos
    • Monorepo Example
    • The Shared Lib
    • The Module Federation Configuration
    • Trying it out
    • Isolating Micro Frontends
    • Incremental Builds
    • Deploying
    • Conclusion
  • Dealing with Version Mismatches in Module Federation
    • Example Used Here
    • Semantic Versioning by Default
    • Fallback Modules for Incompatible Versions
    • Differences With Dynamic Module Federation
    • Singletons
    • Accepting a Version Range
    • Conclusion
  • Multi-Framework and -Version Micro Frontends with Module Federation
    • Pattern or Anti-Pattern?
    • Micro Frontends as Web Components?
    • Do we also need Module Federation?
    • Implementation in 4 steps
  • Pitfalls with Module Federation and Angular
    • “No required version specified” and Secondary Entry Points
    • Unobvious Version Mismatches: Issues with Peer Dependencies
    • Issues with Sharing Code and Data
    • NullInjectorError: Service expected in Parent Scope (Root Scope)
    • Several Root Scopes
    • Different Versions of Angular
    • Bonus: Multiple Bundles
    • Conclusion
  • Module Federation with Angular’s Standalone Components
    • Router Configs vs. Standalone Components
    • Initial Situation: Our Micro Frontend
    • Activating Module Federation
    • Static Shell
    • Alternative: Dynamic Shell
    • Bonus: Programmatic Loading
  • From Module Federation to esbuild and Native Federation
    • Native Federation with esbuild
    • Native Federation: Setting up a Micro Frontend
    • Native Federation: Setting up a Shell
    • Exposing a Router Config
    • Communication between Micro Frontends
    • Conclusion
  • The new NGRX Signal Store for Angular: 3 + n Flavors
    • Getting the Package
    • Flavor 1: Lightweight with signalState
    • Side Effects
    • Flavor 2: Powerful with signalStore
    • Custom Features - n Further Flavors
    • Flavor 3: Built-in Features like Entity Management
    • Conclusion
  • Smarter, Not Harder: Simplifying your Application With NGRX Signal Store and Custom Features
    • Goal
    • DataService Custom Feature
    • Implementing A Generic Custom Feature
    • Providing a Fitting Data Service
    • Undo/Redo-Feature
    • Using the Store in a Component
    • Conclusion and Outlook
  • NGRX Signal Store Deep Dive: Flexible and Type-Safe Custom Extensions
    • A Simple First Extension
    • Now it Really Starts: Typing
    • Typing and Dynamic Properties – How do They Work Together?
    • More Examples: CRUD and Undo/Redo
    • Out of the Box Extensions
    • Conclusion
  • The NGRX Signal Store and Your Architecture
    • Where to Put it?
    • Combining the Signal Store With the Traditional NGRX Store
    • The Best of Both Worlds via Custom Features
    • How Large Should a Signal Store be?
    • May a Signal Store Access Other Signal Stores?
    • Preventing Cycles, Redundancies, and Inconsistencies
    • Conclusion
  • Bonus: Automate your Architecture with Nx Workspace Plugins
    • Creating a Workspace Plugin With a Generator
    • Templates for Generators
    • Implementing a Generator
    • True Treasures: Helper Methods for Generators in Nx
    • Trying out Generators
    • Testing Generators
    • Exporting Plugins via NPM
    • Conclusion
  • Bonus: The Core of Domain-Driven Design
    • DDD in a Nutshell
    • How to Define DDD?
    • When Can we Call it DDD?
    • What’s the Core of DDD and Why did People get a Wrong Impression About that?
    • Is Tacticial Design Object-Oriented? Is There a Place for FP?
    • Further Adaptions of Tactical Design
    • Conclusion
  • Literature
  • About the Author
  • Trainings and Consulting

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.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

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

In fact, authors have earnedover $13 millionwriting, publishing and selling 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