Enterprise Angular: Micro Frontends and Moduliths with Angular
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.
Table of Contents
-
Introduction
- 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
- Conclusion
-
Implementing Strategic Design with Nx Monorepos
- Implementation with Nx
- Categories for Libraries
- Public APIs for Libraries
- Check Accesses Between libraries
- Access Restrictions for a Solid Architecture
- Modular Monolith = Modulith
- Your Architecture by the Push of a Button: The DDD-Plugin
- Conclusion
-
From Domains to Microfrontends
- Deployment Monoliths
- Micro Frontends
- UI Composition with Hyperlinks
- UI Composition with a Shell
- The Hero: Module Federation
- Finding a Solution
- Conclusion
-
The Microfrontend Revolution: Using Module Federation with Angular
- Example
- Activating Module Federation for Angular Projects
- The Shell (aka Host)
- The Microfrontend (aka Remote)
- Trying it out
- A Further Detail
- More Details: Sharing Dependencies
- 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
-
Bonus Chapter: Automate Your Architectures with Nx Workspace Generators
- Schematics vs Generators
- Workspace Generators
- Templates
- Defining parameters
- Implementing the Generator
- Update Existing Source Code
- Running the Generator
- Additional Hints
- One Step Further: Workspace Plugins
- 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.
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 $12 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