fix(enhanced): preserve same-version shared modules across scopes - #5079
Open
ScriptedAlchemy wants to merge 15 commits into
Open
ScriptedAlchemy wants to merge 15 commits into
ScriptedAlchemy wants to merge 15 commits into
Conversation
🦋 Changeset detectedLatest commit: c4521e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 48 packages
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/metro-plugin-rock
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/observability-plugin
@module-federation/playground
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/rstest
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
4 of 6 tasks
2 of 6 tasks
This branch has not been deployed
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.
Description
Keep same-version shared providers separate when they use different scalar share scopes. For example, React
1.0.0in scopesaandbnow 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. PreserverequiredVersion: falseand 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
Checklist
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.