feat(rspack): support eager exposes - #5023
Conversation
🦋 Changeset detectedLatest commit: c754723 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: |
Bundle Size Report8 package(s) changed, 35 unchanged. Package dist + ESM entry
Bundle targets
Consumer scenarios
Total dist (raw): 36.17 MB (+8.9 kB (+0.0%)) Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as |
Description
Add opt-in
eager: truesupport for Rspack exposes without changing Rspack itself. Eager expose modules are included in the container entry chunk, avoiding a separate async chunk request while preserving the asynchronouscontainer.get()contract and deferring module evaluation until the exposed factory is called.The enhanced Rspack
ModuleFederationPluginapplies the behavior automatically.ExposeEagerPluginis also exported from@module-federation/rspack/pluginfor use alongside Rspack's built-in module federation plugin. Integration tests cover both forms with a container-onlyentry: {}configuration and verify eager versus lazy output assets.Validation run:
pnpm exec turbo run build --filter=@module-federation/rspackpnpm exec turbo run lint --filter=@module-federation/rspack --forcepnpm exec turbo run test --filter=@module-federation/rspack --forcepnpm exec prettier --check packages/rspack/src/ExposeEagerPlugin.ts packages/rspack/src/ModuleFederationPlugin.ts packages/rspack/__tests__/ExposeEagerPlugin.spec.ts packages/rspack/README.md .changeset/eager-exposes-rspack.mdThe full-repository
pnpm exec prettier --check .remains blocked by 682 pre-existing generated files, primarily underapps/website-new/doc_build; none are part of this branch.Related Issue
No related issue.
Types of changes
Checklist