Module federation support - #613
Open
dlebedynskyi wants to merge 12 commits into
Open
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a runnable Module Federation reproduction with one host and two independently compiled remotes on web and iOS.
The demo isolates two Uniwind collision modes:
Uniwind.__reinit(...), replacing the complete registry and removing owner-only styles from earlier graphs.No Uniwind source or collision fix is included. This PR only demonstrates the failures and documents the Metro/MF compatibility work required to load all three graphs.
Related discussion: #612
Demo structure
Three Metro servers run in parallel:
8081Green#16a34a8082Yellow#facc158083Blue#2563ebEach panel renders three signals:
Every signal prints both its declared color and the value currently resolved by Uniwind. Missing native classes are shown as not registered, so the reproduction does not depend on visually distinguishing colors.
Reproduced behavior
Web
Each graph's stylesheet remains installed, so owner-only classes keep their original colors.
Shared selectors and variables remain global:
iOS
Each CSS entry executes
Uniwind.__reinit(...), replacing the complete native registry, variables, and caches:Metro and Module Federation compatibility
The demo includes integration code required to load three independently compiled Metro graphs into one Expo 57 runtime:
withUniwindConfigand explicitly composes their resolvers.__runder its federation-prefixed name.mf:async-requirewith a graph-aware Expo-compatible demo loader.mf:remote-hmrto a no-op because it is imported only by generated remote entries and is not currently graph-safe.culori/requireBabel alias.These are compatibility bridges for the reproduction, not proposed production implementations.
Running the demo
Web:
Run the headed browser assertions in another terminal:
Capture
Web demo
MF-web-demo.mov
iOS demo
mf-native-demo.mov
Summary by CodeRabbit
New Features
Documentation
Bug Fixes