[turbopack] Create the JavaScript runtime for Module Federation - #97261
Open
sampoder wants to merge 1 commit into
Open
[turbopack] Create the JavaScript runtime for Module Federation#97261sampoder wants to merge 1 commit into
sampoder wants to merge 1 commit into
Conversation
Contributor
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: e2b157d |
sampoder
marked this pull request as ready for review
August 12, 2026 18:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This PR introduces a new runtime that allows Turbopack to engage with module federation.
container.tscontains the equivalents of theget&initAPIs mentioned on https://webpack.js.org/concepts/module-federation/.The PR also introduces
loadRemoteModule():Using this method triggers this flow:
The PR also includes
provideShared()andconsumeShared()which are Webpack APIs that are being ported over:Codex's Webpack comparison
container.tscreateContainer(),container.init(), andcontainer.get()ContainerEntryModule.jsremote-loader.tsloadScript()and the remote-loading helpersremoteEntry.js, finds its container, and requests a moduleRemoteRuntimeModule.jsandLoadScriptRuntimeModule.jsremote-loader.tsRemote fallback handling
FallbackModule.jsshare-runtime.tsShare-scope creation, registration, merging, and initialization
ShareRuntimeModule.jsprovide-shared.tsprovideShared()ProvideSharedModule.jsconsume-shared.tsconsumeShared()andconsumeSharedAsync()ConsumeSharedRuntimeModule.jssemver.tsVersion parsing and matching
^19.0.0semver.jsremote-scope.tsRemote request scope tracking
RemoteRuntimeModule.jsandRuntimeGlobals.currentRemoteGetScoperuntime-state.tsShared runtime state and caches
RuntimeGlobals.js,RemoteRuntimeModule.js, andLoadScriptRuntimeModule.jsruntime.test.tsRuntime compatibility tests
containerandsharingtest suites