Skip to content

[pull] canary from vercel:canary#1009

Merged
pull[bot] merged 6 commits intocode:canaryfrom
vercel:canary
Apr 29, 2026
Merged

[pull] canary from vercel:canary#1009
pull[bot] merged 6 commits intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 29, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

mischnic and others added 6 commits April 29, 2026 14:18
Added in vercel/turborepo#8037

Nobody uses this, and it's also the only crate that uses the lsp-server
dependency.
…tion and snapshotting (#92658)

## What?

Fixes a snapshot encoding panic introduced by #89370 in
`turbopack/crates/turbo-tasks-backend/src/backend/storage.rs`.

## Why?

#89370 refactored snapshot iteration and in doing so introduced two
incorrect assertions in `SnapshotShardIter::next` for tasks in the
`modified` list that were re-modified during snapshot iteration:

1. **`.expect("snapshot entry for modified_during_snapshot task must
contain a value")`** — this panics in the `(true, false)` branch of
`track_modification_internal`, where a task was modified in one category
before the snapshot and then modified in a *different* category during
iteration. The second modification stores a `None` entry in `snapshots`
(because there was no pre-existing data to copy for that category), but
the iterator unconditionally unwrapped `Some`.

2. **`debug_assert!(!inner.flags.any_modified())`** — after clearing the
live `data_modified`/`meta_modified` flags and before promoting
`_during_snapshot` flags, the old code asserted that no modified flags
remained. This fires in the `(true, true)` branch because clearing the
flags happens after the snapshot copy was taken, so the assert races
with the flag state.

## How?

- Unify the `direct_snapshots` fast-path and the `modified` list into a
single path that handles both `(true, true)` and `(true, false)` cases
gracefully: if `any_modified_during_snapshot()` is set, check the
`snapshots` map — use the `Some(copy)` if present, otherwise fall back
to live data (which is correct for the `None`/first-time-modified case).
- Add a regression test covering the `(true, false)` branch
(`modify_different_category_during_snapshot`).

<!-- NEXT_JS_LLM_PR -->
…93110)

**This PR removes the special-case handling for metadata routes so it
benefits from server hmr. It also adds tests.**

Previously, metadata routes were excluded from Turbopack's server-side
HMR and fell back to a full require-cache eviction on every change. This
meant unmodified dependency modules were unnecessarily re-evaluated.

Metadata routes use the same app-route.js template and getUserland()
per-request getter as regular route handlers, so they can participate in
in-place server HMR the same way. Remove the isMetadataRoute() exclusion
from the usesServerHmr gate.

Test Plan: Added e2e test for testing selective hmr eviction

Co-authored-by: Will Binns-Smith <wbinnssmith@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
our error boundaries had a bunch of logic that set `state.error = error`
and then checked `if (state.error)`, which only works correctly if
thrown value is truthy. it breaks if something does e.g. `throw
undefined`. in this case, we would incorrectly think that no error
occurred and render children again (instead of a fallback), which can
then lead to an infinite loop if the children throw again.

the fix is to wrap the thrown value, so `state.error` is either `null`
(initial/reset) or `{ thrownValue: ... }` if something errored. i
initially considered using a separate `state.hasError` boolean, but
that's a bit annoying to type, and really we want to model this as a
discriminated union, so using a pseudo-Optional thing is nicer.
## What?

Updates the trace upload url as it has been moved.

Since this subcommand is only available on canary currently the previous
API url will not be preserved.
@pull pull Bot locked and limited conversation to collaborators Apr 29, 2026
@pull pull Bot added the ⤵️ pull label Apr 29, 2026
@pull pull Bot merged commit f3f7c7c into code:canary Apr 29, 2026
1 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants