Skip to content

fix(enhanced): preserve same-version shared modules across scopes - #5079

Open
ScriptedAlchemy wants to merge 15 commits into
feat/rspack-layered-shared-metadatafrom
fix/scalar-shared-scopes
Open

ScriptedAlchemy wants to merge 15 commits into
feat/rspack-layered-shared-metadatafrom
fix/scalar-shared-scopes

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Description

Keep same-version shared providers separate when they use different scalar share scopes. For example, React 1.0.0 in scopes a and b now registers both factories and emits separate rows with the correct assets and options. Previously, deduplication could discard one registration while local fallbacks masked the loss. Preserve requiredVersion: false and match configured aliases to their owning scope/layer.

Related Issue

Stacked on layers PR #5039 (feat/rspack-layered-shared-metadata), which builds on graph foundation #5080. Provider metadata is outside this stack: see RFC #5082 and independent draft #5083.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Validation: the real Webpack fixture covers unlayered and common-layer providers, checks registration with a separate consumer without fallbacks, and verifies exact stats/manifest rows and assets. It passes within the 18 related layer config cases. The inherited runtime fix passes 141 runtime-core, 70 SDK (one existing skip), and 103 bundler tests, plus 26 compatibility assertions with actual Federation 0.24.1/2.9.1 constructors. Normal hooks and affected dependency builds passed. The earlier ee3f65a runtime head passed hosted formatting, builds, publishing checks, affected tests, and Node.js 20 verification. Final-head validation is tracked below; unrelated full app suites were not rerun.

The compiler compatibility fixture pins Rspack 1.3.9/Federation 0.13.1 as the older host and the published final Rspack d538c9c preview (2.2.7) with the current workspace runtime as the remote. All four old-host cases pass locally across default/custom scopes and remote-entry/manifest loading. The complete manifest suite passes 55/55 tests. The final published c4521e5 Federation suite (2.9.2) passes four actual native same-scope/key/version layer cases, both provider orders and eager/lazy loading, plus four sync/async adapter cases, 26 assertions with actual Federation 0.24.1/2.9.1, and two classic share-entry checks. Both Linux x64 and Mac ARM64 compiler preview workflows succeeded. Both final core heads pass hosted formatting, package builds, publishing checks, and affected package tests; Node.js 20 also passes on both heads; broader E2E jobs remain pending. The two shared preview checksums were refreshed after the Mac publication; an empty-store frozen installation verifies the compiler, wrapper, and Linux binary.

Two sync/async regressions cover compiler-provided share entries without enhanced shareConfig. The seven formerly failing legacy config cases and two provider cases pass locally after the one-line compatibility fix.

@changeset-bot

changeset-bot Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4521e5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 48 packages
Name Type
@module-federation/enhanced Patch
@module-federation/manifest Patch
@module-federation/sdk Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/rstest Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/rspack Patch
@module-federation/devtools Patch
@module-federation/cli Patch
@module-federation/dts-plugin Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/metro Patch
@module-federation/observability-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/runtime-core Patch
@module-federation/runtime Patch
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
@module-federation/playground Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/runtime-tools Patch
@module-federation/inject-external-runtime-core-plugin Patch
create-module-federation Patch
@module-federation/error-codes Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/treeshake-frontend Patch
@module-federation/treeshake-server Patch
@module-federation/bridge-shared Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T20:58:55.418840Z cb742f5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@c4521e5

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@c4521e5

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@c4521e5

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@c4521e5

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@c4521e5

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@c4521e5

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@c4521e5

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@c4521e5

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@c4521e5

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@c4521e5

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@c4521e5

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@c4521e5

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rock@c4521e5

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@c4521e5

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@c4521e5

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@c4521e5

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@c4521e5

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@c4521e5

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@c4521e5

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/@module-federation/observability-plugin@c4521e5

@module-federation/playground

pnpm add https://pkg.pr.new/@module-federation/playground@c4521e5

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@c4521e5

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@c4521e5

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@c4521e5

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@c4521e5

@module-federation/rstest

pnpm add https://pkg.pr.new/@module-federation/rstest@c4521e5

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@c4521e5

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@c4521e5

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@c4521e5

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@c4521e5

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@c4521e5

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@c4521e5

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@c4521e5

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@c4521e5

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@c4521e5

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@c4521e5

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@c4521e5

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@c4521e5

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@c4521e5

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@c4521e5

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@c4521e5

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@c4521e5

commit: c4521e5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant