How to share @mf-types between Host and Remote when using only runtime dependency (v2.0) #4464
Unanswered
Kim-soung-won
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have been developing a Module Federation environment using Rsbuild and the associated build-time plugins for type sharing. My current setup successfully shares types between the Host and Remotes during the build process.
I am now transitioning my Host application to be runtime-based (using dynamic remote resolution). I have already upgraded to Module Federation 2.0, and the runtime logic for loading remotes works perfectly.
The Problem
While the application logic functions as expected at runtime, I am struggling with type synchronization. In a build-less or dynamic runtime host scenario, the Host doesn't necessarily have a static reference to the Remote at build time to pull
@mf-types.Questions
@mf-typesfrom a Remote using only runtime dependencies/configurations?initorregisterRemotesAPI, what is the recommended workflow to ensure the developer environment still has access to the Remote's types?@module-federation/enhancedor@module-federation/typescriptecosystem to "hot-fetch" types for a runtime-driven Host?Environment
I would appreciate any insights or recommended patterns for managing types when the relationship between Host and Remote is defined at runtime rather than build time.
Beta Was this translation helpful? Give feedback.
All reactions