Repository navigation
Conversation
🦋 Changeset detectedLatest commit: ad798e5 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 Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24916a4a09
ℹ️ 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".
Description
@module-federation/rspackbuildsmf-stats.jsonby callingcompilation.getStats().toJson({ modules, reasons })over every module, then keeps about a dozen of them. #5080 fixed this for Webpack only. Rspack already writes the same stats natively whenmanifestis set, and the JS plugin already has a branch that completes those native stats. The rspack plugin never switched it on, so apps that leavemanifestunset went throughtoJson().With the default manifest setting, Rspack 2.3.0 and later emit federation stats from the compiler graph. The plugin enables the native emitter when the public path supports manifest generation. Explicit
manifest: false, older Rspack versions, and Webpack keep their existing defaults.The JS plugin uses the container's configured library type and reads each expose's files from its own chunk group in load order. This keeps the remote loader, CSS cascade, and route-specific assets correct. It restores shared configuration and versions, and attributes each share to the public exposes that consume it, including multi-import exposes and layered aliases. A consumer-only build leaves the remote entry name empty.
When released compilers collapse aliases, merge ambiguous share scopes, or omit share versions, the plugin can still call the JS stats collector. Ordinary builds and unambiguous custom scopes avoid full module serialization. An uninferable version can report
requiredVersion: nullin place of"^undefined".Asset collection also reads
process.env.NODE_ENVonce per asset list and reuses chunk-name lookups.Validation
On Node 24, both affected packages built, type-checked, and linted. All 115 manifest and 32 Rspack tests passed. The manifest demo passed eight Cypress tests in development and eight in production. Workspace formatting passed. Testing was scoped to the affected packages and manifest demo.
The regression fixtures exercise the public plugin with
manifestomitted. I checked the emitted metadata on released Rspack 2.3.0, 2.3.3, and 2.3.4. In Chrome on 2.3.3, the host loaded the global container with an ESM application output, and the component's style override won in both build modes. In development, loading the expose also left the unrelated route stylesheet out of the host.I measured the final changes on released Rspack 2.3.3 with 10,000 leaf modules and 100 exposes. Each configuration had one initial build and six file-change rebuilds. Local median rebuild times were:
teamscopeRelated work
The original Rsbuild performance report is #3713. Rspack #16754 addresses alias emission in the compiler. This PR also handles the published compilers affected by that issue.
Types of changes
Checklist