Skip to content

fix(webpack-bundler-runtime): preserve share scopes on repeated init#4698

Open
2heal1 wants to merge 1 commit intomodule-federation:mainfrom
2heal1:fix/issue-4691
Open

fix(webpack-bundler-runtime): preserve share scopes on repeated init#4698
2heal1 wants to merge 1 commit intomodule-federation:mainfrom
2heal1:fix/issue-4691

Conversation

@2heal1
Copy link
Copy Markdown
Member

@2heal1 2heal1 commented Apr 29, 2026

Reuse an existing non-default share scope when repeated container init receives an incomplete host shareScopeMap instead of overwriting it with an empty scope or the wrong fallback.

Add a regression test covering repeated init with empty and missing custom share-scope entries, and keep the related initContainerEntry array/non-array test suites green.

Description

Related Issue

#4691

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.

Reuse an existing non-default share scope when repeated container init receives an incomplete host shareScopeMap instead of overwriting it with an empty scope or the wrong fallback.

Add a regression test covering repeated init with empty and missing custom share-scope entries, and keep the related initContainerEntry array/non-array test suites green.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

⚠️ No Changeset found

Latest commit: 47dccec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 47dccec
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69f174b295855900083d9e1e
😎 Deploy Preview https://deploy-preview-4698--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 47dccec

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

11 package(s) changed, 28 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 487.9 kB no change 3.9 kB no change
@module-federation/enhanced 806.6 kB no change 672 B no change
@module-federation/managers 69.8 kB no change 334 B no change
@module-federation/manifest 136.1 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/storybook-addon 77.6 kB no change 100 B no change
@module-federation/utilities 110.6 kB no change 328 B no change
@module-federation/webpack-bundler-runtime 95.4 kB +1.5 kB (+1.6%) 405 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -30 B (-1.3%) 2.3 kB -30 B (-1.3%)
@module-federation/core 1.1 kB -30 B (-2.7%) 1.0 kB -29 B (-2.7%)
@module-federation/devtools 21.3 kB -25 B (-0.1%) 21.3 kB -25 B (-0.1%)
@module-federation/enhanced 2.6 kB -42 B (-1.5%) 2.6 kB -42 B (-1.5%)
@module-federation/managers 2.4 kB -25 B (-1.0%) 2.4 kB -25 B (-1.0%)
@module-federation/manifest 6.1 kB -38 B (-0.6%) 6.1 kB -38 B (-0.6%)
@module-federation/metro-plugin-rnc-cli 411 B -25 B (-5.7%) 411 B -25 B (-5.7%)
@module-federation/node 9.2 kB -26 B (-0.3%) 9.2 kB -26 B (-0.3%)
@module-federation/storybook-addon 1.9 kB -21 B (-1.1%) 1.7 kB -22 B (-1.2%)
@module-federation/utilities 2.6 kB -30 B (-1.1%) 2.6 kB -30 B (-1.1%)
@module-federation/webpack-bundler-runtime 4.1 kB +113 B (+2.7%) 4.1 kB +113 B (+2.7%)

Tree-shakable entrypoints

Package Export Entry gzip Delta Web bundle (gzip) Delta Node bundle (gzip) Delta Gap (node-web) Delta
@module-federation/webpack-bundler-runtime ./bundler 151 B no change 4.1 kB +113 B (+2.7%) 4.1 kB +113 B (+2.7%) 0 B 0 B

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 19.8 kB +84 B (+0.4%) 20.9 kB +89 B (+0.4%) +1.0 kB +5 B

Total dist (raw): 6.20 MB (+1.5 kB (+0.0%))
Total ESM gzip: 73.8 kB (no change)
Total web bundle (gzip): 177.6 kB (-179 B (-0.1%))
Total node bundle (gzip): 178.0 kB (-179 B (-0.1%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.9 kB (+113 B (+2.3%))
Tracked ./bundler node bundle (gzip): 4.9 kB (+113 B (+2.3%))

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

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