AN OPINIONATED INTRODUCTION TO MICRO-FRONTENDS
Preface
- Goal
- About Me
- Audience
- Text Conventions
Prerequisites
Companion Code
Chapter 1 - Definitions and Architecture Overview
- Overview of Possible Architecture Solutions
- Summary
Chapter 2 - Sample Project Architecture
- The Container App (container-app)
- Microfrontend1 (Built with React)
- Microfrontend2 (Built with Svelte)
- Microfrontend3 (Built with Vue)
- Integration Strategy
- Conclusion
Chapter 3 - Microfrontend1 Project (React)
- Directory Structure
- Create Project Wizard
- Chapter 3 Recap
Chapter 4 - Microfrontend2 Project (Svelte)
- Create Project Wizard
- Chapter 4 Recap
Chapter 5 - Microfrontend3 Project (Vue)
- Create Project Wizard
- Chapter 5 Recap
Chapter 6 - Setting Up The Container App
- Create Project Wizard
- Chapter 6 Recap
Chapter 7 - Types and Utils
- MicroFrontend Interface
- MicroFrontendLoader Utility
- Container-app Configuration
- App.vue changes
- Chapter 7 Recap
Chapter 8 - Getting the Microfrontends Ready
- Microfrontend1 (React app)
- Microfrontend2 (Svelte app)
- Microfrontend3 (Vue app)
- Adding a global package.json
- Chapter 8 Recap
Chapter 9 - CSS Styles
- Root Styles Project
- Chapter 9 Recap
Chapter 10 - Structuring the Layout
- Structuring the Initial Container-App Layout
- Chapter 10 Recap
Chapter 11 - Postbox - intermodule communication
- Create Project Wizard
- Test it
- Chapter 11 Recap
Chapter 12 - Monorepo Orchestration with NX
- What NX brings to this project
- Installing NX
- Configuring NX —
nx.json - Adding
project.jsonto each package - Understanding the dependency graph
- Updating the root
package.json - Running the full development stack
- How caching works in practice
.gitignoreadditions- Chapter Recap
Chapter 13 - Error Handling & Resilience
- Common failure scenarios
- Updating
useLoadScript - Updating
MicroFrontendLoader - Error state in the container-app UI
- React error boundaries in Microfrontend1
- Publishing errors via postbox
- Chapter 13 Recap
Chapter 14 - Testing
- Setting up Vitest in postbox
- Unit testing postbox
- Unit testing MicroFrontendLoader
- Component testing the container-app
- Running all tests from the root with NX
- Chapter 14 Recap
- Chapter 14 Recap
Chapter 15 - Authentication & Shared State Across Micro-frontends
- Extending the MicroFrontend interface
- Passing context from the container
- Receiving context in each micro-frontend
- Broadcasting auth changes via postbox
- Feature flags and locale
- Chapter 15 Recap
- Chapter 15 Recap
Chapter 16 - Production Build & Deployment
- Environment-based configuration
- Enabling production optimisations
- Building for production with NX
- Serving the output
- CI with NX affected (GitHub Actions)
- Chapter 16 Recap
- Chapter 16 Recap