fix: use index maps for concatenated export rendering#13875
Merged
JSerFeng merged 1 commit intoweb-infra-dev:mainfrom Apr 29, 2026
Merged
fix: use index maps for concatenated export rendering#13875JSerFeng merged 1 commit intoweb-infra-dev:mainfrom
JSerFeng merged 1 commit intoweb-infra-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure deterministic rendering of ConcatenatedModule export definitions and related comments by relying on insertion-ordered collections instead of sorting or unordered hash iteration, and adds a regression test to lock the behavior in.
Changes:
- Switch
ConcatenatedModuleexport rendering to useFxIndexMap/FxIndexSetso iteration order is deterministic. - Remove the now-unnecessary sort step when rendering
__webpack_require__.d(exports, { ... }). - Add a new concatenate-modules config case to assert deterministic export definition ordering and
// UNUSED EXPORTScomment ordering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_core/src/concatenated_module.rs |
Use insertion-ordered maps/sets to make export definition + unused/inlined export comment rendering deterministic without sorting. |
tests/rspack-test/configCases/concatenate-modules/deterministic-export-comments/rspack.config.js |
Test config enabling concatenation/usedExports/providedExports to exercise the rendering path. |
tests/rspack-test/configCases/concatenate-modules/deterministic-export-comments/index.js |
Regression assertion for deterministic rendered export definitions and unused export comments. |
tests/rspack-test/configCases/concatenate-modules/deterministic-export-comments/root.js |
Test module defining used/unused exports to validate ordering. |
tests/rspack-test/configCases/concatenate-modules/deterministic-export-comments/dep.js |
Small dependency used by the exported functions to ensure they’re retained/used. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SyMind
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related links
Checklist