Skip to content

feat: support experimentalInlineCommonChunks in dev mode - #11335

Merged
hyfdev merged 1 commit into
hyfdev/dev-esm-init-noop-20261027from
hyfdev/inline-common-chunks-dev-mode-20261027
Oct 27, 2026
Merged

hyfdev merged 1 commit into
hyfdev/dev-esm-init-noop-20261027from
hyfdev/inline-common-chunks-dev-mode-20261027

Conversation

@hyfdev

@hyfdev hyfdev commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

experimentalInlineCommonChunks rejects experimental.devMode, so Vite's bundled dev mode fails to start when the option is set. This PR makes the option work in dev mode, including HMR through inlined modules.

Before, vite with experimental.bundledDev and the option set:

error when starting dev server:
Error: Fail to create dev engine: ... a `maxSize` greater than 0 requires `experimental.devMode` to be off.

After, the dev server starts and inlines eligible small common chunks.

Inlined modules belong to no file, so their HMR graph rows (registerGraph) never shipped, and an edit reaching its boundary through them became a full reload. Each inlined chunk's factory registers those rows; it runs once per page, so a later file carrying the same chunk can't overwrite newer rows from a patch.

In dev, chunks with import.meta.hot code (e.g. React refresh) stay files.

Builds on the init_* fix below it in this stack. Part of #11040.

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://hyfdev-inline-common-chunks-dev-mode-20261027-rolldown-rs.voidzero-docs.workers.dev (commit a5a6312)

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://a63b5068-rolldown-rs.voidzero-docs.workers.dev a5a6312 2026-10-27T06:15:37.239Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://36265495-rolldown-rs.voidzero-docs.workers.dev 941a4ad 2026-10-27T05:01:45.860Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://052f4711-rolldown-rs.voidzero-docs.workers.dev 646af05 2026-10-27T03:22:28.130Z Visit the dashboard ↗

@hyfdev
hyfdev added this pull request to stack #11336 October 27, 2026 03:40
@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit a5a6312
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ae041186cc5b888b32dce1b

@hyfdev
hyfdev force-pushed the hyfdev/inline-common-chunks-dev-mode-20261027 branch from 646af05 to 941a4ad Compare October 27, 2026 04:59
@hyfdev
hyfdev marked this pull request as ready for review October 27, 2026 05:06
@hyfdev
hyfdev requested a balanced review from Copilot and removed request for IWANABETHATGUY October 27, 2026 05:06

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 insufficient remaining quota.

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 27, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.42%

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 1 regressed benchmark
✅ 6 untouched benchmarks
⏩ 10 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ bundle@multi-duplicated-top-level-symbol 571 ms 591.3 ms -3.42%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing hyfdev/inline-common-chunks-dev-mode-20261027 (a5a6312) with hyfdev/dev-esm-init-noop-20261027 (7976e2c)

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. ↩

@hyfdev
hyfdev force-pushed the hyfdev/inline-common-chunks-dev-mode-20261027 branch from 941a4ad to a5a6312 Compare October 27, 2026 06:13
@hyfdev
hyfdev enabled stacked auto-merge (squash) October 27, 2026 06:14
@hyfdev
hyfdev merged commit 0a09953 into main Oct 27, 2026
36 checks passed
@hyfdev
hyfdev deleted the hyfdev/inline-common-chunks-dev-mode-20261027 branch October 27, 2026 06:18
This was referenced Oct 29, 2026
shulaoda added a commit that referenced this pull request Oct 29, 2026
## [1.2.16] - 2026-10-29

### 🚀 Features

- perf-kit: check rendered output against the original build (#11140) by @IWANABETHATGUY
- perf-kit: node/deno server startup mode (#10601) by @IWANABETHATGUY
- perf-kit: browser page-load perf harness for coding agents (#10365) by @IWANABETHATGUY
- devtools: report mode - agent-readable build metrics report (#10364) by @IWANABETHATGUY
- inline-common-chunks: print record factories parenthesized so they compile eagerly (#11282) by @mattlewis92
- fold `'key' in ns` on namespace imports with statically known exports (#11333) by @danielroe
- inline-common-chunks: inline chunks using `import.meta.hot` in dev mode (#11339) by @hyfdev
- support `experimentalInlineCommonChunks` in dev mode (#11335) by @hyfdev
- use `INVALID_TLA_FORMAT` error for Rollup compatibility (#11266) by @sapphi-red

### 🐛 Bug Fixes

- await bundle.close() in loadConfig and clean up every generated config file (#10347) by @Brooooooklyn
- deps: update mimalloc-safe to 0.1.69 (#11376) by @shulaoda
- transform: don't crash when the working directory has been deleted (#11352) by @shulaoda
- import-glob: follow directory symlinks on the wasm binding (#10624) by @hyfdev
- tree-shaking: preserve exported rest bindings from dynamic imports (#11365) by @shuvroroy
- transform: report `tsconfigFilePaths` for a tsconfig resolved through `TsconfigCache` (#11346) by @cainrus
- tsconfig: don't apply tsconfig when resolving imports from virtual modules (#11089) by @rubas
- code-splitting: handle emitted entries the same as `input` entries when placing the runtime (#11353) by @IWANABETHATGUY
- error: make Diagnostic::add_file idempotent (#10610) by @Nic-Polumeyv
- avoid retaining callable builtin callback owners (#10961) by @IWANABETHATGUY
- code-splitting: only host the runtime in a chunk that every consumer's entries load (#11293) by @IWANABETHATGUY
- code-splitting: keep the source order of chunk imports (#11298) by @IWANABETHATGUY
- dev: don't treat a wrapped module's init as a no-op in dev mode (#11334) by @hyfdev
- treat `cwd` as a literal path in relative glob filters (#11291) by @onmax
- deps: update emnapi to 2.0.0-beta.2 and pin `@napi-rs/wasm-runtime` to 1.2.6 (#11292) by @IWANABETHATGUY
- chunk-import-map: hash stable module ids so keys don't depend on the build folder (#11277) by @mandyheg
- respect CPU limits when sizing native runtime workers (#11280) by @Brooooooklyn
- deconflict the namespace of a module without module syntax (#11256) by @IWANABETHATGUY
- code-splitting: rebuild an absorbed dynamic entry's namespace from what its imports read (#11200) by @mattlewis92
- escape line terminators in debug-info comments (#11258) by @IWANABETHATGUY

### 🚜 Refactor

- extract callable builtin hook wrapper (#10964) by @IWANABETHATGUY

### 📚 Documentation

- add an in-depth explanation for inline common chunks (#11239) by @hyfdev

### ⚡ Performance

- incremental cycle check for `avoidRedundantChunkLoads` (#11320) by @IWANABETHATGUY
- avoid copying module code for `renderedLength` and share `chunk.code` across plugins (#11342) by @IWANABETHATGUY
- count UTF-16 lengths with `simd-utf16-len` (#11259) by @IWANABETHATGUY
- don't load consola when importing rolldown (#11257) by @magurotuna

### 🧪 Testing

- dev: cover hot updates that need modules the tab never received (#9647) by @matthewdavis-oai
- dev: add dynamic import rebuild test (#7123) by @sapphi-red
- code-splitting: import file URLs in fresh-process runtime host tests on Windows (#11354) by @shulaoda
- esbuild: mark loader_data_url_base64_invalid_utf8 as an intentional difference (#10790) by @CoderSerio
- watch: fix flaky `watch buildDelay` (#11175) by @Brooooooklyn

### ⚙️ Miscellaneous Tasks

- install `cmake-core` instead of the `cmake` metapackage on FreeBSD (#11361) by @shulaoda
- deps: update oxc to 0.156.0 (#11326) by @Dunqing
- stop the Discord notification when the metric workflow fails (#11357) by @IWANABETHATGUY
- connect to the Void platform before the docs deploy (#11350) by @shulaoda
- deps: update rust crates (#11297) by @renovate[bot]
- deps: update dependency vite-plus to v1.4.0 (#11288) by @renovate[bot]
- deps: update npm packages (#11296) by @renovate[bot]
- deps: update napi (#11287) by @renovate[bot]
- deps: update rollup submodule for tests to v4.65.1 (#11331) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (#11332) by @rolldown-guard[bot]
- deps: update dependency rolldown-plugin-dts to v0.28.8 (#11286) by @renovate[bot]
- deps: bump tokio to 1.53.3 (#11317) by @Brooooooklyn

### ❤️ New Contributors

* @mattlewis92 made their first contribution in [#11282](#11282)
* @shuvroroy made their first contribution in [#11365](#11365)
* @cainrus made their first contribution in [#11346](#11346)
* @matthewdavis-oai made their first contribution in [#9647](#9647)
* @rubas made their first contribution in [#11089](#11089)
* @danielroe made their first contribution in [#11333](#11333)
* @onmax made their first contribution in [#11291](#11291)
* @mandyheg made their first contribution in [#11277](#11277)
* @magurotuna made their first contribution in [#11257](#11257)

Co-authored-by: shulaoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants