RFC: Native async startup handshake to remove mandatory bootstrap.js in Module Federation #20882
aryanraj45
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Hii @alexander-akait I have open a discussion for the MF async boundary (#18812) with a proposed startup logic.Please have a view when u have a moment looking for your feedback.Thanks! |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
The requirement for a manual async boundary (dynamic
import("./bootstrap")) remains a significant DX hurdle for Module Federation users. As discussed in #18812, this is essentially a runtime coordination problem where the entry point executes before shared modules or remotes are fully initialized.I’m proposing to bake the "waiting" logic directly into the entry point's startup code generated by
JavascriptModulesPlugin. Instead of reinventing the wheel, we can expose the existing__webpack_require__.f(ensureChunkHandlers) handshake to the initial startup phase.Proposed runtime logic for entries:
Implementation Details:
Hooks: Leverage JavascriptModulesPlugin to check for experiments.federation and adjust the renderStartup output.
DNA Alignment: This approach reuses the same orchestration logic used by dynamic import() and WASM loading, maintaining consistency with Webpack's existing runtime patterns.
Bailouts: Remote entry chunks must remain synchronous to avoid breaking current handshake protocols between containers.
I've been analyzing lib/javascript/JavascriptModulesPlugin.js and lib/web/JsonpChunkLoadingRuntimeModule.js to verify the feasibility. Ready to start a prototype if this direction aligns with the team's vision.
cc @alexander-akait @ScriptedAlchemy
Beta Was this translation helpful? Give feedback.
All reactions