1. 26 Feb, 2026 33 commits
    • nextjs-bot's avatar
      v16.2.0-canary.64 · 8f5afa35
      nextjs-bot authored
      8f5afa35
    • Will Binns-Smith's avatar
      Turbopack server hmr: Implement `restart` event (#90550) · dc3b6ede
      Will Binns-Smith authored
      This implements the `restart` event, fully evicting all caches. This is needed for when client manifest changes are made.
      
      Test Plan: CI for https://github.com/vercel/next.js/pull/90389
      dc3b6ede
    • Andrew Imm's avatar
      Pre-warm a single NodeJS instance when the next devserver starts (#90174) · ee885f86
      Andrew Imm authored
      When cold-booting `next dev` on a fresh create-next-app, on the first server hit we need to fetch fonts and compile CSS, which takes up nearly half of the request time.
      
      It shouldn't be necessary to wait until the first server request to launch the first NodeJS process (eventually used for PostCSS processing in Tailwind). Once the server has started, we can anticipate that first request and pre-warm a single Node process.
      
      Because we grab the boot semaphore, if a request comes in as soon as the server is ready, it waits on the semaphore to resolve, and at most it takes as long as it would before this change. In all likelihood, the Node process is ready before any server request comes in.
      
      It also slightly saves time on `next build`
      
      I'd appreciate scrutiny of all the ways this can go wrong.
      ee885f86
    • JJ Kasper's avatar
      Fix edge index page _next/data route (#90611) · 0db78041
      JJ Kasper authored
      Fixes failing assertion with turbopack
      
      Verified against turbopack + adapter deploy test locally
      <img width="2076" height="1336" alt="CleanShot 2026-02-26 at 13 25
      30@2x"
      src="https://github.com/user-attachments/assets/a8c66314-8163-4371-b02a-dc7146989425"
      />
      
      
      x-ref:
      https://github.com/vercel/next.js/pull/90600#issuecomment-3968044160
      0db78041
    • nextjs-bot's avatar
      v16.2.0-canary.63 · b6d47641
      nextjs-bot authored
      b6d47641
    • Luke Sandberg's avatar
      turbo-persistence: drop key compression dictionary from SST files (#90608) · d52877ef
      Luke Sandberg authored
      ## Summary
      
      - Remove the zstd key compression dictionary from SST files, simplifying
      the on-disk format
      - Key blocks now use plain LZ4 compression (same as value blocks),
      eliminating the zstd dependency
      - Update the turbo-persistence README to reflect the format changes
      
      ## Why
      
      The key compression dictionary added complexity (zstd dependency,
      dictionary computation, dual decompression paths) with diminishing
      returns. Plain LZ4 is already used for value blocks and provides
      sufficient compression for key blocks. This simplifies both the SST file
      format and the compaction/inspection tooling.
      
      This main goal is to unblock streaming SST writes.
      
      ## What Changed
      
      **On-disk format (breaking):**
      - SST files no longer start with a serialized key compression dictionary
      - Meta file entries no longer include the
      `key_compression_dictionary_length` field
      
      **Code:**
      - Removed `zstd` dependency from `turbo-persistence`
      - Removed dictionary computation in `StaticSortedFileBuilder`
      - Simplified `sst_inspect` tool (no more dictionary-aware decompression)
      - Removed `key_compression_dictionary_length` from
      `StaticSortedFileMetaData`, `MetaEntry`, and `MetaFileBuilder`
      
      **Docs:**
      - Updated README meta file format (removed dictionary length field)
      - Updated README SST file format (removed dictionary region)
      - Updated compression description to reference LZ4 directly
      
      ## Test Plan
      
      - Existing turbo-persistence tests and benchmarks pass with the format
      changes
      - `sst_inspect` tool updated to work without dictionary logic
      
      ---------
      Co-authored-by: 's avatarTobias Koppers <tobias.koppers@googlemail.com>
      d52877ef
    • Jiwon Choi's avatar
      Add `unstable_retry()` to error.js (#89685) · 9d13b676
      Jiwon Choi authored
      Extends the error components API to give better control over recovery.
      Previously, the `reset()` prop only cleared the error state and
      re-rendered the children. However, this only handles a temporary
      rendering error.
      
      The error can be due to data fetching or an RSC phase. In these cases,
      `reset()` alone is not sufficient. Users would even need to implement
      retry logic using `router.refresh()`.
      
      Therefore, this PR adds a new `unstable_retry()` prop that calls
      `router.refresh()` and `reset()` within a `startTransition()` to provide
      built-in retry logic. This feature is expected to be preferred over the
      `reset()` prop. Only the cases where you'd choose `reset()` are when you
      have a reason to do a sync reset without loading any new data.
      
      Closes NAR-767
      9d13b676
    • Hendrik Liebau's avatar
      Fix per-segment prefetching for initial loads with Cache Components (#90610) · 2ba73b7a
      Hendrik Liebau authored
      The `S` field in the RSC payload was only set to `true` during static
      generation, but the client used it to determine whether a route supports
      per-segment prefetching (`isPPREnabled` on the route cache entry). For
      partially static pages with Cache Components enabled, the initial HTML
      is served via PPR resume, which generates the RSC payload at request
      time with `isStaticGeneration` set to `false`. This caused `S` to be
      `false` even though the route fully supports per-segment prefetching.
      
      This caused the prefetch scheduler to fall back to the `LoadingBoundary`
      fetch strategy instead of `PPR`, which skipped fetching
      `_head.segment.rsc` and instead sent a `metadata-only` dynamic request.
      That request returned a 404 locally (harmless) but a 200 with an empty
      body on Vercel, which interfered with same-page navigation refreshes
      introduced in #76223 and exposed by the route cache keying fix in
      #90400.
      
      To fix this, `S` is now also set to `true` when `cacheComponents` is
      enabled, since all Cache Components routes support per-segment
      prefetching. When Cache Components is disabled, `S` continues to rely
      solely on `isStaticGeneration`, which is correct because fully static
      pages always have both their RSC payload and per-segment prefetch
      responses generated at build time.
      
      This PR also renames `isPPREnabled` to `supportsPerSegmentPrefetching`
      on the client and updates the `S` field comments in the RSC payload
      types to better reflect the field's actual meaning.
      2ba73b7a
    • Jiwon Choi's avatar
      Allow `reset()` from user's global-error (#89684) · 10725f84
      Jiwon Choi authored
      User's `global-error.js` is within the router. There's no reason it
      shouldn't have access to the options available to the `error.js`
      component. It was already available on prod. This PR syncs dev behavior
      to prod.
      
      For the follow-up feature, `retry()` will also be available in
      `global-error.js`.
      
      ---------
      Co-authored-by: 's avatarvercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
      10725f84
    • Sebastian "Sebbie" Silbermann's avatar
    • Sebastian "Sebbie" Silbermann's avatar
    • Hendrik Liebau's avatar
      [ci] Use `NEXT_TEST_CI` instead of `CI` for e2e test retry guard (#90606) · 420560d0
      Hendrik Liebau authored
      `run-tests.js` explicitly unsets `CI` in the spawned Jest child process
      and preserves the original value as `NEXT_TEST_CI`. Since
      `test/lib/e2e-utils/index.ts` runs inside that child process,
      `process.env.CI` is always empty, making the `jest.retryTimes(1)` call
      effectively dead code in CI.
      420560d0
    • Tobias Koppers's avatar
      Turbopack: Add Next.js version to "initialize project" trace span (#90545) · 891cfe69
      Tobias Koppers authored
      ## Summary
      
      Adds the Next.js version as a `version` field on the Turbopack
      "initialize project" tracing span. The version is passed from the
      TypeScript side (`process.env.__NEXT_VERSION`) through the NAPI bindings
      into Rust `ProjectOptions`, where it is recorded on the span.
      
      This makes it easy to correlate trace data with the specific Next.js
      version that produced it.
      
      Also standardizes all version reads in `packages/next/src/` to use
      `process.env.__NEXT_VERSION` (which is inlined at build time by
      `taskfile-swc.js`) instead of `require('next/package.json').version` or
      `import { version } from 'next/package.json'`.
      
      ### Changes
      
      **Trace span (commit 1):**
      - **`crates/next-api/src/project.rs`** — Added `next_version` field to
      `ProjectOptions`; recorded as `version` on the `"initialize project"`
      span
      - **`crates/next-napi-bindings/src/next_api/project.rs`** — Added
      `next_version` to `NapiProjectOptions` and wired it through the `From`
      impl
      - **`crates/next-build-test/src/main.rs`** — Added `next_version` to
      test `ProjectOptions` init
      - **`packages/next/src/build/swc/generated-native.d.ts`** — Added
      `nextVersion` to the TypeScript `NapiProjectOptions` interface
      - **`packages/next/src/server/dev/hot-reloader-turbopack.ts`**,
      **`packages/next/src/build/turbopack-build/impl.ts`**,
      **`packages/next/src/build/turbopack-analyze/index.ts`** — Pass
      `nextVersion: process.env.__NEXT_VERSION` when creating the Turbopack
      project
      - **`test/development/basic/next-rs-api.test.ts`** — Added `nextVersion`
      to both `createProject` call sites
      
      **Consistent `__NEXT_VERSION` usage (commit 2):**
      - **`packages/next/src/server/dev/hot-reloader-shared-utils.ts`** —
      `require('next/package.json').version` → `process.env.__NEXT_VERSION`
      - **`packages/next/src/lib/patch-incorrect-lockfile.ts`** —
      `nextPkgJson.version` → `process.env.__NEXT_VERSION`; narrowed import to
      only `optionalDependencies`
      - **`packages/next/src/telemetry/events/swc-load-failure.ts`** — `import
      { version as nextVersion }` → `process.env.__NEXT_VERSION`; narrowed
      import to only `optionalDependencies`
      
      ## Test Plan
      
      - Verified Rust compilation with `cargo check -p next-api`, `cargo check
      -p next-build-test`
      - Verified TypeScript types with `pnpm --filter=next types`
      
      ---------
      Co-authored-by: 's avatarClaude <noreply@anthropic.com>
      891cfe69
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#90565) · 26a38229
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      26a38229
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#90566) · 4079c804
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      4079c804
    • nextjs-bot's avatar
    • Niklas Mischkulnig's avatar
      test: remove stray TURBOPACK_BUILD=1 (#90602) · 91ab5709
      Niklas Mischkulnig authored
      Forgot to remove this in https://github.com/vercel/next.js/pull/83335
      
      This env var might filter some tests that should actually run (Webpack doesn't set it at all)
      91ab5709
    • Niklas Mischkulnig's avatar
      Turbopack: use xxhash3_128 for content hashes (#90583) · d1601a14
      Niklas Mischkulnig authored
      Move to 128 bit hashes, so that we can include the untruncated hashes in the manifest in #88607
      
      If anything, this is faster, surprisingly:
      
      ```
      upgrade twox-hash 448a36b449
          pnpm next build --experimental-build-mode=compile  430.13s user, 73.72s system, 724% cpu, 1:09.53 total
          pnpm next build --experimental-build-mode=compile  430.05s user, 82.51s system, 736% cpu, 1:09.56 total
          pnpm next build --experimental-build-mode=compile  419.95s user, 89.50s system, 697% cpu, 1:13.03 total
          pnpm next build --experimental-build-mode=compile  425.95s user, 75.87s system, 748% cpu, 1:07.00 total
      
      use Xxh3Hash128Hex for content hashes ffd6a87f09
          pnpm next build --experimental-build-mode=compile  397.42s user, 53.18s system, 670% cpu, 1:07.25 total
          pnpm next build --experimental-build-mode=compile  416.68s user, 66.32s system, 762% cpu, 1:03.32 total
          pnpm next build --experimental-build-mode=compile  412.63s user, 68.30s system, 774% cpu, 1:02.12 total
          pnpm next build --experimental-build-mode=compile  419.09s user, 68.57s system, 756% cpu, 1:04.50 total
      ```
      
      
      https://github.com/Cyan4973/xxHash says:
      | Hash Name     | Width | Bandwidth (GB/s) | Small Data Velocity | Quality | Comment |
      | ---------     | ----- | ---------------- | ----- | --- | --- |
      | __XXH3__ (SSE2) |  64 | 31.5 GB/s        | 133.1 | 10
      | __XXH128__ (SSE2) | 128 | 29.6 GB/s      | 118.1 | 10
      | __XXH64__     |    64 | 19.4 GB/s        |  71.0 | 10
      | __XXH32__     |    32 |  9.7 GB/s        |  71.9 | 10
      d1601a14
    • Niklas Mischkulnig's avatar
      Less dynamic pages manifest path (#90581) · 17033ca9
      Niklas Mischkulnig authored
      _Two steps forward, one step back_
      
      Reverts https://github.com/vercel/next.js/pull/88641 and https://github.com/vercel/next.js/pull/88806
      
      I ended up having to keep the build id in `_next/data` routes anyway (and made the id a constant if skew protection is enabled). This was because it was utterly impossible to change the routes from `_next/data/:buildId/*` to `_next/data/*` in the builder in a backwards-compatible way.
      
      So there is no need to remove the build id from `_next/static` here either. It just makes testing a huge pain because the paths keep changing
      17033ca9
    • Joseph's avatar
      feat: Join guides and frame around UI preservation (#90595) · 05b06903
      Joseph authored
      As we discussed, let's scale back how much Activity we teach and focus
      on UI preservation, choice of pattern, and wrap it all with a demo where
      these are implemented.
      
      - [x] rename file
      
      ---------
      Co-authored-by: 's avatarVercel <vercel[bot]@users.noreply.github.com>
      05b06903
    • Sebastian "Sebbie" Silbermann's avatar
    • Sebastian "Sebbie" Silbermann's avatar
    • Niklas Mischkulnig's avatar
      Turbopack: add Xxh3Hash128Hasher (#90584) · cf710377
      Niklas Mischkulnig authored
      - turbo-persistence used XxHash64, which is supposed to be slower than XxHash3_64
      - refactor debug_id computation to just use `rope.content_hash()` which was added in the meantime
      - update and adjust feature flags of `twox_hash`
      
      https://github.com/Cyan4973/xxHash says:
      | Hash Name     | Width | Bandwidth (GB/s) | Small Data Velocity | Quality | Comment |
      | ---------     | ----- | ---------------- | ----- | --- | --- |
      | __XXH3__ (SSE2) |  64 | 31.5 GB/s        | 133.1 | 10
      | __XXH128__ (SSE2) | 128 | 29.6 GB/s      | 118.1 | 10
      | __XXH64__     |    64 | 19.4 GB/s        |  71.0 | 10
      | __XXH32__     |    32 |  9.7 GB/s        |  71.9 | 10
      cf710377
    • Tobias Koppers's avatar
      Turbopack: Add TransientEnvMap to avoid persisting env vars in cache (#90526) · 2307bf6e
      Tobias Koppers authored
      ### What?
      
      Introduces a new `TransientEnvMap` type and changes `ProcessEnv::read_all()` to return `Vc<TransientEnvMap>` instead of `Vc<EnvMap>`.
      
      ### Why?
      
      `EnvMap` uses default (auto) serialization, which means all process environment variables — including secrets like API keys and tokens — could be written to the persistent disk cache. `TransientEnvMap` uses `serialization = "none"`, ensuring env vars are never persisted and must always be read fresh from the process environment on cache restore.
      
      ### How?
      
      - Added `TransientEnvMap` in `turbo-tasks-env/src/lib.rs`: a transparent wrapper around `FxIndexMap<RcStr, RcStr>` with `serialization = "none"`
      - Changed `ProcessEnv::read_all()` trait method return type from `Vc<EnvMap>` → `Vc<TransientEnvMap>`
      - Updated all 7 implementations of `ProcessEnv::read_all()` (`EnvMap`, `CommandLineProcessEnv`, `CustomProcessEnv`, `FilterProcessEnv`, `DotenvProcessEnv`, `TryDotenvProcessEnv`, `EmbeddableProcessEnv`)
      - Updated helper functions (`case_insensitive_read`, `to_uppercase_map`, `common_node_env`) to work with `TransientEnvMap`
      - `EnvMap` (serializable) is kept for config-derived env maps like `next.config.js` env and `edge_env`
      2307bf6e
    • Kristiyan Velkov's avatar
      docs: add Docker Standalone and Docker Export examples to Deploying page (#90386) · ae79ae55
      Kristiyan Velkov authored
      ### What?
      
      Updates the
      [Deploying](https://nextjs.org/docs/app/getting-started/deploying) page
      Docker section to document the new and updated Docker examples and add
      description to old ones.
      
      ### Why?
      
      The Docker examples were added/updated in
      [#87069](https://github.com/vercel/next.js/pull/87069). The Deploying
      page still only listed the generic "Docker" and "Docker
      Multi-Environment" templates, so the new **Docker Standalone** and
      **Docker Export** examples were not discoverable from the docs.
      
      ### How?
      
      - Add **Docker Standalone** template linking to `examples/with-docker`
      (`output: "standalone"` for minimal container images).
      - Add **Docker Export** template linking to
      `examples/with-docker-export-output` (`output: "export"` for static HTML
      in a container).
      - Order templates as: Docker Standalone, Docker Export, then Docker
      Multi-Environment.
      
      ---
      
      **Related:** This PR follows up on the merged [PR
      #87069](https://github.com/vercel/next.js/pull/87069) (Docker examples
      for standalone and export output). It updates the docs so the Deploying
      page links to those examples.
      
      ---------
      Co-authored-by: 's avatarWyatt Johnson <accounts+github@wyattjoh.ca>
      Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      Co-authored-by: 's avatarkristiyan.velkov <kristiyan.velkov@ffw.com>
      Co-authored-by: 's avatarCursor <cursoragent@cursor.com>
      ae79ae55
    • Niklas Mischkulnig's avatar
      Don't require collect-build-traces with Turbopack (#90586) · 7d7d1fa5
      Niklas Mischkulnig authored
      So that we don't require `next/dist/compiled/@vercel/nft` or `next/dist/compiled/webpack/webpack` when using Turbopack
      7d7d1fa5
    • Sebastian "Sebbie" Silbermann's avatar
    • Jiwon Choi's avatar
      Replace `testonly` to `testheadless` in AGENTS.md (#90578) · de03508d
      Jiwon Choi authored
      I don't want agents to open up browsers for testing.
      
      <img width="1674" height="356" alt="CleanShot 2026-02-26 at 11 02 54@2x"
      src="https://github.com/user-attachments/assets/b71f1d57-6329-44aa-b663-cc876210f0d7"
      />
      de03508d
    • Sebastian "Sebbie" Silbermann's avatar
    • Sebastian "Sebbie" Silbermann's avatar
    • Sebastian "Sebbie" Silbermann's avatar
    • Tobias Koppers's avatar
      Replace mark_root() with #[turbo_tasks::function(root)] flag (#90512) · cd6a9bc7
      Tobias Koppers authored
      ## Summary
      
      Replaces the runtime `mark_root()` call with a declarative `root` flag
      on the `#[turbo_tasks::function]` attribute macro. This moves root task
      aggregation number assignment from an imperative runtime call to a
      compile-time declaration, making the intent clearer and applying the
      aggregation number at task creation time rather than during execution.
      
      ### What changed
      
      - **Macro parsing**: Added `root` as a new flag option for
      `#[turbo_tasks::function(root)]` (can be combined with other flags, e.g.
      `#[turbo_tasks::function(operation, root)]`)
      - **NativeFunction**: Added `is_root: bool` field and parameter to all
      three constructors (`new_function`, `new_method`,
      `new_method_without_this`)
      - **Backend**: In `get_or_create_persistent_task` and
      `get_or_create_transient_task`, checks `native_fn.is_root` on brand-new
      task creation (not cache hits or backing storage restores) and sets
      `UpdateAggregationNumber` with `u32::MAX`
      - **Usage site**: Changed `whole_app_module_graph_operation` in
      `crates/next-api/src/project.rs` from
      `#[turbo_tasks::function(operation)]` + `mark_root()` to
      `#[turbo_tasks::function(operation, root)]`
      - **Cleanup**: Removed `mark_root()`, `set_own_task_aggregation_number`
      from `TurboTasksApi` trait, `Backend` trait, and all implementations
      (turbo-tasks-backend, turbo-tasks-testing)
      
      ### Key design decisions
      
      - Root aggregation number is only set on **brand-new task creation**
      (Vacant entry in the task cache when not found in backing storage
      either), not on cache hits or when restoring from backing storage
      - The `root` flag is stored on `NativeFunction` (which is a static
      singleton per function), so it's accessible via
      `CachedTaskType.native_fn.is_root` in the backend without any additional
      runtime overhead
      
      ## Test Plan
      
      - `cargo check -p turbo-tasks-macros -p turbo-tasks -p
      turbo-tasks-backend -p next-api` passes
      - `cargo test -p turbo-tasks-backend` passes
      - `pnpm swc-build-native` builds successfully
      cd6a9bc7
    • Andrew Imm's avatar
      Turbopack: add webpack loader names to traces (#87230) · 34647db2
      Andrew Imm authored
      When examining the long trace this morning, it wasn't immediately clear
      what was running in the shell-out to Node.
      This doesn't fully fix the issue, but it makes it clearer which webpack
      loader is running, similar to how the PostCSS loader lists the name of
      the css file it's parsing.
      
      In this trace, the next config contains:
      ```
        turbopack: {
          rules: {
            "**/*.{js,jsx,ts,tsx}": {
              loaders: ["./loader_test.js"],
            },
          },
        },
      ```
      
      And the trace renders as:
      
      <img width="995" height="553" alt="Screenshot 2025-12-15 at 11 22 39 PM"
      src="https://github.com/user-attachments/assets/b0936e2e-f9d5-45fc-8a1c-2f98b1aa38b6"
      />
      34647db2
  2. 25 Feb, 2026 7 commits
    • Andrew Clark's avatar
      Remove revalidation settling period from router-act (#90531) · 299e1ff3
      Andrew Clark authored
      The 500ms settling period in router-act's `act()` polled for 500ms after
      the request queue emptied before exiting. This was added to accommodate
      the 300ms revalidation cooldown in the client router — after a server
      action calls `revalidatePath`/`revalidateTag`, the client delays
      re-prefetching for 300ms. The settling period ensured `act()` waited
      long enough to catch the resulting re-prefetch.
      
      The settling period applied to every `act()` call, not just ones
      involving revalidation, adding ~500ms per call across 28 test files.
      Remove it entirely and instead use Playwright's fake clock
      (`page.clock.install` / `page.clock.fastForward`) in the revalidation
      tests to deterministically control the cooldown. This is both faster and
      architecturally cleaner — the test utility no longer embeds knowledge of
      a specific client-side timer.
      299e1ff3
    • nextjs-bot's avatar
      v16.2.0-canary.62 · e046f052
      nextjs-bot authored
      e046f052
    • Benjamin Woodruff's avatar
      Turbopack: Move turbopack out of `pnpm build` and into a `pnpm build-all` command (#90543) · ef970c06
      Benjamin Woodruff authored
      #89819 has been causing a lot of pain for me, because I often have already compiled a version of Turbopack, usually with a custom profile or set of flags, and then I want to just compile the JS bits, but there's no way for me to do it without also recompiling Turbopack again, because the `maybe-build-native` doesn't understand my custom-built binary.
      
      This reverts the behavior of `pnpm build`, but adds a `pnpm build-all` command for people who want this automatic compilation behavior (e.g. agents?).
      ef970c06
    • Jiwon Choi's avatar
      Throw when `unstable_instant` is used in Client Component (#90396) · 46761a32
      Jiwon Choi authored
      The `unstable_instant` route segment config is not allowed in Client
      Components because the API mainly depends on prefetches, which Client
      Components aren't part of.
      
      Closes NAR-774
      
      ---------
      Co-authored-by: 's avatarvercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
      46761a32
    • Niklas Mischkulnig's avatar
      Bump Turborepo to 2.8.11 (#90530) · 14ac25b9
      Niklas Mischkulnig authored
      <!-- Thanks for opening a PR! Your contribution is much appreciated.
      To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
      Choose the right checklist for the change(s) that you're making:
      
      ## For Contributors
      
      ### Improving Documentation
      
      - Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
      - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide
      
      ### Fixing a bug
      
      - Related issues linked using `fixes #number`
      - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
      - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md
      
      ### Adding a feature
      
      - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
      - Related issues/discussions are linked using `fixes #number`
      - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
      - Documentation added
      - Telemetry added. In case of a feature if it's used or not.
      - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md
      
      
      ## For Maintainers
      
      - Minimal description (aim for explaining to someone not on the team to understand the PR)
      - When linking to a Slack thread, you might want to share details of the conclusion
      - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
      - Add review comments if necessary to explain to the reviewer the logic behind a change
      
      ### What?
      
      ### Why?
      
      ### How?
      
      Closes NEXT-
      Fixes #
      
      -->
      14ac25b9
    • Hendrik Liebau's avatar
      Cached Navigations: Serve cached segments instantly on repeat visits (#90223) · e2ef94e2
      Hendrik Liebau authored
      When navigating to a dynamic (or partially static) page with Cache Components, the server now uses staged rendering to separate the static portion (backed by the Resume Data Cache) from the dynamic portion (runtime APIs like `cookies`, `headers`, `connection`, or uncached I/O). The static stage byte length is embedded in the RSC payload so the client can extract it.
      
      On the client, the first navigation clones the response stream, truncates it to the static stage byte length, decodes it as a partial Flight response, and writes the result into the segment cache. Subsequent navigations find these cached segments and display them instantly while fetching only the dynamic data from the server.
      
      Server-side changes:
      - Add `generateStagedDynamicFlightRenderResult` with `StaleTimeIterable`, byte counting via tee'd stream, and stage-separated rendering
      - Enable `asyncApiPromises` checks in production for `cookies`, `headers`, `connection`, `searchParams`, and `params`
      - Propagate stale time to `RequestStore` for Cache Components
      - Thread `fallbackParams` from prerender manifest to production renders
      - Rename `devFallbackParams` → `fallbackParams` (now used in both dev/prod)
      
      Client-side changes:
      - Clone response in `fetchServerResponse`, truncate to static byte length, decode with `allowPartialStream`
      - Write static stage into segment cache via `writeStaticStageResponseIntoCache`
      - Use `getFulfilledRouteVaryPath` in `writeRouteIntoCache` for `Fallback` keying
      - Refactor `writeDynamicRenderResponseIntoCache` (remove dead `task` param, accept `headers` directly)
      
      In follow-ups we'll also handle fully static pages, as well as extracting static segment data from the initial load.
      e2ef94e2
    • Andrew Clark's avatar
      Fix: server-patch retry preserves push/replace intent of suspended transitions (#90533) · 5f6aa1cb
      Andrew Clark authored
      When a navigation triggers a server-patch retry (due to a route tree
      mismatch), the retry was unconditionally using navigateType='replace'.
      This assumed the original navigation had already committed to the
      browser history. But if the original transition was still suspended,
      pushState never ran, so replaceState overwrote the initial history entry
      instead of creating a new one, breaking the back button.
      
      The fix tracks the last committed router tree. When a server-patch retry
      fires, it checks whether the original navigation has committed. If not,
      it inherits the original transition's push/replace intent instead of
      forcing 'replace'. This works because React entangles the retry with the
      original pending transition — they commit together.
      
      Fixes #90513
      5f6aa1cb