Skip to content

[pull] canary from vercel:canary#1058

Merged
pull[bot] merged 6 commits into
code:canaryfrom
vercel:canary
May 19, 2026
Merged

[pull] canary from vercel:canary#1058
pull[bot] merged 6 commits into
code:canaryfrom
vercel:canary

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 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 : )

mischnic and others added 6 commits May 19, 2026 17:58
This allows injecting client bootstrap code using only next.config.js
(without writing to any user source files).
Outdated. we don't really use these
## Problem
Fixes the trace propagation issue reported in
vercel/otel#107.

`NEXT_OTEL_VERBOSE=1` opened the `NextServer.getRequestHandler` span
before request header propagation, so incoming `traceparent` was ignored
and framework spans started a new trace.

## Solution
Extract propagated request context before wrapper request-handler spans.
Add focused e2e coverage in the existing OpenTelemetry suite for verbose
spans inheriting the incoming `traceparent`, including the parent span
id.

Validated with `pnpm --filter=next build` and `pnpm test-dev-turbo
test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts`.

<!-- NEXT_JS_LLM_PR -->
…93940)

When both `cachedNavigations` and `varyParams` are enabled and a `<Link
prefetch={true}>` points to a page with fallback params, the resulting
Full prefetch could leak param-specific content into the cache entry of
a different param value. As of today, `varyParams` tracking only works
within the static stage portion of a response. A Full prefetch response
covers all stages, so the server-reported set is incomplete and can't be
trusted — it may arrive empty. The client then re-keys the entry under a
vary path where every path param is replaced with `<Fallback>`, so a
subsequent lookup for a different param value collides on that entry and
reads the previously prefetched page's content.

This change makes `fulfillEntrySpawnedByRuntimePrefetch` skip the
re-keying when `fetchStrategy === FetchStrategy.Full` and keep the entry
pinned to its concrete vary path. That aligns Full prefetches with how
they're already keyed when `cachedNavigations` is disabled, where the
server sends no `varyParams` and the client never re-keys. The trade-off
is that we miss out on cross-param sharing for Full prefetches even when
a segment genuinely doesn't depend on a given param. Ideally we'd track
`varyParams` through the dynamic stage too, but that's not possible
today: the `varyParams` thenable would need to resolve before the render
completes, while React waits for the thenable to resolve before
completing the render — a deadlock in the Flight response.

This limitation should naturally go away as `prefetch={true}` evolves
under Cache Components, where it will likely become a runtime prefetch —
a render aborted at a known stage — at which point we can track
`varyParams` properly across stages for these requests, likely switching
from a thenable to an async iterable.
rootParams is now available by default. the flag is removed.

There are still intentional limitations. For instance rootParams cannot
be used in route handlers and Server Actions. The feature will be
expanded with some support for this in the future.
A lot of this was written with Claude. We lean a lot on published
libraries for the statistics, so I've got confidence in them.

This adds top-level commands to devlow, `run`, and `compare`, though
we're still backwards compatible with `run` being the default if no
command is specified.

- `--n=<N>` runs each variant N times, `--warmup=<N>` discards the first
N runs (don't use on cold-start metrics). Default behavior is unchanged
at n=1.
- Every run now writes a snapshot CSV to
`.devlow-bench/snapshots/<ts>.csv` (long format, one row per sample, so
mixed-unit metrics share a file). Override with `--snapshot=<path>`.
- `--compare` prints a side-by-side table at the end of a run against
the newest snapshot. `--baseline=<path>` points at a specific file or
directory.
- `devlow-bench compare <baseline.csv> <current.csv>` is a separate
subcommand for diffing two existing snapshots without rerunning
anything.

For every scenario/variant/metric combination, it shows baseline vs
current `mean / p50 / p90 (n)`, the absolute and percent delta, and two
p-values.
@pull pull Bot locked and limited conversation to collaborators May 19, 2026
@pull pull Bot added the ⤵️ pull label May 19, 2026
@pull pull Bot merged commit 925e24e into code:canary May 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.

5 participants