Skip to content

Comments

[pull] canary from vercel:canary#804

Merged
pull[bot] merged 1 commit intocode:canaryfrom
vercel:canary
Feb 19, 2026
Merged

[pull] canary from vercel:canary#804
pull[bot] merged 1 commit intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link

@pull pull bot commented Feb 19, 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 : )

Runtime prefetch responses previously encoded `isPartial` and
`staleTime` using a sentinel-and-replace pattern: a random number was
embedded in the RSC payload during prerendering, then a TransformStream
scanned the prelude stream to find and replace it with the actual
values. This was fragile because it relied on matching a specific byte
sequence in a chunked stream that could be split at arbitrary
boundaries.

This replaces that mechanism with two simpler approaches:

- **isPartial**: A single byte prepended to the response stream (`#` for
complete, `~` for partial).

- **staleTime**: An `AsyncIterable<number>` in the Flight payload that
yields updated stale time values as the prerender store changes. This
ensures the latest value is always serialized in the stream, even when
sync IO aborts the prerender before the abort callback runs.

The stale time tracking logic is extracted into a new `stale-time.ts`
module with `StaleTimeIterable`, `trackStaleTime`, and
`finishStaleTimeTracking`.

On the client, dynamic runtime prefetch responses (detected via the
absence of `NEXT_IS_PRERENDER_HEADER`) have the byte stripped before
Flight decoding, and the stale time is read by iterating the async
iterable. Static responses served from cache are handled unchanged.
@pull pull bot locked and limited conversation to collaborators Feb 19, 2026
@pull pull bot added the ⤵️ pull label Feb 19, 2026
@pull pull bot merged commit bedf366 into code:canary Feb 19, 2026
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.

1 participant