Skip to content

fix(chunk-import-map): keep common chunk keys unique when enabling inline common chunks - #11230

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/chunk-import-map-logical-origin
Oct 19, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
fix/chunk-import-map-logical-origin

Conversation

@hyfdev

@hyfdev hyfdev commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Common chunks that share a name can get duplicate import-map keys when inlining copies a shared module into them. This PR keeps each import mapped to its intended file.

In #11168, the entry importing both b/shared.js and c/shared.js prints:

Before:

e3 B:tiny11264 B:tiny11264

After:

e3 B:tiny11264 C:tiny11264

Inlining adds the same tiny module to several chunks' public module lists. The address calculation can then select the same minimum module ID for multiple chunks, and one import-map entry overwrites another.

The first common chunk with a given name keeps its name-derived key. Later chunks with that name use the smallest resolved module ID among their original members, before inlining. Native render hooks expose those members; public metadata includes every printed copy. Keys with inlining disabled stay unchanged.

Fixes #11168. Closes #11226.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-chunk-import-map-logical-origin-rolldown-rs.voidzero-docs.workers.dev (commit 3f03741)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://187c1781-rolldown-rs.voidzero-docs.workers.dev 3f03741 2026-10-19T08:19:28.334Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://355e98f8-rolldown-rs.voidzero-docs.workers.dev dcb353f 2026-10-17T04:09:14.280Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://80ac471f-rolldown-rs.voidzero-docs.workers.dev 562f33b 2026-10-17T03:44:52.936Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4df81913-rolldown-rs.voidzero-docs.workers.dev 1669606 2026-10-17T02:56:48.208Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6778001b-rolldown-rs.voidzero-docs.workers.dev 444c2ba 2026-10-16T16:27:22.831Z Visit the dashboard ↗

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 3f03741
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ad5d22b7c0359b55af7373c
😎 Deploy Preview https://deploy-preview-11230--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hyfdev
hyfdev force-pushed the fix/chunk-import-map-logical-origin branch from 444c2ba to 1669606 Compare October 17, 2026 02:52
@hyfdev
hyfdev marked this pull request as ready for review October 17, 2026 04:09
Copilot AI balanced review requested due to automatic review settings October 17, 2026 04:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codspeed

codspeed Bot commented Oct 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 4 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix/chunk-import-map-logical-origin (dcb353f) with main (d226543)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (33a987d) during the generation of this report, so d226543 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

shulaoda commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Merge activity

  • Oct 19, 8:16 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 19, 8:16 AM UTC: shulaoda added this pull request to the Graphite merge queue.
  • Oct 19, 8:23 AM UTC: Merged by the Graphite merge queue.

…line common chunks (#11230)

Common chunks that share a name can get duplicate import-map keys when inlining copies a shared module into them. This PR keeps each import mapped to its intended file.

In #11168, the entry importing both `b/shared.js` and `c/shared.js` prints:

Before:

```text
e3 B:tiny11264 B:tiny11264
```

After:

```text
e3 B:tiny11264 C:tiny11264
```

Inlining adds the same tiny module to several chunks' public module lists. The address calculation can then select the same minimum module ID for multiple chunks, and one import-map entry overwrites another.

The first common chunk with a given name keeps its name-derived key. Later chunks with that name use the smallest resolved module ID among their original members, before inlining. Native render hooks expose those members; public metadata includes every printed copy. Keys with inlining disabled stay unchanged.

Fixes #11168. Closes #11226.
@graphite-app
graphite-app Bot force-pushed the fix/chunk-import-map-logical-origin branch from dcb353f to 3f03741 Compare October 19, 2026 08:17
@graphite-app
graphite-app Bot merged commit 3f03741 into main Oct 19, 2026
37 checks passed
@graphite-app
graphite-app Bot deleted the fix/chunk-import-map-logical-origin branch October 19, 2026 08:23
@rolldown-guard rolldown-guard Bot mentioned this pull request Oct 21, 2026
shulaoda added a commit that referenced this pull request Oct 21, 2026
## [1.2.15] - 2026-10-21

### 🚀 Features

- rolldown_plugin_vite_resolve: add `isBundled` to pick the browser-external stub format (#11260) by @h-a-n-a
- dev: mark entry modules in the HMR module graph (#11252) by @h-a-n-a
- mark module starts with `// <id>` comments instead of `#region` pairs (#11235) by @IWANABETHATGUY

### 🐛 Bug Fixes

- plugin: stop `this.resolve` recursion between plugins with `skipSelf: true` (#11181) by @anzal1
- rolldown_plugin_vite_resolve: handle external `require` for `ssr.target: 'webworker'` (#11205) by @sapphi-red
- rolldown_plugin_vite_build_import_analysis: only wrap dynamic imports with static specifiers in __vitePreload (#10879) by @smeng9
- strict-execution-order: wrap eager modules that forward wrapped definers (#11186) by @hyfdev
- chunk-import-map: keep common chunk keys unique when enabling inline common chunks (#11230) by @hyfdev
- only register signal-exit handler when a trace subscriber is active (#11208) by @DaniilIsupov

### 🧪 Testing

- fold hand-unrolled Rust test tables (#11212) by @Brooooooklyn

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.155.0 (#11228) by @Dunqing
- rollup-tests: retriage failed tests (#11251) by @sapphi-red
- deps: update rollup submodule for tests to v4.64.12 (#11249) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (#11242) by @rolldown-guard[bot]

### ❤️ New Contributors

* @anzal1 made their first contribution in [#11181](#11181)
* @smeng9 made their first contribution in [#10879](#10879)
* @DaniilIsupov made their first contribution in [#11208](#11208)

Co-authored-by: shulaoda <[email protected]>

This branch was previously deployed

1 inactive deployment
void — 3f037418 Deployed Oct 19, 2026 by graphite-app[bot] via Deploy to Void #5964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: experimentalInlineCommonChunks produces duplicate chunkImportMap keys

3 participants