Skip to content

fix(dev/lazy): ship the deps of a module that a patch shipped but never ran - #11028

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/dev-lazy-walk-through-shipped
Oct 2, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
fix/dev-lazy-walk-through-shipped

Conversation

@h-a-n-a

@h-a-n-a h-a-n-a commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Problem

A lazy route could fail to load in a second tab.

  1. Tab A opens a lazy route. route.js imports shared.js and dep.js.
  2. Tab B has the page open but has not opened the route.
  3. An edit of shared.js sends a patch to tab B. The patch includes route.js, because it imports shared.js. Tab B does not run it.
  4. Tab B opens the route. The server sees that tab B already has route.js, so it stops there and never checks dep.js.
  5. dep.js is missing, and import() fails with MissingFactoryError.
flowchart LR
  route["route.js — sent by the patch, never ran"] --> shared["shared.js — tab B has it"]
  route --> dep["dep.js — missing"]
Loading

Fix

When the server builds a lazy chunk, it now looks past modules that a patch sent. It does not send them again, but it sends their imports that the tab does not have. It still stops at modules the entry chunk already ran.

Part of #10039 (review list item 1).

🤖 Generated with Claude Code

h-a-n-a commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 5c7d9da
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6abf5d01812e0b000874c363
😎 Deploy Preview https://deploy-preview-11028--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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-dev-lazy-walk-through-shipped-rolldown-rs.voidzero-docs.workers.dev (commit 5c7d9da)

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://3c54c3ea-rolldown-rs.voidzero-docs.workers.dev 5c7d9da 2026-10-02T07:29:50.139Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://77477259-rolldown-rs.voidzero-docs.workers.dev 5b5a838 2026-10-01T09:35:44.651Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6e76d138-rolldown-rs.voidzero-docs.workers.dev 7e237f9 2026-10-01T08:29:22.297Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9a765386-rolldown-rs.voidzero-docs.workers.dev 4255e33 2026-10-01T07:57:18.634Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://5247e86d-rolldown-rs.voidzero-docs.workers.dev 6c7d3bd 2026-09-29T11:11:10.175Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://093d1dd2-rolldown-rs.voidzero-docs.workers.dev 81222b7 2026-09-29T10:53:18.678Z Visit the dashboard ↗

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e237f937f

ℹ️ 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".

@codspeed

codspeed Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix/dev-lazy-walk-through-shipped (5b5a838) with main (25e16ff)

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

@h-a-n-a
h-a-n-a force-pushed the fix/dev-lazy-walk-through-shipped branch from 7e237f9 to 5b5a838 Compare October 1, 2026 09:33

h-a-n-a commented Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

…er ran (#11028)

## Problem

A lazy route could fail to load in a second tab.

1. Tab A opens a lazy route. `route.js` imports `shared.js` and `dep.js`.
2. Tab B has the page open but has not opened the route.
3. An edit of `shared.js` sends a patch to tab B. The patch includes `route.js`, because it imports `shared.js`. Tab B does not run it.
4. Tab B opens the route. The server sees that tab B already has `route.js`, so it stops there and never checks `dep.js`.
5. `dep.js` is missing, and `import()` fails with `MissingFactoryError`.

```mermaid
flowchart LR
  route["route.js — sent by the patch, never ran"] --> shared["shared.js — tab B has it"]
  route --> dep["dep.js — missing"]
```

## Fix

When the server builds a lazy chunk, it now looks past modules that a patch sent. It does not send them again, but it sends their imports that the tab does not have. It still stops at modules the entry chunk already ran.

Part of #10039 (review list item 1).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app
graphite-app Bot force-pushed the fix/dev-lazy-walk-through-shipped branch from 5b5a838 to 5c7d9da Compare October 2, 2026 07:27
@graphite-app
graphite-app Bot merged commit 5c7d9da into main Oct 2, 2026
37 checks passed
@graphite-app
graphite-app Bot deleted the fix/dev-lazy-walk-through-shipped branch October 2, 2026 07:32
@rolldown-guard rolldown-guard Bot mentioned this pull request Oct 7, 2026
shulaoda added a commit that referenced this pull request Oct 7, 2026
## [1.2.13] - 2026-10-07

### 🚀 Features

- rolldown_plugin_vite_import_glob: follow file creation and deletion via hotUpdate (#10550) by @shulaoda
- inline-common-chunks: deduplicate shared code along known loading paths (#11093) by @hyfdev
- rolldown_plugin_vite_import_glob: record a matcher per glob call in dev (#10592) by @shulaoda
- rolldown_plugin_vite_import_glob: watch the directory each glob reads (#10549) by @shulaoda
- watch: hand watch.exclude to notify as its ignore filter (#11008) by @shulaoda
- dev: add `experimental.devMode.hotUpdate` option (#11123) by @h-a-n-a

### 🐛 Bug Fixes

- renamer: check the printed name of namespace-alias imports for captures (#11129) by @IWANABETHATGUY
- devtools: honor `devtools.sessionId` by @Brooooooklyn
- renamer: keep a renamed nested binding off its module's top-level bindings (#11128) by @IWANABETHATGUY
- dev: keep `this` undefined when calling an imported function in HMR patches and lazy chunks (#11126) by @h-a-n-a
- dev: read string-named imports correctly in HMR patches and lazy chunks (#11127) by @h-a-n-a
- sanitize preserveModules chunk names after resolving the relative path (#11087) by @waltuov
- keep the `with` clause on bare external imports (#11100) by @IWANABETHATGUY
- generator: filter DISABLE_JS_HOOK bits from generated HookUsage (#10346) by @Brooooooklyn
- dev: make the module factory async for top-level await (#11118) by @h-a-n-a
- node: give each renderChunk call its own meta object (#11115) by @Brooooooklyn
- honor `externalLiveBindings` for imported exports (#11048) by @camc314
- dev: keep a late payload from replacing newer module code (#11030) by @h-a-n-a
- binding: use-after-free in async `transform` with a `TsconfigCache` (#11080) by @shulaoda
- fail on chunk syntax errors and escape export names once (#11051) by @hyfdev
- dev: ship newly imported modules the client never received (#11029) by @h-a-n-a
- code-splitting: avoid cycles from redundant re-export initialization (#11073) by @hyfdev
- link: treat re-exports of the same external binding as one export (#11069) by @IWANABETHATGUY
- escape namespace properties in IIFE and UMD output (#11085) by @hyfdev
- escape dependency paths in CJS and UMD output (#11084) by @hyfdev
- use computed access for arbitrary import names (#11083) by @hyfdev
- generate valid bindings for shimmed exports (#11082) by @hyfdev
- dev: reload the page when an HMR update fails after merging its edit (#11031) by @h-a-n-a
- dev/lazy: ship the deps of a module that a patch shipped but never ran (#11028) by @h-a-n-a
- code-splitting: don't move init calls in front of unwrapped JSON modules (#11062) by @IWANABETHATGUY
- escape export names in `defineProperty` calls (#11047) by @camc314

### 📚 Documentation

- say the CLI bundles multiple configs one after another (#11111) by @Brooooooklyn
- add `renderChunk` hook filter docs (#11065) by @sapphi-red

### ⚡ Performance

- use `concat_string!` instead of `format!` for plain string joins (#11139) by @IWANABETHATGUY
- utils: evaluate each `concat_string!` argument once (#11105) by @IWANABETHATGUY
- json: escape `JSON.parse` string with `json-escape-simd` (#11104) by @IWANABETHATGUY
- unwrap JSON modules with a non-object root (#11066) by @IWANABETHATGUY

### 🧪 Testing

- inline-common-chunks: fix flaky inlineCommonChunks concurrent imports (#11088) by @hyfdev

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.153.0 (#11109) by @camc314
- update pnpm to v12 (#10876) by @btea
- deps: update pnpm to v11.28.0 (#11049) by @renovate[bot]
- deps: update rollup submodule for tests to v4.64.0 (#11116) by @rolldown-guard[bot]
- deps: update napi (#11137) by @renovate[bot]
- scripts: spawn the rolldown CLI without a shell in setup-vite (#10875) by @Brooooooklyn
- deps: bump `@napi-rs/wasm-runtime` to `~1.2.5` (#11117) by @shulaoda
- deps: update napi (#11108) by @renovate[bot]
- deps: update taiki-e/install-action action to v2.87.22 (#11096) by @renovate[bot]
- deps: update npm packages (#11095) by @renovate[bot]
- deps: update rust crates (#11097) by @renovate[bot]
- deps: update napi (#11063) by @renovate[bot]
- deps: update dependency rust to v1.99.0 (#11071) by @renovate[bot]
- deps: update dependency vite-plus to v1 (#11056) by @renovate[bot]

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