Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
36c7e8f
feat(enhanced)!: compose the federation runtime bootstrap by default
ScriptedAlchemy Sep 25, 2026
bd074d9
test(enhanced): assert the composed plan for disableRemote and disabl…
ScriptedAlchemy Sep 25, 2026
d01ec17
feat(node)!: load remote entries only through the instance platform
ScriptedAlchemy Sep 25, 2026
fe83d46
feat(webpack-bundler-runtime,enhanced)!: remove federation.runtime
ScriptedAlchemy Sep 25, 2026
187dfdd
feat(runtime-core,runtime,webpack-bundler-runtime)!: stop reading the…
ScriptedAlchemy Sep 25, 2026
22c1db4
feat(enhanced,rspack)!: stop emitting the capability and build-id def…
ScriptedAlchemy Sep 25, 2026
60e40ab
feat(managers,enhanced)!: fail the build when the runtime family is t…
ScriptedAlchemy Sep 25, 2026
5cdbb5f
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
b7a13a4
feat(rspack)!: compose the federation runtime by default
ScriptedAlchemy Sep 25, 2026
ca1e839
feat(enhanced,rspack,sdk)!: remove experiments.composedRuntime
ScriptedAlchemy Sep 25, 2026
940685d
docs: replace the removed runtime defines with runtime/compose
ScriptedAlchemy Sep 25, 2026
cc8cf9a
refactor(managers,enhanced,rspack): let selectMode mark a requested f…
ScriptedAlchemy Sep 25, 2026
7b46e85
fix(runtime-core): keep an empty default instance id
ScriptedAlchemy Sep 25, 2026
7849bfc
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
8bdf981
fix(runtime-core): register the share scope under the id from options
ScriptedAlchemy Sep 25, 2026
f1fe068
test(enhanced): let the older-family build emit so the test can read …
ScriptedAlchemy Sep 25, 2026
52ce340
fix(rspack): plan the consumes adapter for async startup
ScriptedAlchemy Sep 25, 2026
00109f5
fix(rstest): keep the aliased bundler runtime bundled
ScriptedAlchemy Sep 25, 2026
dd2a305
chore: list managers and rstest in the major changeset
ScriptedAlchemy Sep 25, 2026
34ecd25
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
eb706c8
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
9c782c3
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
5ac49cb
feat(rspack)!: remove resolveRspackRuntimeAlias
ScriptedAlchemy Sep 25, 2026
2840f62
fix(runtime-core): register the share scope once the options are final
ScriptedAlchemy Sep 25, 2026
453999c
fix(enhanced): pass the build id to the full-runtime bootstrap
ScriptedAlchemy Sep 25, 2026
21e2f48
fix(rspack): pass the build id to the native runtime
ScriptedAlchemy Sep 25, 2026
3052ce6
fix(managers): say what an older runtime family lacks
ScriptedAlchemy Sep 25, 2026
295d730
test(rspack): cover the build error for an older runtime family
ScriptedAlchemy Sep 25, 2026
b0a6c25
test(enhanced): assert the consumes path stays out of builds without …
ScriptedAlchemy Sep 25, 2026
001e19c
chore: name the removed runtime export in the major changeset
ScriptedAlchemy Sep 25, 2026
4989a4a
docs: describe capabilities and the build id instead of the removed d…
ScriptedAlchemy Sep 25, 2026
0e7bc2b
feat(rspack)!: require @rspack/core 1.5 or newer
ScriptedAlchemy Sep 25, 2026
571ef30
chore: describe the full-runtime fallback in the major changeset
ScriptedAlchemy Sep 25, 2026
cf40a35
fix(rspack): pass the build id through a data: runtime plugin
ScriptedAlchemy Sep 25, 2026
6fff0f9
fix(rstest): keep data: runtime plugins bundled
ScriptedAlchemy Sep 25, 2026
a5cf4b0
feat(rspack)!: require @rspack/core 2.0.0-beta.1 or newer
ScriptedAlchemy Sep 25, 2026
8f40ea8
fix(webpack-bundler-runtime): keep federation.runtime.init on the ful…
ScriptedAlchemy Sep 25, 2026
9805677
fix(rspack): accept @rspack/core 1.5 again
ScriptedAlchemy Sep 25, 2026
76bd8b7
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
df9aa3a
chore: quote the older runtime family error in the major changeset
ScriptedAlchemy Sep 25, 2026
b27e763
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
953ceeb
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
1f51217
chore: name the runtime family errors in the major changeset
ScriptedAlchemy Sep 25, 2026
f6d2e8b
fix(node): name a missing federation instance in the script loader
ScriptedAlchemy Sep 25, 2026
729099e
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
9f596f0
test(runtime): compose the optimized-runtime scenarios instead of rea…
ScriptedAlchemy Sep 25, 2026
9861d70
Revert "test(runtime): compose the optimized-runtime scenarios instea…
ScriptedAlchemy Sep 25, 2026
db5159f
Merge remote-tracking branch 'origin/rfc5128/06-rspack-composed' into…
ScriptedAlchemy Sep 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/composed-runtime-default-major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@module-federation/runtime-core': major
'@module-federation/runtime': major
'@module-federation/webpack-bundler-runtime': major
'@module-federation/enhanced': major
'@module-federation/rspack': major
'@module-federation/sdk': major
'@module-federation/node': major
---

The composed federation runtime is the default and only bootstrap. `ModuleFederationPlugin` now always generates a bootstrap that imports only the runtime parts the build uses, and `experiments.composedRuntime` is removed.

Removed:

- The `FEDERATION_OPTIMIZE_NO_SHARED`, `FEDERATION_OPTIMIZE_NO_REMOTE`, `FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN`, `FEDERATION_HAS_EXPOSES`, and `FEDERATION_BUILD_IDENTIFIER` defines. The plugins no longer emit them and the runtime no longer reads them. Use `experiments.optimization.disable*` with the plugin, or import the capabilities you need from `@module-federation/runtime/compose` when you bundle the runtime yourself.
- `__webpack_require__.federation.runtime`. Use `__webpack_require__.federation.instance`, and `instance.platform.loadScriptNode` for the Node loader.
- The fallback in `@module-federation/node` to `federation.runtime.loadScriptNode`.

A build whose installed runtime packages do not export the composition subpaths now fails with an error that names the minimum runtime version. `ENV_TARGET`, `FEDERATION_ALLOW_NEW_FUNCTION`, and `FEDERATION_DEBUG` are unchanged.
16 changes: 7 additions & 9 deletions packages/enhanced/src/lib/container/ModuleFederationPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,13 @@ class ModuleFederationPlugin implements WebpackPluginInstance {

new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);

if (experiments?.composedRuntime) {
// DefinePlugin reads its definitions per compilation, after the plan picked a mode.
compiler.hooks.compile.tap('ModuleFederationPlugin', () => {
if (!composedEntryOf(compiler)) return;
for (const key of Object.keys(definePluginOptions)) {
if (key !== 'ENV_TARGET') delete definePluginOptions[key];
}
});
}
// DefinePlugin reads its definitions per compilation, after the plan picked a mode.
compiler.hooks.compile.tap('ModuleFederationPlugin', () => {
if (!composedEntryOf(compiler)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove capability defines from full-runtime builds

When composition selects legacy mode for a supported externalized or aliased runtime, composedEntryOf(compiler) is undefined and this early return preserves all deprecated FEDERATION_* entries in DefinePlugin. Those builds therefore still rewrite these identifiers—and optimization flags can still alter the supposedly full bootstrap—even though this release says the defines are removed; retain only ENV_TARGET regardless of the selected mode.

Useful? React with 👍 / 👎.

for (const key of Object.keys(definePluginOptions)) {
if (key !== 'ENV_TARGET') delete definePluginOptions[key];
}
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
export type CoveredByOptions = typeof COVERED_BY_OPTIONS;

const usesSharedContainerPlugin = (compiler: Compiler) =>
compiler.options.plugins.some(

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should apply FederationRuntimePlugin during plugin application

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should set FEDERATION_WEBPACK_PATH environment variable

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should register additionalTreeRuntimeRequirements hook

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should set up dependency factories during compilation

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should register factorize and createModule hooks during compilation

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > plugin registration and hooks > should register thisCompilation hook during apply

Cannot read properties of undefined (reading 'plugins')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > apply method > should add runtime modules when runtimeRequirements callback is called

Cannot read properties of undefined (reading 'some')

Check failure on line 59 in packages/enhanced/src/lib/container/runtime/FederationCompositionPlugin.ts

View workflow job for this annotation

GitHub Actions / checkout-install

test/unit/sharing/ConsumeSharedPlugin/ConsumeSharedPlugin.apply.test.ts > ConsumeSharedPlugin > apply method > should register hooks when plugin is applied

Cannot read properties of undefined (reading 'some')
(plugin) =>
typeof plugin === 'object' &&
plugin !== null &&
Expand Down Expand Up @@ -196,10 +196,17 @@
compilation: Compilation,
{ family, entry, legacyReason }: Outcome,
) {
if (legacyReason !== undefined) {
const { externalRuntime, provideExternalRuntime } =
this._options.experiments ?? {};
// An externalized runtime is the full runtime by request; the other reasons are worth a warning.
if (
legacyReason !== undefined &&
!externalRuntime &&
!provideExternalRuntime
) {
compilation.warnings.push(
new WebpackError(
`experiments.composedRuntime is set, but this build uses the full federation runtime because ${legacyReason}.`,
`This build uses the full federation runtime because ${legacyReason}.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail builds when the runtime cannot be composed

When an installed runtime family is too old and lacks a required composition export, selectMode returns a legacyReason, but this path only adds a compilation warning and successfully falls back to the full runtime. This defeats the stated compatibility boundary for the new major release and can let mismatched runtime packages reach production; non-external legacy reasons should be added to compilation.errors and identify the required minimum version.

Useful? React with 👍 / 👎.

),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class FederationRuntimePlugin {
// dont run multiple times on every apply()
if (!onceForCompiler.has(compiler)) {
const options = this.options;
if (options?.experiments?.composedRuntime) {
if (options) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject the removed composedRuntime option

With this unconditional options check, experiments.composedRuntime: false no longer disables composition, yet the SDK type and generated ModuleFederationPlugin schemas still advertise and accept that property. Existing configurations therefore silently receive the opposite behavior instead of being told that the option was removed; remove it from the source schema/type and regenerate the validators.

Useful? React with 👍 / 👎.

new FederationCompositionPlugin(options, (composition) => {
const source = FederationRuntimePlugin.getTemplate(
compiler,
Expand Down
Loading