1. 20 Mar, 2026 10 commits
    • nextjs-bot's avatar
      v16.2.1 · ed7d2cef
      nextjs-bot authored
      ed7d2cef
    • Joseph's avatar
      docs: post release amends (#91715) · 3e37bb42
      Joseph authored
      Fixes based on feedback post release
      
      Fixes: https://github.com/vercel/next.js/pull/91715
      3e37bb42
    • Abhishek Mardiya's avatar
      docs: fix broken Activity Patterns demo link in preserving UI state guide (#91698) · a15ec6e9
      Abhishek Mardiya authored
      ## What?
      
      Fixes a broken link in the Preserving UI State guide:
      https://nextjs.org/docs/app/guides/preserving-ui-state#examples
      
      The "Activity Patterns demo" link currently points to a non-working URL.
      
      ## Why?
      
      The demo link returns a 404 / invalid page, which makes the example
      section confusing for readers.
      
      ## Changes
      
      - Updated the Activity Patterns demo link to the correct URL.
      
      ## Notes
      
      No functional changes, docs only.
      
      @icyJoseph @delbaoliveira
      a15ec6e9
    • JJ Kasper's avatar
      Fix adapter outputs for dynamic metadata routes (#91680) · 600cd2fe
      JJ Kasper authored
      ## Summary
      
      This fixes adapter `onBuildComplete` outputs for dynamic metadata
      routes.
      
      ## Bug
      
      `handleBuildComplete` skipped metadata routes too aggressively via
      `isStaticMetadataFile(...)`, so dynamic metadata routes (for example
      `robots.txt` / `sitemap.xml` using `connection()`) were omitted from
      `outputs.appRoutes`.
      
      ## Fix
      
      Only skip metadata routes when they are actually prerendered/static
      (present in prerender manifests). Dynamic metadata routes are now
      included in adapter `outputs.appRoutes` as expected.
      
      ## Tests
      
      Added e2e coverage in `test/e2e/app-dir/adapter-dynamic-metadata`:
      - verifies dynamic `robots.txt`, `sitemap.xml`, and `favicon.ico`
      functionality
      - verifies adapter output classification for non-deploy runs
      - skips output-shape verification in deploy mode
      - skips the suite in dev mode
      600cd2fe
    • Niklas Mischkulnig's avatar
      Turbopack: fix webpack loader runner layer (#91727) · 27886d3c
      Niklas Mischkulnig authored
      Otherwise you get a `Dependency tracking is disabled` / infinite loop
      when trying to use both turbopack.rules.loader and turbopackLoader at
      the same time
      27886d3c
    • Hendrik Liebau's avatar
      Fix server actions in standalone mode with `cacheComponents` (#91711) · 88fc4308
      Hendrik Liebau authored
      The `staticPathKey` condition added in #91231 inadvertently applies to
      server action requests on dynamic SSG routes when `cacheComponents` is
      enabled.
      
      Server action fetch requests from the client do not send the `RSC`
      header (`rsc: 1`). They only send `Accept: text/x-component` and the
      `Next-Action` header. This means `isRSCRequest` and
      `isDynamicRSCRequest` are both `false` for action requests. The new
      `staticPathKey` condition (`isSSG && pageIsDynamic &&
      prerenderInfo?.fallbackRouteParams`) evaluates to `true` for dynamic PPR
      routes, setting `staticPathKey` even though `ssgCacheKey` is `null` for
      actions.
      
      With `staticPathKey` set, the request enters the fallback rendering
      block, which serves the cached fallback HTML shell with the action
      result appended to it, instead of responding with just the RSC action
      result.
      
      The fix excludes server action requests from the `staticPathKey`
      computation by adding `!isPossibleServerAction` to the condition,
      restoring the pre-#91231 behavior where `staticPathKey` was always
      `null` for server actions in production.
      
      fixes #91662
      closes #91677
      closes #91669
      88fc4308
    • Tobias Koppers's avatar
      turbo-persistence: remove Unmergeable mmap advice (#91713) · 37aed862
      Tobias Koppers authored
      Remove the `MADV_UNMERGEABLE` (Unmergeable) mmap advice from
      `turbo-persistence`'s `advise_mmap_for_persistence` helper in
      `mmap_helper.rs`.
      
      The WSL (Windows Subsystem for Linux) kernel does not support
      `MADV_UNMERGEABLE` and returns an error when it is applied, causing
      turbo-persistence to fail on WSL. See:
      https://x.com/von_cronen/status/2034944304712392891
      
      Additionally, `MADV_UNMERGEABLE` is already the **default** state for
      memory pages — KSM (Kernel Same-page Merging) is opt-in via
      `MADV_MERGEABLE`. Explicitly setting `MADV_UNMERGEABLE` on pages that
      were never marked mergeable is a no-op on standard kernels, so the call
      provides no benefit while breaking WSL users.
      
      The `MADV_DONTFORK` advice is retained, as it has a clear correctness
      benefit (prevents mmap regions from being inherited by child processes
      on `fork()`).
      
      Removed the `mmap.advise(memmap2::Advice::Unmergeable)` call and its
      associated doc comment from
      `turbopack/crates/turbo-persistence/src/mmap_helper.rs`.
      Co-authored-by: 's avatarTobias Koppers <sokra@users.noreply.github.com>
      Co-authored-by: 's avatarClaude <noreply@anthropic.com>
      37aed862
    • Tobias Koppers's avatar
      Fix layout segment optimization: move app-page imports to server-utility transition (#91701) · d6195eca
      Tobias Koppers authored
      ## Summary
      
      - Add `'turbopack-transition': 'next-server-utility'` to all server-side imports in the `app-page.ts` template so they are properly placed in the server utility layer, rather than relying on `SharedMerged` chunk groups to handle them
      - Remove the now-unnecessary `next-server-utility` transition from `fillMetadataSegment` import in `app_page_loader_tree.rs`
      - Add `SharedMultiple` chunk group variant to support multiple shared entries without a merge tag
        - This avoid passing the `parent` into `SharedMerged`, which did break the layout segment optimization.
      - Refactor `app_module_graphs` to combine `client_shared_entries` + `has_layout_segments` into a single `Option` parameter, simplifying the API and removing the dead code path for non-page endpoints
      
      ## Test plan
      
      - [ ] Verify dev and production builds work with app pages that have layout segments
      - [ ] Verify route handlers still build correctly (no client runtime entries passed)
      - [ ] Run existing app-dir e2e tests
      d6195eca
    • Niklas Mischkulnig's avatar
      Turbopack: lazy require metadata and handle TLA (#91705) · 6cb97d6d
      Niklas Mischkulnig authored
      A regression from #88487
      
      1. Make metadata import lazy with `() => require()`, just like for the layout segments
      2. Properly await the return value to better handle TLA modules
      
      This align with Webpack which does this:
      
      <img width="1535" height="509" alt="Bildschirmfoto 2026-03-20 um 11 58 00" src="https://github.com/user-attachments/assets/f2864c86-ccce-4884-8417-c8ae06c05f78" />
      
      
      Closes PACK-6927
      Closes #91700
      Closes https://github.com/vercel/next.js/issues/91676
      6cb97d6d
    • Luke Sandberg's avatar
      [turbopack] Respect `{eval:true}` in worker_threads constructors (#91666) · e6b101ae
      Luke Sandberg authored
      ### What?
      
      Fixed Turbopack incorrectly trying to resolve inline JavaScript code as module references when `new Worker()` is called with `{ eval: true }` option.
      
      Now we skip creating a reference when `eval:true`, and report warnings if we cannot tell what the value is
      
      ### Why?
      
      Libraries like jsPDF create Worker threads by passing inline JavaScript code as the first argument along with `{ eval: true }` as the second argument. Turbopack was incorrectly treating this inline code as a file path and attempting to resolve it as a module reference, causing build failures.
      
      ### How?
      
      Added logic to detect when the `eval: true` option is passed to the Worker constructor. When this option is present, Turbopack now skips creating a worker reference since the first argument contains executable code rather than a file path. Added comprehensive test coverage using jsPDF to verify the fix works correctly.
      
      Fixes #91642
      e6b101ae
  2. 18 Mar, 2026 9 commits
  3. 17 Mar, 2026 21 commits
    • Benjamin Woodruff's avatar
      Turbopack: Merge release-with-assertions-no-lto profile into release-with-assertions (#91530) · 39e705ca
      Benjamin Woodruff authored
      - More profiles means more bloat to the `target` directory and more cold builds.
      - There's no practical use case where we'd be okay with the performance hit of `debug-assertions` and not okay with the performance hit of `lto = false`. Neither profile was suitable for benchmarking.
      - `release-with-assertions-no-lto` is too long to type and was giving me carpal tunnel.
      39e705ca
    • Luke Sandberg's avatar
      [turbopack] Share scratch buffer across shards using thread local (#90167) · 4de22017
      Luke Sandberg authored
      Instead of allocating a scratch buffer for every shard, buffer them in a thread local.
      4de22017
    • nextjs-bot's avatar
      v16.2.0-canary.103 · 66898148
      nextjs-bot authored
      66898148
    • Benjamin Woodruff's avatar
      docs(turbopack): Remove old `architecture.md` file from turbopack crate (#91473) · 489eaef2
      Benjamin Woodruff authored
      All the stuff in this file is either better documented elsewhere or out-of-date and misleading.
      489eaef2
    • Zack Tanner's avatar
      block disallowed dev origins by default (#91507) · b2b802c0
      Zack Tanner authored
      This removes the warn-only default behavior and enforces the dev-origin guard by default. Cross-origin requests to internal dev resources now block unless they match the built-in local allowlist or an explicit `allowedDevOrigins` entry. The tests are expanded to cover default blocking, configured-but-not-allowlisted hosts, missing Referer in the no-cors path, and same-site requests without an Origin, and the docs are updated to match the new behavior.
      b2b802c0
    • Tim Neutkens's avatar
      Move adapterPath from experimental to stable top-level config (#91535) · 97f42091
      Tim Neutkens authored
      ## Move `adapterPath` from experimental to stable
      
      Graduates `adapterPath` from `experimental.adapterPath` to a top-level
      `NextConfig` option, following the same pattern used for
      `cacheHandlers`, `cacheComponents`, `typedRoutes`, and other options
      that moved out of experimental.
      
      ### Changes
      
      - **Type definition** (`config-shared.ts`): Added `adapterPath` to
      `NextConfig` interface, marked `ExperimentalConfig.adapterPath` as
      `@deprecated`, moved default value to top-level in `defaultConfig`,
      updated `NextConfigRuntime` and `getNextConfigRuntime`
      - **Zod schema** (`config-schema.ts`): Added `adapterPath` to top-level
      `configSchema`
      - **Backward compat** (`config.ts`): Added
      `warnOptionHasBeenMovedOutOfExperimental` call so existing
      `experimental.adapterPath` configs still work with a deprecation
      warning, updated `applyModifyConfig` to read from `config.adapterPath`
      - **Runtime references**: Updated `build/index.ts`, `app-page.ts`,
      `app-route.ts`, `pages-handler.ts` to use `config.adapterPath` /
      `nextConfig.adapterPath`
      - **Tests**: Updated 4 test fixture `next.config` files
      - **Docs**: Updated app router doc (removed `version: experimental`
      frontmatter, top-level config example), pages router doc title, and v16
      upgrade guide
      97f42091
    • nextjs-bot's avatar
    • Tobias Koppers's avatar
      Remove webpack stats generation from Turbopack (#91515) · ee1f9d79
      Tobias Koppers authored
      ### What?
      
      Remove the `TURBOPACK_STATS` feature that generated webpack-compatible
      `webpack-stats.json` files from Turbopack's output.
      
      **Deleted:**
      - `crates/next-api/src/webpack_stats.rs` — the entire 305-line Rust
      implementation that built webpack-format stats (assets, chunks, modules,
      entrypoints) from Turbopack's module graph
      
      **Rust changes:**
      - `crates/next-api/src/lib.rs` — removed `mod webpack_stats;`
      - `crates/next-api/src/project.rs` — removed
      `should_create_webpack_stats()` which read the `TURBOPACK_STATS` env var
      - `crates/next-api/src/pages.rs` — removed `generate_webpack_stats`
      import and stats output emission
      - `crates/next-api/src/app.rs` — same
      
      **TypeScript changes:**
      - `packages/next/src/shared/lib/constants.ts` — removed `WEBPACK_STATS =
      'webpack-stats.json'` constant
      - `packages/next/src/shared/lib/turbopack/manifest-loader.ts` — removed
      `loadWebpackStats()`, `writeWebpackStats()`, `mergeWebpackStats()`, the
      `webpackStats` field, webpack type imports, and the `TURBOPACK_STATS`
      env guard in `writeManifests()`
      - `packages/next/src/server/dev/turbopack-utils.ts` — removed
      `shouldCreateWebpackStats` flag and two `loadWebpackStats()` call sites
      - `packages/next/src/build/handle-entrypoints.ts` — same
      
      ### Why?
      
      This feature is no longer needed and adds dead complexity. It was opt-in
      via `TURBOPACK_STATS=1` but nothing in the current codebase or tooling
      depends on it.
      
      ### How?
      
      Pure deletion — no behavior change for any existing user, as the feature
      was opt-in via an environment variable that is no longer checked.
      
      **Intentionally left untouched:**
      - Webpack's own `stats.json` generation (non-Turbopack path)
      - The Turbopack bundle analyzer / `analyze` feature
      - `route-bundle-stats.json` in `.next/diagnostics/`
      Co-authored-by: 's avatarTobias Koppers <sokra@users.noreply.github.com>
      Co-authored-by: 's avatarClaude <noreply@anthropic.com>
      ee1f9d79
    • Zack Tanner's avatar
      fix allowedDevOrigins for no-cors requests (#91506) · d0a0474d
      Zack Tanner authored
      This PR makes configured `allowedDevOrigins` apply to cross-site no-cors dev asset requests. When browsers omit Origin for subresource loads, the dev guard now falls back to `Referer` so explicit allowlisted hosts can load `/_next/*` resources in development.
      
      Previously, when `allowedDevOrigins` was configured, cross-site no-cors requests to internal Next.js dev resources were still blocked even for allowlisted hosts, because that code path never consulted the allowlist.
      d0a0474d
    • Hendrik Liebau's avatar
    • Tobias Koppers's avatar
      Remove devCacheControlNoCache experimental option (hard-code no-cache) (#91503) · 4494261b
      Tobias Koppers authored
      ### What?
      
      Removes the `experimental.devCacheControlNoCache` config option entirely
      and hard-codes `no-cache, must-revalidate` as the dev server
      `Cache-Control` header value.
      
      Previously the option controlled whether the dev server responded with:
      - `no-store, must-revalidate` (default, `false`)
      - `no-cache, must-revalidate` (opt-in, `true`)
      
      This PR first flips the default to `true`, then removes the option
      altogether — making `no-cache, must-revalidate` unconditional in all dev
      code paths.
      
      ### Why?
      
      `no-cache` is strictly better than `no-store` for the dev server:
      - `no-cache` allows the browser to revalidate (conditional
      `If-None-Match`/`If-Modified-Since` requests), letting the server
      respond with `304 Not Modified` when nothing changed → faster page loads
      during development.
      - `no-store` forces a full re-fetch every time, discarding valid cached
      responses.
      
      Since `no-cache` is the correct behavior for all dev users, the toggle
      has no remaining value and can be removed to simplify the codebase.
      
      ### How?
      
      **Two commits:**
      
      1. `bcec825` — Flip the default from `false` → `true`; update
      tests/fixtures/manifest to reflect the new default.
      
      2. `e6e919f` — Remove the option entirely:
      - Deleted `devCacheControlNoCache?: boolean` from `ExperimentalConfig`
      interface, `config-schema.ts` Zod schema, `defaultConfig`,
      `NextConfigRuntime`, and `getNextConfigRuntime()`.
      - Replaced all four conditional ternaries in `base-server.ts`,
      `router-server.ts`, `pages-handler.ts`, and `app-page.ts` with the
      hard-coded string `'no-cache, must-revalidate'`.
      - Deleted the `dev-cache-control-no-cache-disabled` test suite (was
      testing the `false` path which no longer exists).
      - Simplified the remaining `dev-cache-control-no-cache` test (removed
      experimental framing).
         - Synced `rspack-dev-tests-manifest.json`.
      
      ---------
      Co-authored-by: 's avatarTobias Koppers <sokra@users.noreply.github.com>
      Co-authored-by: 's avatarClaude <noreply@anthropic.com>
      Co-authored-by: 's avatarVercel <vercel[bot]@users.noreply.github.com>
      4494261b
    • Luke Sandberg's avatar
      [turbopack] update qfilter to 0.3.0-alpha (#91467) · 4050a5b0
      Luke Sandberg authored
      ## What?
      
      Update the `qfilter` crate to an alpha version.
      
      ## Why?
      
      Performance improvements in the quotient filter implementation used by turbo-persistence for SST file lookups.
      
      ## Benchmark Results
      
      Benchmarks run on Apple Silicon (M-series), comparing `canary` baseline vs this branch. Focused on qfilter-sensitive paths: the filter itself, SST lookups, uncompacted multi-commit DB reads, and writes.
      
      ### qfilter microbenchmarks (direct filter operations)
      
      | Benchmark | canary | branch | change |
      |---|---|---|---|
      | **Lookup (hit)** | | | |
      | 1Ki entries | 22.10 ns | 14.63 ns | **-33.8%** |
      | 10Ki entries | 22.21 ns | 15.41 ns | **-30.6%** |
      | 100Ki entries | 24.96 ns | 17.47 ns | **-30.0%** |
      | 1000Ki entries | 25.05 ns | 16.61 ns | **-33.7%** |
      | **Lookup (miss)** | | | |
      | 1Ki entries | 12.09 ns | 9.19 ns | **-24.0%** |
      | 10Ki entries | 14.24 ns | 11.07 ns | **-22.3%** |
      | 100Ki entries | 18.13 ns | 13.72 ns | **-24.3%** |
      | 1000Ki entries | 13.36 ns | 10.00 ns | **-25.2%** |
      | **Insert (build filter)** | | | |
      | 1Ki entries | 8.54 us | 9.64 us | +12.9% |
      | 10Ki entries | 118.16 us | 120.97 us | +2.4% |
      | 100Ki entries | 3.18 ms | 2.57 ms | **-19.2%** |
      | 1000Ki entries | 20.88 ms | 18.31 ms | **-12.3%** |
      
      **Summary:** Lookups 22-34% faster across all sizes. Insert is slightly slower at small sizes but 12-19% faster at larger sizes where it matters most.
      
      ### SST file lookup (filter + block read)
      
      | Benchmark | canary | branch | change |
      |---|---|---|---|
      | **Hit (uncached)** | | | |
      | 1Ki entries | 2.52 us | 2.52 us | ~0% |
      | 10Ki entries | 3.60 us | 3.52 us | -2.2% |
      | 100Ki entries | 3.77 us | 3.72 us | -1.3% |
      | 1000Ki entries | 6.65 us | 6.55 us | -1.5% |
      | **Miss (cached)** | | | |
      | 1Ki entries | 124.50 ns | 121.13 ns | -2.7% |
      | 10Ki entries | 168.18 ns | 161.96 ns | **-3.7%** |
      | 100Ki entries | 195.97 ns | 189.80 ns | **-3.1%** |
      | 1000Ki entries | 249.85 ns | 235.68 ns | **-5.7%** |
      
      **Summary:** Small but consistent improvements across SST lookups. Miss/cached shows the clearest gains (filter is the primary code path for rejecting misses).
      
      ### DB-level reads (20 commits, uncompacted -- amplifies filter cost)
      
      | Benchmark | canary | branch | change |
      |---|---|---|---|
      | **10.67Mi entries** | | | |
      | hit/uncached | 3.49 us | 3.13 us | **-10.3%** |
      | hit/cached | 1.65 us | 1.49 us | **-9.7%** |
      | miss/uncached | 899.75 ns | 746.28 ns | **-17.1%** |
      | miss/cached | 793.51 ns | 668.92 ns | **-15.7%** |
      | **85.33Mi entries** | | | |
      | hit/uncached | 11.24 us | 10.64 us | ~0% (noisy) |
      | hit/cached | 4.53 us | 4.10 us | **-9.5%** |
      | miss/uncached | 5.01 us | 4.36 us | **-13.0%** |
      | miss/cached | 4.81 us | 4.02 us | **-16.4%** |
      
      **Summary:** 10-17% faster reads on uncompacted DBs with many SSTs. Miss paths benefit most since the filter rejects without I/O.
      
      ### Write path (includes filter construction)
      
      | Benchmark | canary | branch | change |
      |---|---|---|---|
      | 85.33Ki entries | 24.91 ms | 23.42 ms | -6.0% |
      | 853.33Ki entries | 140.63 ms | 131.84 ms | **-6.3%** |
      | 8.33Mi entries | 1.14 s | 1.07 s | **-6.1%** |
      
      **Summary:** ~6% faster writes across all sizes.
      
      ## How?
      
      Updated the `qfilter` dependency to a new alpha version with improved lookup and insert performance.
      4050a5b0
    • Jiwon Choi's avatar
      Skip catch-error-react-compiler test to unblock CI (#91528) · 6db019c3
      Jiwon Choi authored
      https://github.com/vercel/next.js/actions/runs/23170738194/job/67327462789#step:36:318
      is holding up CI, including release. Cause is not from `catchError` PR,
      it's just that the test has discovered missing support of Next.js for
      Pages + React 17/18 + React compiler. Will work in parallel.
      6db019c3
    • Sebastian "Sebbie" Silbermann's avatar
    • Benjamin Woodruff's avatar
      docs(turbopack): Migrate chunking docs from mdbook, with proof-reading and minor… · 2d44d0dc
      Benjamin Woodruff authored
      docs(turbopack): Migrate chunking docs from mdbook, with proof-reading and minor updates from claude (#91472)
      
      Copied from https://turbopack-rust-docs.vercel.sh/turbopack/chunking.html
      
      I had claude review it for correctness against the code. It found a few things where the names weren't correct or a trait was actually a struct, and it grouped things into sections. It also added some more details to a few sections, like the dev vs production chunking. I think this is a reasonable improvement.
      
      I did a second pass with claude where I had it remove things it 1:1 duplicated with the existing rustdocs, and I had it add intradoc links.
      
      Rendered:
      
      ![Screenshot 2026-03-16 at 14-40-34 turbopack_core _chunking - Rust.png](https://app.graphite.com/user-attachments/assets/1112b010-1d38-4604-b7f9-ec29816565b2.png)
      2d44d0dc
    • Andrew Clark's avatar
      Track vary params during runtime prefetches (#89297) · 568c7029
      Andrew Clark authored
      **Previous:**
      
      1. https://github.com/vercel/next.js/pull/91487
      2. https://github.com/vercel/next.js/pull/91488
      
      **Current:**
      
      3. https://github.com/vercel/next.js/pull/89297
      
      ---
      
      Most of the vary params infrastructure was already implemented in
      previous PRs for static prerenders. This wires up the remaining pieces
      for runtime prefetches — creating the accumulator, setting it on the
      prerender store, and resolving it before abort — and adds additional
      test cases covering empty/full vary sets, searchParams, metadata, and
      per-segment layout/page splits with runtime prefetching.
      568c7029
    • Andrew Clark's avatar
      [Segment Cache] Always upsert on prefetch completion (#91488) · e16f6fb2
      Andrew Clark authored
      **Previous:**
      
      1. https://github.com/vercel/next.js/pull/91487
      
      **Current:**
      
      2. https://github.com/vercel/next.js/pull/91488
      
      **Up next:**
      
      3. https://github.com/vercel/next.js/pull/89297
      
      ---
      
      When a prefetch response includes vary params, the segment cache rekeys
      entries to a more generic path based on which params the segment
      actually depends on. Previously, the rekeying only happened when vary
      params were provided. Now that vary params are tracked for more response
      types (and eventually will always be tracked), entries are rekeyed in
      more cases than before.
      
      This exposed a potential race condition: the scheduler would capture a
      vary path at scheduling time and upsert the entry at that path when the
      fetch completed. But the fetch functions themselves rekey entries to a
      different (more generic) path upon fulfillment. The deferred upsert
      could then move the entry back to the less generic path, undoing the
      rekeying.
      
      To fix this, move the upsert logic inline into the fetch functions that
      fulfill entries, rather than deferring it to an external callback. This
      removes the race condition, simplifies the model, and reduces
      implementation complexity. The previous structure existed to avoid the
      rekeying cost when vary params weren't available, but rekeying is
      inexpensive and not worth the added indirection.
      
      The upsert function itself already handles concurrent writes by
      comparing fetch strategies and checking whether the new entry provides
      more complete data than any existing entry. So it's safe to always call
      it inline — whichever entry wins will be the most complete one.
      e16f6fb2
    • Andrew Clark's avatar
      Buffer prefetch response before passing to Flight client (#91487) · d50bef07
      Andrew Clark authored
      **Current:**
      
      1. https://github.com/vercel/next.js/pull/91487
      
      **Up next:**
      
      2. https://github.com/vercel/next.js/pull/91488
      3. https://github.com/vercel/next.js/pull/89297
      
      ---
      
      Prefetch responses include metadata (in the Flight stream sense, not
      HTML document metadata) that describes properties of the overall
      response — things like the stale time and the set of params that were
      accessed during rendering. Conceptually these are like late HTTP
      headers: information that's only known once the response is complete.
      Since we can't rely on actual HTTP late headers being supported
      everywhere, we encode this metadata in the body of the Flight response.
      
      The mechanism works by including an unresolved thenable in the Flight
      payload, then resolving it just before closing the stream. On the
      client, after the stream is fully received, we unwrap the thenable
      synchronously. This synchronous unwrap relies on the assumption that the
      server resolved the thenable before closing the stream.
      
      The server already buffers prefetch responses before sending them, so
      the resolved thenable data is always present in the response. However,
      HTTP chunking in the browser layer can introduce taskiness when
      processing the response, which could prevent Flight from decoding the
      full payload synchronously. The existing code includes fallback behavior
      for this case (e.g. treating the vary params as unknown), so this
      doesn't fix a semantic issue — it strengthens the guarantee so that the
      fallback path is never reached.
      
      To do this, we buffer the full response on the client and concatenate it
      into a single chunk before passing it to Flight. A single chunk is
      necessary because Flight's `processBinaryChunk` processes all rows
      synchronously within one call. Multiple chunks would not be sufficient
      even if pre-enqueued: the `await` continuation from
      `createFromReadableStream` can interleave between chunks, causing
      promise value rows to be processed after the root model initializes,
      which leaves thenables in a pending state. Since the server already
      buffers these responses and they complete during a prefetch (not during
      a navigation), this is not a performance consideration.
      
      Full (dynamic) prefetches are not affected by this change. These are
      streaming responses — even though they are cached, they are a special
      case where dynamic data is treated as if it were cached. They don't need
      to be buffered on either the server or the client the way normal cached
      responses are.
      d50bef07
    • Hendrik Liebau's avatar
      Error when accessing undefined root params in `generateStaticParams` (#91519) · a46ff7c8
      Hendrik Liebau authored
      Follow-up to #91189 which added support for accessing root params inside
      `generateStaticParams`. Previously, if a `generateStaticParams` function
      tried to read a root param that hasn't been defined yet — either because
      the current segment is supposed to define it, or because a child segment
      defines it — `getRootParam` would silently return `undefined`. This is
      especially problematic because #91019 will type root param getters as
      `Promise<string>` without `undefined`, making this a silent type safety
      violation.
      
      This change makes `getRootParam` throw an explicit error with the
      `generate-static-params` work unit store when the requested param is not
      present in `rootParams`.
      a46ff7c8
    • Niklas Mischkulnig's avatar
      Turbopack: treat unknown CSS selectors as warnings (#91513) · 892f7df0
      Niklas Mischkulnig authored
      In many cases, these are just modern selectors that aren't supported yet.
      892f7df0
    • Niklas Mischkulnig's avatar
      Turbopack: correctly apply effects for issue snapshots (#91511) · 512d7e81
      Niklas Mischkulnig authored
      `snapshot_issues` emits effects when `UPDATE=1`
      512d7e81