fix(enhanced): include duplicate shared fallback versions#4771
Conversation
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: dbdbc23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 46 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 |
@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/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@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: |
Bundle Size Report10 package(s) changed, 31 unchanged. Package dist + ESM entry
Bundle targets
Consumer scenarios
Total dist (raw): 6.80 MB (+3.6 kB (+0.1%)) Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as |
|
Replaced by #4778 to use the required branch naming convention. |
What changed
Fixes #4748.
Shared tree-shaking fallback generation now supplements the collected root shared package with all installed versions of that same package from
node_modules, including pnpm's.pnpmstore layout. Fallback generation then de-duplicates by version so duplicate installed versions can each get a matching fallback artifact.Why
When a remote used
nanoid@3.3.11through a nested package while the root app hadnanoid@5.1.6, the manifest could point to3.3.11but only a5.1.6fallback was emitted. Runtime then failed because the matching fallback was missing.Validation
pnpm exec prettier --check packages/enhanced/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.ts packages/enhanced/src/lib/sharing/tree-shaking/IndependentSharedPlugin.ts packages/enhanced/test/unit/sharing/tree-shaking/CollectSharedEntryPlugin.test.ts .changeset/green-shared-fallbacks.mdpnpm --dir packages/enhanced exec rstest test/unit/sharing/tree-shaking/CollectSharedEntryPlugin.test.ts -c rstest.config.tspnpm --filter @module-federation/enhanced run buildpython3.12 .codex/skills/changeset-pr/scripts/run_changeset_status.py --verbosegit diff --checkI also ran the package lint path through the commit hook. It passed with existing package warnings.