This repository is to showcase examples on Webpack 5's new Module Federation can be used.
If you need support, consider looking at my sponsor profile https://github.com/sponsors/ScriptedAlchemy
Youtube Screencasts https://www.youtube.com/playlist?list=PLWSiF9YHHK-DqsFHGYbeAMwbd9xcZbEWJ
WIP info site https://module-federation.github.io/
Official Docs https://webpack.js.org/concepts/module-federation
Shim for partial Webpack 4 and non webpack users https://gist.github.com/ScriptedAlchemy/d386a094832dbd9a04324862d26570e9
Original Webpack Issue https://github.com/webpack/webpack/issues/10352
Medium post Original Webpack Issue https://link.medium.com/xzFgBBtAx6
Legend:
โ ๏ธ : In Progress/Incomplete- ๐: Depends on proprietary code that isn't free.
- Basic Host-Remote โ App 1 consumes remote components from App2.
- Bi-Directional Hosts โ App1 consumes App2 components; App2 consumes App1 components.
- Self-Healing โ Fallback to remote apps vendors if a dependency fails to load.
-
โ ๏ธ Server-Side Rendering โ App1 and App2 with SSR. - Multi UI Framework Federation โ Multiple Apps in different technologies federated.
- Dynamic System Host โ Swap between remotes at runtime.
- Redux Reducer Injection โ Dynamically inject reducers to host store at runtime.
- Shared Routes โ Compose federated routes for a seamless user experience.
- Nested Components โ Nested remote components.link to Google!
- Share Context Provider โ App1 and App2 with shared Context Provider.
- ๐ Streaming Federated Code โ App1 and federated-middleware deploy to s3. App1 then stream's federated code directly from S3
- Non-UI Module
- Routing
- Version Discrepancy โ Federated apps depending on different versions of a dependency without side-effects.
- TypeScript โ Simple host/remote example using TypeScript.
- NextJS
To run from a git checkout locally, remove all of the proprietary example directories and then run yarn
at the repo root.
You can then run yarn start
from any of the non-proprietary examples.