[codex] improve bundle size reporting for bundled runtime paths#4527
[codex] improve bundle size reporting for bundled runtime paths#4527ScriptedAlchemy merged 20 commits intomainfrom
Conversation
|
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@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/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/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: |
…ort-retro # Conflicts: # .changeset/breezy-walls-burn.md
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle Size Report10 package(s) changed, 31 unchanged. Package dist + ESM entry
Bundle targets
Consumer scenarios
Total dist (raw): 10.68 MB (+1.0 kB (+0.0%)) Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as |
| onlyUpdatePeerDependentsWhenOutOfRange, | ||
| }) { | ||
| //disable major bump due to peer dep | ||
| if (depType === 'peerDependencies') { |
There was a problem hiding this comment.
we need to preserve this in the updated version
if (depType === 'peerDependencies') { return false }
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9c6285095
ℹ️ 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".
| const changed = [...changedPackages].sort(); | ||
| unchangedCount = allPackages.size - changed.length; |
There was a problem hiding this comment.
Include scenario deltas in change summary
changed is derived only from changedPackages, which is populated from package and entrypoint metrics, so scenario-only diffs are ignored. When currentScenarios changes but package metrics do not, the report still prints No bundle size changes detected. even though the Consumer scenarios table shows deltas, which can hide real regressions/improvements in the top-level CI comment.
Useful? React with 👍 / 👎.
Summary
The bundle-size comment on
codex/env-runtime-stackedwas not showing the expected tree-shaking improvement because the existing report only measured each package's root entrypoint. That hid the./bundlerexport path where the runtime split actually matters, and it also made the output look flat when comparingwebvsnodeon the stacked base branchcodex/runtime-bundler-entrypoints.This change keeps the historical package-root metrics, but extends the report so the comment surfaces the runtime-specific signal directly.
What changed
web/nodebundle measurements./bundlerso tree-shakable runtime entrypoints are reported explicitlyConsumer scenariossection to the markdown outputEnhanced remoteEntryscenario that builds a tiny webpack consumer with@module-federation/enhancedand reports emittedremoteEntrygzip forwebandnodeWhy this fixes the reporting gap
The runtime tree-shaking work in
codex/env-runtime-stackeddoes not primarily show up in the root package import. It shows up in the./bundlerpath and in downstream generated output. The new report exposes both:./bundlertotals across runtime packagesEnhanced remoteEntrycomparisonIn local CI parity, the updated report now includes:
./bundlertotalsConsumer scenariosEnhanced remoteEntry | web 19.2 kB | node 20.2 kBValidation
Ran:
CI_LOCAL_BASE_REF=origin/codex/runtime-bundler-entrypoints pnpm run ci:local --only=bundle-sizeResult:
stats.txtincluded the newConsumer scenariossectionstats.txtincluded tracked./bundlertotalsNotes
Local validation was run with Node
22.22.0, while CI runs Node20. The repository's local CI wrapper emitted that parity warning, but the bundle-size job completed successfully.PR Stack
This PR is 3/3 in the stack.
Stack order (base -> tip):
Navigation:
#4526 -> #4518 -> #4527codex/bundle-size-report-retrointocodex/env-runtime-stacked