Consuming Shared Dependencies
Master how to share common libraries and dependencies efficiently between federated applications.
Why Share Dependencies?
In Micro Frontends, different parts of your application might use the same libraries, like React, Vue, or Lodash. Without careful management, each Micro Frontend could bundle its own copy of these libraries.
This means users would download the same code multiple times, increasing load times and wasting bandwidth. Sharing dependencies solves this problem!
The Problem: Duplicate Bundles
Imagine your main 'Host' application uses React, and a 'Remote' Micro Frontend also uses React. If both bundle React independently, your user's browser ends up downloading React twice.
- Host Bundle: Includes React
- Remote Bundle: Includes React (again!)
This leads to larger overall application sizes and slower performance.
All lessons in this course
- Consuming Shared Dependencies
- Singleton Modules & Versioning
- Dynamic Module Loading
- Sharing State and Utilities Across Remotes