Skip to content

feat(manifest): report concrete shared provider alternatives - #5078

Closed
ScriptedAlchemy wants to merge 8 commits into
feat/rspack-layered-shared-metadatafrom
feat/shared-provider-metadata
Closed

ScriptedAlchemy wants to merge 8 commits into
feat/rspack-layered-shared-metadatafrom
feat/shared-provider-metadata

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 14, 2026

Copy link
Copy Markdown
Member

Description

Add optional providers metadata when one shared identity has multiple concrete version/import pairs. For example, a build providing React 18 and React 19 now records each provider's import and assets instead of exposing only the existing shared row. Existing top-level fields remain unchanged; single-provider and consumer-only entries omit the new field. Alternatives stay within their scope/layer identity, and older readers remain supported.

Related Issue

Stacked on layers PR #5039 (feat/rspack-layered-shared-metadata), which builds on graph foundation #5080. Scalar scope selection is the separate sibling PR #5079.

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.

Testing: affected dependency build (15 tasks); manifest (59), SDK (69 passed, one existing skip), shared/layer tests (330), config/cache integration (22). Real compiler fixtures check default/common layers, exact provider imports/assets, and singleton client-layer isolation. Foundation rollback/remote tests and legacy-reader compatibility pass. Normal commit hooks and repository formatting pass. Unrelated full-workspace/e2e suites were not rerun; public docs are unchanged, and a changeset is included.

@changeset-bot

changeset-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 964500c

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/sdk Patch
@module-federation/manifest Patch
@module-federation/devtools Patch
@module-federation/cli Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/metro Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspack Patch
@module-federation/rspress-plugin Patch
@module-federation/rstest Patch
@module-federation/runtime-core Patch
@module-federation/runtime Patch
@module-federation/storybook-addon 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-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock 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/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-14T19:30:47.756705Z 6a1e810 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@964500c

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/observability-plugin

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

@module-federation/playground

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/rstest

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 964500c

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a1e8102d9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +362 to +366
(providerModule.identifier !== undefined &&
reason.moduleIdentifier === providerModule.identifier) ||
(providerModule.name !== undefined &&
(reason.moduleName === providerModule.name ||
reason.resolvedModule === providerModule.name)),

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 Match webpack's resolved provider identifier

When webpack reports a re-exported or concatenated provider relationship only through reason.resolvedModuleIdentifier—for example, when the optional module names are absent or differ—this predicate never associates the resource module with its provider. The existing collectRelationshipMap logic in ModuleHandler.ts already uses resolvedModuleIdentifier for webpack, whereas this code checks only Rspack's moduleIdentifier; consequently the provider receives no entry and the alternatives array can be deleted as having fewer than two providers. Include resolvedModuleIdentifier in the identifier match.

Useful? React with 👍 / 👎.

@ScriptedAlchemy

Copy link
Copy Markdown
Member Author

The modern-js-v3 build failure in checkout-install is a lockfile problem inherited from the #5039 merge commit d5bacac79, not a provider-metadata bug.

That merge regenerated pnpm-lock.yaml from main's lockfile with pnpm install --lockfile-only, which let pnpm pick the newest registry @rspack/core (2.2.3, published Sep 8) as the workspace-wide peer instead of 2.1.8. @module-federation/modern-js-v3 then compiled against mismatched @rspack/binding types and failed with Property '[MODULE_IDENTIFIER_SYMBOL]' is missing. Reproduced locally with pnpm exec turbo run build --filter=@module-federation/modern-js-v3 --force.

Fixed on #5039 in d820029d1 by restoring the pre-merge lockfile and removing only main's framer-motion entry from the apps/website-new importer. Frozen install, the modern-js-v3 build, and the manifest tests pass there.

To fix this branch, merge #5039's current head (d820029d1) into feat/shared-provider-metadata. A quick check that the lockfile is right after any regeneration is rg -c '@rspack/core@2\.1\.8' pnpm-lock.yaml staying at 114.

@ScriptedAlchemy

Copy link
Copy Markdown
Member Author

Moved to the independent draft #5083, based on main, for the provider-metadata proposal in #5082. This feature is no longer part of the layers stack. The original branch and commits are preserved.

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