fix(runtime): preserve collision-free createRequire imports - #14994
Merged
Merged
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Contributor
📦 Binary Size-limit
🙈 Size remains the same at 66.74MB |
Contributor
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 react-1kPath:
Generated by Rsdoctor GitHub Action |
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
stormslowly
approved these changes
Jul 30, 2026
Deploying rspack with
|
| Latest commit: |
e0bb127
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://284d6eb6.rspack-v2.pages.dev |
| Branch Preview URL: | https://seal-remove-redundant-create.rspack-v2.pages.dev |
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
createRequirehelper to a runtime-specific identifiercreateRequireimports fromnode:moduleunaliased in modern-module outputWhy
RspackExport reserves variables declared by runtime modules before linking top-level bindings. The generic HMR helper name reserved
createRequirefor every chunk, even when HMR was not emitted, causing external imports to use a longer generated alias. Giving the HMR helper a runtime-specific name removes that false collision without adding scans or allocations to the chunk/module linking hot path.This avoids approximately 59 raw bytes / 15 gzip bytes per affected output reported in the Rslib integration corpus.
Related links
Checklist