1. 09 Oct, 2026 31 commits
    • next-js-bot[bot]'s avatar
      v16.5.0-canary.7 · 5a92748e
      next-js-bot[bot] authored
      5a92748e
    • Jiwon Choi's avatar
      Add CI for upgrade evals with shared preparation (#99908) · 12f20769
      Jiwon Choi authored
      Stacked on #99880.
      
      ### Why?
      
      Upgrade evals need CI feedback with reusable preparation and failure
      evidence that reviewers can read directly in the job log.
      
      ### How?
      
      - Run all twelve Codex/Claude trials in parallel through `pnpm
      eval:upgrade --all` on relevant same-repository PR changes and manual
      dispatch. Check out the exact PR head to evaluate the reviewed
      candidate.
      - Prepare candidate packages once per batch. Reuse pnpm/Turbo caches and
      expiring credential-free Sandbox tooling snapshots, then share app
      preparation between agent forks. Save replacement snapshot IDs even
      after a cache hit or eval failure.
      - Use repository credentials to pull the existing Vercel project's OIDC
      token. Run a pinned Vercel CLI only for authentication, without a root
      CLI dependency or GitHub deployment record.
      - Fail CI for failed or invalid trials and retain transcripts, delivered
      apps and grading evidence for 14 days. Print brief case results, then
      collect failed/invalid verdicts and redacted native case logs at the end
      with workflow-command parsing disabled.
      
      <!-- NEXT_JS_LLM -->
      12f20769
    • Jiwon Choi's avatar
      Rebuild upgrade evals around delivered apps (#99880) · c77c7e10
      Jiwon Choi authored
      ### Why?
      
      Upgrade evals need to verify the app an agent delivers and whether it
      communicates security/latest notices correctly.
      
      ### How?
      
      - Run six cases with Codex and Claude: same-major and cross-major
      upgrades for security and latest, plus one nudge per policy. Exercise
      the built candidate against frozen upstream metadata.
      - Capture committed, dirty and untracked changes from delivered
      worktrees. Require successful candidate invocation and verify manifests,
      lockfiles, installed versions, TypeScript, build and HTTP/browser
      behavior in a clean Sandbox.
      - Require nudge emission and a policy-specific notification or question
      about proceeding in the final response. Fail any user-facing
      prompt-injection discussion or language discrediting Next.js or its
      nudge. Require completed boolean judge verdicts and distinguish failed
      checks from invalid execution or grading evidence.
      - Reuse the existing agent-eval runner and tools. Patch its lifecycle
      for delivery/judge evidence and shared fixture preparation; stop the
      preparation VM when its last consumer cancels and delete snapshots that
      arrive after cancellation.
      - Remove obsolete Future cases and duplicate fixtures/helpers. Generate
      starting-app lockfiles during setup and share credential-free tooling
      and app preparation.
      
      <!-- NEXT_JS_LLM -->
      c77c7e10
    • Benjamin Woodruff ‮'s avatar
      Upgrade Corepack to 0.34.7 (#99959) · c8924e36
      Benjamin Woodruff authored
      Needs a version bump for pnpm 12. We obviously can't apply the pnpm
      lockfile to the corepack install, but pinning the version here should be
      sufficient as corepack is zero-dependency (and makes a big deal about
      that). We're using 0.34.7 because newer versions drop Node 20 support.
      c8924e36
    • Benjamin Woodruff ‮'s avatar
      Upgrade Turborepo to 2.11.7 (#99958) · 25f37045
      Benjamin Woodruff authored
      Older versions of Turborepo don't know how to parse pnpm 12's lockfile
      format.
      25f37045
    • Benjamin Woodruff ‮'s avatar
      Normalize pnpm store cache keys (#99957) · 73dacb60
      Benjamin Woodruff authored
      We didn't include OS and architecture in our pnpm cache keys, which
      could often cause us to have to redownload cached packages during
      install (e.g. cache populated on x86-64, but read on arm64).
      
      I asked codex about the naming disparity between these jobs:
      
      > this was historical drift, not two different store types.
      >
      > - [\#93508
      (https://github.com/vercel/next.js/pull/93508)](<https://github.com/vercel/next.js/pull/93508>)
      introduced `pnpm-store-root-v1-*` on May 5. Jobs that skipped `pnpm
      install` had saved incomplete stores—about **14 MB instead of 440 MB**.
      The PR aligned the cache/install conditions and changed the key to
      invalidate those caches. “root” means a complete repository-root
      install.
      > - [\#93411
      (https://github.com/vercel/next.js/pull/93411)](<https://github.com/vercel/next.js/pull/93411>)
      merged four days later, adding caching to `fetch-test-timings` with the
      old `pnpm-store-v2-*` key. Its comment intended to match the reusable
      workflow, but the key was already outdated.
      >
      > Both cache `pnpm store path` after a root install. Unifying them is
      appropriate; our branch now consistently uses `pnpm-store-root-v2-*`.
      73dacb60
    • Tobias Koppers's avatar
      test: cover Pages Router _app availability in Turbopack dev (#99789) (#99910) · 1e1f9e69
      Tobias Koppers authored
      ### What?
      
      Regression coverage for #99789, stacked on #98823.
      
      This is PR 2 of a six-PR stack, based on `canary`:
      
      1. #98823 — Pages Router dev client graph chaining
      2. **This PR** — regression test for Pages Router `_app` availability
      (#99789)
      3. #98734 — use graph-derived merged groups
      4. #99750 — chunking takes a `ChunkGroupKey`
      5. #98685 — chunk-group availability bitmaps
      6. #99050 — keyed chunk-group index lookups
      
      - **New e2e suite** `test/e2e/pages-app-availability-boundary`: a Pages
      Router app with the import shape from #99789:
      - `_app` imports `c-shared` and dynamically imports a module that also
      imports it.
      - `pages/index` imports `a-page-only`, `b-boundary`, `c-shared`,
      `d-boundary`, `e-page`, and dynamically imports a module that imports
      `b`/`d`, which makes `b` and `d` batching boundaries.
      
      The test asserts that the page hydrates (a marker set in `useEffect`),
      that every imported value renders, and that no "module factory is not
      available" error is logged.
      - **`app-document-import-order`**: the "loads modules shared by _app and
      the page only once" assertion added in #97664 was skipped in all of dev.
      It now runs everywhere and is gated `// @gate !(turbopack && dev)`
      (expected failure).
      
      ### Why?
      
      In Turbopack dev, #97664 seeds each page's client chunk group with
      `/_app`'s availability. But each page had its own module graph, so
      availability items (`ModuleOrBatch` identities) were compared across
      graphs. In the page graph, batching can produce a
      `ModuleOrBatch::Module(c-shared)` node whose edges point at earlier
      siblings (`a`, `b`). Because `/_app` already has `Module(c-shared)`, the
      traversal excluded that subtree, and `a`/`b` were never chunked.
      Hydration then fails with `Module [project]/lib/a-page-only.js … was
      instantiated … but the module factory is not available`. No test covered
      this, because the #97664 test was skipped in dev.
      
      #98823 chains `/_app` and the page into one dev client module graph,
      which fixes the missing modules.
      
      It does **not** yet dedupe the `app-document-import-order` fixture in
      Turbopack dev. The shared module is still emitted in both the `_app` and
      the page chunk, because the page's batches in the combined graph carry
      different chunk-group bitmaps than `_app`'s own graph, so they don't
      match `_app`'s availability items. Hence the gate. It stays valid
      through #98734 and #99750; #98685 (higher in this stack) dedupes the
      fixture in Turbopack dev, turning it into a "stale gate", and removes
      it.
      
      ### How was it verified?
      
      Local JS build of this branch plus the preview native binaries of
      #98823's head (`8dd759a`) and its base (`26fd598`) in
      `packages/next-swc/native`. The two commits differ only in Rust.
      
      | Suite | Mode | #98823 base | #98823 head |
      |---|---|---|---|
      | `pages-app-availability-boundary` | Turbopack dev | ❌ module factory
      not available | ✅ |
      | `pages-app-availability-boundary` | Turbopack start, webpack dev/start
      | | ✅ |
      | `app-document-import-order` | Turbopack dev | | ✅ (gated: failed as
      expected) |
      | `app-document-import-order` | webpack dev, Turbopack/webpack start | |
      ✅ |
      
      After restacking onto canary, with native builds of each layer, in
      Turbopack dev:
      
      - This PR's tree: `pages-app-availability-boundary` ✅,
      `app-document-import-order` ✅ (gated: failed as expected).
      - #98734 and #99750: gated assertion still fails as expected.
      - #98685 and #99050: gate stale, so #98685 removes it; ungated, both
      suites ✅.
      
      Fixes #99789 (together with #98823)
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet a7614af3-e186-4297-beaf-7e55eaddc0da -->
      
      
      <!-- fleet 4f67c6f7-bbe2-454b-9a17-822a60ef8f7e -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
      1e1f9e69
    • Tobias Koppers's avatar
      Turbopack: chain the Pages Router development client module graph (#98823) · 6dd4b27b
      Tobias Koppers authored
      ### What?
      
      Chains the Pages Router **development** client module graph so that
      `/_app` and the page being chunked live in the same `ModuleGraph`.
      
      This is PR 1 of a six-PR stack, based on `canary` (#98733, #99686 and
      #99749 are already merged):
      
      1. **This PR** — Pages Router dev client graph chaining
      2. #99910 — regression test for Pages Router `_app` availability
      (#99789)
      3. #98734 — use graph-derived merged groups
      4. #99750 — chunking takes a `ChunkGroupKey`
      5. #98685 — chunk-group availability bitmaps
      6. #99050 — keyed chunk-group index lookups
      
      ### Why?
      
      In development `Project::per_page_module_graph()` is true, so every page
      endpoint builds its own client `ModuleGraph`, each with its own
      `ChunkGroupInfo` and its own index space starting at `0`.
      
      `/_app` is always loaded before the page in the browser, so the page
      reuses `/_app`'s availability when chunking. Today that availability is
      a set of concrete modules, which is graph-independent, so the split
      graphs go unnoticed.
      
      That stops being true as soon as availability is expressed as
      chunk-group indices (#98685): `/_app` would record index `0` in *its*
      graph, and the page would resolve that same `0` against *its own* graph
      — where it means the page's own entry group. Every module of the group
      being chunked then looks already-available and is dropped, producing
      runtime errors like:
      
      ```
      Module [hmr-entry]/hmr-entry.js { ENTRY => "[project]/pages/_error" }
        was instantiated as a runtime entry of chunk …,
        but the module factory is not available.
      ```
      
      ### How?
      
      - `PageEndpoint::client_module_graph` builds a graph *chain* in per-page
      mode: `/_app`'s entry group first, then the page's, with
      `VisitedModules` threaded between them — the same layout-segment
      approach `ssr_module_graph` already uses for document → app → page.
      - Whole-app mode (production) is unchanged and still goes through
      `module_graph_for_modules`.
      - `/_app` itself is not chained onto anything.
      - Extracts a small `client_entry_modules` helper, since the entry module
      list is now needed in two places.
      
      Availability is still carried as the set of modules `/_app` emitted.
      Making the two endpoints share one graph also fixes #99789: with
      separate graphs, batching in the page graph could produce a node for a
      module shared with `/_app` whose edges point at page-only modules, and
      those modules were skipped as already available ("module factory is not
      available" on hydration). #99910 adds the regression test. Lining up the
      graph identities is also what #98685 builds on.
      
      ### Verification
      
      - `turbopack-core` — 160 passed
      - `next-core` — 84 passed
      - Turbopack snapshots — 125 passed
      - `404-page-router` and `server-navigation-error` development suites
      - Affected Cargo checks and Rust formatting
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4f67c6f7-bbe2-454b-9a17-822a60ef8f7e -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      6dd4b27b
    • Luke Sandberg's avatar
      turbopack: report an actionable error when Node.js child processes cannot connect (#99887) · 7d525155
      Luke Sandberg authored
      ## What
      
      Improve the error message reported when a Node.js worker process fails
      to connect to turbopack. Use a dedicated exit code to signal this.
      
      ## Why
      
      Tools like codex like to launch next in a sandbox with limited
      permissions. We cannot really support this but we can report more
      actionable error messages. The current error is awful:
      
      ```
      FATAL: An unexpected Turbopack error occurred:
      Failed to write app endpoint /page
      
      Caused by:
      - [project]/test/tmp/next-test-1791478247265-510/app/globals.css [app-client] (css)
      - creating new process
      - node process exited before we could connect to it with exit status: 0
      
      Debug info:
      - Execution of get_all_written_entrypoints_with_issues_operation failed
      - Execution of EntrypointsOperation::new failed
      - Execution of all_entrypoints_write_to_disk_operation failed
      - Execution of output_assets_operation failed
      - Execution of <AppEndpoint as Endpoint>::output failed
      - Failed to write app endpoint /page
      - Execution of AppEndpoint::output failed
      - Execution of whole_app_module_graph_operation failed
      - Execution of *Project::get_all_additional_entries failed
      - Execution of ModuleGraph::from_graphs failed
      - Execution of ModuleGraph::from_graphs_inner failed
      - Execution of SingleModuleGraph::new_with_entries failed
      - [project]/test/tmp/next-test-1791478247265-510/app/globals.css [app-client] (css)
      - Execution of primary_chunkable_referenced_modules failed
      - Execution of <CssModule as Module>::references failed
      - Execution of parse_css failed
      - Execution of <PostCssTransformedAsset as Asset>::content failed
      - Execution of PostCssTransformedAsset::process failed
      - Execution of evaluate_webpack_loader failed
      - creating new process
      - node process exited before we could connect to it with exit status: 0
        Process output:
      
        Process error output:
      
      > Build error occurred
      Error [TurbopackInternalError]: Failed to write app endpoint /page
      
      Caused by:
      - [project]/test/tmp/next-test-1791478247265-510/app/globals.css [app-client] (css)
      - creating new process
      - node process exited before we could connect to it with exit status: 0
      
      Debug info:
      - Execution of get_all_written_entrypoints_with_issues_operation failed
      - Execution of EntrypointsOperation::new failed
      - Execution of all_entrypoints_write_to_disk_operation failed
      - Execution of output_assets_operation failed
      - Execution of <AppEndpoint as Endpoint>::output failed
      - Failed to write app endpoint /page
      - Execution of AppEndpoint::output failed
      - Execution of whole_app_module_graph_operation failed
      - Execution of *Project::get_all_additional_entries failed
      - Execution of ModuleGraph::from_graphs failed
      - Execution of ModuleGraph::from_graphs_inner failed
      - Execution of SingleModuleGraph::new_with_entries failed
      - [project]/test/tmp/next-test-1791478247265-510/app/globals.css [app-client] (css)
      - Execution of primary_chunkable_referenced_modules failed
      - Execution of <CssModule as Module>::references failed
      - Execution of parse_css failed
      - Execution of <PostCssTransformedAsset as Asset>::content failed
      - Execution of PostCssTransformedAsset::process failed
      - Execution of evaluate_webpack_loader failed
      - creating new process
      - node process exited before we could connect to it with exit status: 0
        Process output:
      
        Process error output:
          at <unknown> (TurbopackInternalError: Failed to write app endpoint /page)
          at throwTurbopackInternalError (../../../packages/next/dist/shared/lib/turbopack/internal-error.js:38:17) {
        location: undefined
      }
      destroyed next instance: 7.653ms
      ```
      
      Now we report a more useful message that has some suggestions
      ```
      ./app/globals.css
      Error: Node.js worker processes could not connect to Turbopack
      Turbopack is configured to run webpack loaders and PostCSS transforms in child processes that communicate with it over a loopback TCP connection, but the child process was unable to connect while evaluating loaders [postcss]:
      connect ENETUNREACH 127.0.0.1
      This is likely caused by a sandbox or firewall that blocks connections. Allow local connections, or run this code using worker threads by setting `experimental.turbopackPluginRuntimeStrategy: 'workerThreads'` in your Next.js config.
      
      https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackPluginRuntimeStrategy
      ```
      
      
      <!-- NEXT_JS_LLM -->
      
      ---------
      Co-authored-by: 's avatarvercel-gh-bot-3[bot] <282332853+vercel-gh-bot-3[bot]@users.noreply.github.com>
      7d525155
    • Benjamin Woodruff ‮'s avatar
      Turbopack: Ignore realpath errors during module resolution, matching node's behavior (#99951) · a6906597
      Benjamin Woodruff authored
      Addresses agent feedback:
      https://vercel.slack.com/archives/C0ANB536V62/p1791479564863939
      
      Certain setups could cause us to report a Turbopack internal error due
      to this bail.
      
      In testing, it appears that node treats realpath errors (e.g. due to a
      symlink cycle) the same as not-found. So while these errors could be
      useful, we shouldn't emit them.
      
      I discussed this with @lukesandberg, and because the resolution
      algorithm is so hot, emitting issues here (e.g. warnings) could be
      extremely noisy. So it seems better not to do that.
      
      If somebody's `node_modules` is severely f*ked up,
      `MissingNextFolderIssue` should already provide a sufficiently good
      error message:
      https://github.com/vercel/next.js/blob/3fd5b1c0b23546e1256f37ee7d705e255a4938e2/crates/next-core/src/next_import_map.rs#L1320-L1323
      a6906597
    • Jamiboy Mohammad's avatar
      test: add a `vercel` gate condition for Vercel-specific deploy tests (#99837) · 3fd5b1c0
      Jamiboy Mohammad authored
      ## Summary
      
      We've been enabling more e2e tests in deploy mode to increase coverage.
      Some of them are written with Vercel-specific assumptions, like Vercel's
      build directory, build-log format, or `vercel.json` handling. They fail
      when other platforms run the deploy suite against their own adapters.
      
      This PR adds a static `vercel` gate condition. It's true only in deploy
      runs with `NEXT_TEST_DEPLOY_TARGET_VERCEL=1`, which our Vercel deploy CI
      jobs set. Tests that depend on Vercel can then be skipped on other
      platforms:
      
      ```ts
      // @force-gate !deploy || vercel
      ```
      
      The PR applies it to five recently enabled tests. This is a short-term
      measure; the goal is to make these tests work on every adapter.
      
      ---------
      Co-authored-by: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
      3fd5b1c0
    • Tobias Koppers's avatar
      Reland experimental custom webpack support (#99234) · e489aae4
      Tobias Koppers authored
      ### What?
      
      Reland [#98862](https://github.com/vercel/next.js/pull/98862) after its
      revert in [#99227](https://github.com/vercel/next.js/pull/99227).
      Restore `next dev --custom-webpack` and `next build --custom-webpack`,
      CLI documentation, and the original e2e fixture, **without declaring
      webpack as a peer dependency**. `--webpack` continues using bundled
      webpack.
      
      ### Why?
      
      Allow applications to explicitly opt into their installed webpack
      version. The CLI records the absolute application directory before
      loading dev/build internals; config loading validates webpack, while
      Next.js's compiled webpack wrapper uses a project-scoped `createRequire`
      for every webpack import. This ensures `next.config.js`, user plugins,
      and Next.js compilation use the same webpack even if a different version
      is visible from inside the `next` package. Custom mode installs no
      webpack aliases; bundled mode keeps its explicit alias list.
      
      ### How?
      
      Restore the feature on post-revert canary without undoing intervening
      changes (including `next analyze`). Keep webpack as an
      application-installed dependency checked at opt-in time, rather than an
      npm peer in `next`'s published metadata. The e2e tests exercise webpack
      5.98.0 and 5.111.0 in dev and production, config-time
      `require('webpack/package.json')`, custom and built-in plugins, the
      missing-install diagnostic, bundled fallback, and conflicting flags. A
      regression fixture disables pnpm hoisting and shadows webpack 5.98.0
      beside `next` while the app installs 5.111.0; it proves Next still
      selects the app's instance. Another test builds with an explicit
      application directory from a different cwd. A dedicated Custom Webpack
      guide (shared between App and Pages Routers) includes install/usage
      examples and a pnpm `hoistPattern` note for plugins and workspace
      tooling that independently resolve webpack; both CLI option rows link to
      the guide.
      
      **Internal-sync caveat:** #99227 reports that declaring webpack as an
      optional peer introduced a dependency chain that duplicated Next.js in
      monorepos and broke internal sync. This reland **omits the peer
      declaration** to avoid that specific graph edge, while keeping runtime
      validation for `--custom-webpack`. The private dependency graph and sync
      reproduction are unavailable here; local tests do **not** independently
      prove internal sync is fixed. Maintainers should verify it before
      merging.
      
      **Local verification:** focused e2e **8/8 dev and 8/8 production** (plus
      targeted non-isolated checks for the two new tests), Next.js build and
      types, frozen lockfile install, changed-file ESLint, Prettier, and `pnpm
      types-and-precompiled` from a clean commit (no generated diff).
      Repo-wide `pnpm lint-eslint .` fails with a plugin-scope configuration
      error on the post-revert base as well
      (`import/no-extraneous-dependencies` cannot find plugin `import`);
      changed-file lint passes.
      
      **Review follow-up:** Restored the bundled-only `webpack/package`
      metadata alias and added config-time coverage for both extensionless and
      `.json` metadata imports. Per sokra's direction, no runtime version
      validation is added; the docs explicitly describe custom webpack as use
      at your own risk and list the tested versions without guaranteeing
      compatibility.
      
      **CI note:** Commit `51ebc4f9` passed docs-link, lint,
      types/precompiled, all production tests and changed-test flake runs, but
      a new explicit-directory case attempted `next build` inside a dev-mode
      shard and failed deterministically with a missing `.next/dev/trace`. The
      follow-up test-only commit `9d5c3d4e` instead exercises `next dev
      <appDir>` there and checks its HTTP output; it preserves the production
      `next build <appDir>` assertion. Focused dev and production e2e tests
      pass 8/8 locally; That commit's CI passed. Review follow-up `ed1c7bd0`
      also passed CI. The docs-only commit `10cbbd84` moves the setup section
      into the dedicated guide; its CI is running. The earlier docs-only
      commit also hit unrelated instant-validation snapshot mismatches, which
      were not rerun as flakes.
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 19431696-5f4c-400d-a3be-700bfe86abda -->
      
      ---------
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      e489aae4
    • Jamiboy Mohammad's avatar
      test: remove per-test Corepack overrides now that deploy mode enables it (#99945) · 0541251f
      Jamiboy Mohammad authored
      ## Summary
      
      #95360 sets `ENABLE_EXPERIMENTAL_COREPACK=1` for every deployment in
      `test/lib/next-modes/next-deploy.ts`, so Vercel now installs deploy
      tests with the generated `package.json#packageManager` (pnpm). The
      per-test workarounds added to get individual suites deploying are now
      redundant:
      
      - Remove `env: { ENABLE_EXPERIMENTAL_COREPACK: '1' }` from 13
      `nextTestSetup` call sites across 12 test files: `geist-font`,
      `gssp-redirect`, `gssp-redirect-base-path`,
      `rewrite-with-browser-history`, `router-hash-navigation`,
      `scroll-back-restoration`, `relay-graphql-swc-multi-project` (x2),
      `nx-handling`, `import-meta-glob-monorepo`, `non-root-project-monorepo`,
      `server-source-maps`, `fake-frame-source-maps`, and
      `transpile-packages-typescript-foreign` (x2).
      - Remove `test/e2e/transpile-packages-typescript-foreign/vercel.json`.
      Its only purpose was `installCommand: "pnpm install"` to stop Vercel
      from installing with npm. This is a separate commit in case it should be
      dropped.
      
      ## Verification
      
      - `git grep ENABLE_EXPERIMENTAL_COREPACK` now only matches
      `test/lib/next-modes/next-deploy.ts`.
      - Not run: `pnpm test-deploy-turbo` on the affected suites (pending a
      deploy test run on this branch).
      
      <!-- NEXT_JS_LLM -->
      
      ---------
      Co-authored-by: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
      0541251f
    • next-js-bot[bot]'s avatar
      v16.5.0-canary.6 · 2d0da212
      next-js-bot[bot] authored
      2d0da212
    • Jiwon Choi's avatar
      Add more metadata to agent upgrade telemetry (#99925) · f528c5cc
      Jiwon Choi authored
      ### Why?
      
      Upgrade outcomes lack version and runtime context, so failures and
      missing results cannot be compared by upgrade path or environment.
      
      ### How?
      
      Add metadata to the existing run-linked events:
      
      - Run start: the app's starting Next.js version, the invoking CLI's Node
      version, and the package manager and its version when available.
      - CLI result: the starting and approved target Next.js versions.
      - Agent result: the installed app Next.js version when the result is
      reported.
      
      Keep existing run IDs, agent detection/selection, and policy attribution
      so analyses can group outcomes by version path, Node version, agent,
      policy, and package manager.
      
      Reuse the upgrade commands' package-manager selection. Version lookup
      failures warn and leave metadata null without stopping the upgrade.
      Targets are recorded only after preparation succeeds; copied or printed
      prompts may have no identified agent. Analyses should retain unknown
      metadata in their denominators.
      
      The receiver and compression schemas must be updated and deployed to
      retain the new fields. Historical events cannot gain metadata they never
      recorded.
      
      Full CLI execution verification is blocked by missing workspace
      dependencies and build outputs.
      
      <!-- NEXT_JS_LLM -->
      f528c5cc
    • Aurora Scharff's avatar
      perf: reduce build tree view allocations (#99930) · 93a50607
      Aurora Scharff authored
      ## Summary
      
      `printTreeView` copied generated-route lists several times and created a
      temporary object for every route before printing a small preview in the
      build output.
      
      This change writes the preview directly to the output table. When routes
      need to be reordered, it sorts one list of numeric indexes instead of
      copying the routes into objects.
      
      The build output does not change. The function creates less temporary
      data and puts less pressure on garbage collection during builds with
      many generated routes.
      
      ## Impact
      
      In a focused A/B of the compiled `printTreeView` with 50,000 generated
      routes, median temporary heap growth per call dropped:
      
      - from 460 KB to 68 KB when preserving route order (-85%)
      - from 4.53 MB to 2.14 MB when ordering slow routes first (-53%)
      
      These results were repeated across five fresh Node.js processes with 50
      samples per process. This is a memory-allocation improvement; no
      CPU-time improvement is claimed.
      
      ## Verification
      
      - `pnpm build-all`
      - `HEADLESS=true pnpm test-start-turbo
      test/e2e/app-dir/build-output-truncated-generated-paths/build-output-truncated-generated-paths.test.ts`
      - `HEADLESS=true pnpm test-start-webpack
      test/e2e/app-dir/build-output-truncated-generated-paths/build-output-truncated-generated-paths.test.ts`
      
      <!-- NEXT_JS_LLM -->
      93a50607
    • Tobias Koppers's avatar
      docs(skills): use agent-agnostic branch prefix in create-pr (#99934) · 1720b9bb
      Tobias Koppers authored
      ## Summary
      
      The `create-pr` skill is shared by every coding agent working in this
      repo, but it hard-coded the `codex/` branch prefix, so Claude, Fleet,
      and other agents were told to name branches as if they were Codex.
      
      The skill now uses an agent-agnostic `<agent-name>/<short-topic>`
      convention: agents prefix branches with their own name as a single
      lowercase word, with `codex/`, `claude/`, and `fleet/` given as
      examples. The user can still override the name. The frontmatter
      description is updated to match so skill matching still covers branch
      naming. The Codex-app git directive guidance is left as is, since it is
      genuinely Codex-specific.
      
      ## Verification
      
      - `prettier --check .agents/skills/create-pr/SKILL.md`
      - `git diff --check`
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet e712205b-2273-4aec-9b25-14aeb34efaba -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      1720b9bb
    • Sebastian "Sebbie" Silbermann's avatar
      [test] Regression test for XSS-safe `GoogleTagManager#dataLayer` (#99464) · d3a60807
      Sebastian "Sebbie" Silbermann authored
      This is based on a vulnerability report we got without a reproduction.
      The test shows `GoogleTagManager` is not vulnerable to XSS attacks.
      
      `<GoogleTagManager dataLayer={...}>` serializes user-controlled values
      into its inline init script via `JSON.stringify` without HTML escaping.
      If such a value reaches an HTML document (or an HTML fragment parser in
      a non-script context), a `</script>` sequence breaks out of the script
      tag and the injected markup executes (XSS).
      
      These assertions encode the safe behavior: the payload must never appear
      unescaped in the served HTML, and it must never execute in the browser.
      
      Closes https://linear.app/vercel/issue/NSEC-263
      Closes https://github.com/vercel/next-js-mirror/pull/181
      d3a60807
    • Sebastian "Sebbie" Silbermann's avatar
      [image-optimization] Expose `next/image-optimizer-transform` as a public subpath (#99312) · 5da8ef12
      Sebastian "Sebbie" Silbermann authored
      Vercel's proxy service runs the image optimizer transform step in a child process and imports `next/dist/server/image-optimizer/transform` directly, which pins an internal file layout that should be free to change. This PR exposes the module as the public subpath `next/image-optimizer-transform`, following the existing `next/og` pattern of a root-level pass-through plus a type stub registered in the package `files` array. The new entry also re-exports `ImageError` and `getMaxAge` (both already in the module's dependency graph) so consumers can drop every deep `next/dist/server/image-optimizer/*` import, and the module header now states that its location and export surface are a stable contract. The existing unit test imports the module through the new subpath to keep it exercised, and a new API reference page documents `imageOptimizerTransform`, `optimizeImage`, `getSharp`, `getMaxAge`, and `ImageError`.
      
      Verified with `pnpm test-unit test/unit/image-optimizer/transform.test.ts` (passes through the new subpath), `pnpm --filter=next types`, and an `npm pack --dry-run` confirming both stub files ship in the tarball. The 22 failures in the broader unit run reproduce on clean canary and are unrelated to this change.
      5da8ef12
    • Tobias Koppers's avatar
      fix(next): register the chunk groups that are chunked (#99749) · c0c6790f
      Tobias Koppers authored
      ### What?
      
      Registers chunk groups in the module graph exactly as output code chunks
      them, in two places:
      
      - **Pages layout segments**: `_document` and `_app` are registered as
      their own `Entry` groups (`layout_chunk_group_entry`), in both the
      per-page (dev) graph chain and the whole-app `entries()`.
      `internal_ssr_chunk` chunks them as `ChunkGroup::Entry(vec![layout])`
      instead of `ChunkGroup::Shared(layout)`.
      - **turbopack-cli dev**: `create_web_entry_source` registers one `Entry`
      group per entry, with the same entries `DevHtmlAsset` chunks: the
      runtime entries followed by the entry for evaluatable modules, or the
      module alone otherwise. It passes `runtime_entries` without
      `with_entry(entry)`, because `DevHtmlAsset` appends the entry itself.
      
      ### Why?
      
      A chunk group is identified by its key, and for an `Entry` group that is
      its ordered entries. The next PR in the stack looks every chunked group
      up in `ChunkGroupInfo` by key, so a chunked group the graph didn't
      register fails.
      
      - Pages layouts were declared `Shared(layout)`. The whole-app graph also
      registers the standalone `/_document` and `/_app` endpoints'
      `Entry([module])` group for the same module and keeps only one root
      group per module, so `Shared(layout)` wasn't registered there.
      - turbopack-cli registered a single `Entry` group with all entries and
      runtime entries, while `DevHtmlAsset` chunks one group per entry (with
      the entry appended twice).
      
      No output change is intended: the same modules are chunked, but the
      registered groups now match them.
      
      This is PR 3 of an eight-PR stack (on top of #99100, already merged):
      
      1. #98733 — canonical chunk-group identity
      2. #99686 — chunk several chunk groups in one `chunk_group` call
      3. **This PR** — register the chunk groups that are chunked
      4. #98734 — use graph-derived merged groups
      5. #99750 — chunking takes a `ChunkGroupKey`
      6. #98823 — Pages Router dev client graph chaining
      7. #98685 — chunk-group availability bitmaps
      8. #99050 — keyed chunk-group index lookups
      
      ### Verification
      
      - Workspace `cargo clippy --all-targets -D warnings`, `cargo check
      --workspace --all-targets`, `cargo fmt --check`
      - Turbopack snapshots: 132 passed, no snapshot changes
      - `turbo-tasks` + `turbopack-core` + `next-core` unit tests: 362 passed
      - Turbopack production and dev `404-page-router` (custom `_document` /
      `_app`): 25/25, 12/12
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4f67c6f7-bbe2-454b-9a17-822a60ef8f7e -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      c0c6790f
    • Tobias Koppers's avatar
      refactor(turbopack): chunk several chunk groups in one chunk_group call (#99686) · 26365e05
      Tobias Koppers authored
      ### What?
      
      `ChunkingContext::chunk_group` takes a list of chunk groups and chunks
      them together, as one chunk group, in a single chunking task. It
      produces one `ChunkGroupResult` (one `make_chunks` run) for the whole
      list.
      
      `evaluated_chunk_group`, `entry_chunk_group` and the
      `ChunkingContextExt` helpers still take a single group and wrap it in a
      one-element list. All existing callers pass a one-element list, so
      **this PR changes no output** (zero snapshot changes).
      
      ### Why?
      
      Review feedback on #98734
      ([1](https://github.com/vercel/next.js/pull/98734#discussion_r4182977091),
      [2](https://github.com/vercel/next.js/pull/98734#discussion_r4182978846)):
      a layout segment's client references can derive several isolated merged
      chunk groups, and #98734 chunked each one with a separate `chunk_group`
      call. That costs an extra chunking task per group and threads
      availability by hand. This PR adds the list form; #98734 then calls
      `chunk_group` once per segment and side with all of the segment's
      derived groups.
      
      ### How?
      
      `make_chunk_group` / `chunk_group_content` /
      `chunk_group_content_operation` take the list as a
      `SmallVec<[ChunkGroup; 1]>`: almost every call passes a single group, so
      the common case doesn't heap-allocate. The list crosses turbo-task
      boundaries, so this PR also adds `impl TaskInput for SmallVec<A>` in
      turbo-tasks, mirroring the `Vec` impl. Semantics:
      
      - **Traversal:** the entries of each group, in list order, with one
      shared traversal state. A module already reached from an earlier group
      isn't collected again, which matches what the previous
      one-call-per-group sequence produced (CSS order unchanged).
      - **Availability:** every listed group is added to the resulting
      availability info.
      - **Entry groups:** if several `Entry` groups are listed, the active
      page entries and the resulting entry group are the union of their
      modules, in list order.
      - **Edge cases:** an empty list is an error; groups listed more than
      once (same key) are chunked once.
      
      Unit tests cover the edge cases, the `Entry` union, and `SmallVec` as a
      task input (inline and spilled).
      
      This is PR 2 of an eight-PR stack (on top of #99100, already merged):
      
      1. #98733 — canonical chunk-group identity
      2. **This PR** — chunk several chunk groups in one `chunk_group` call
      3. #99749 — register the chunk groups that are chunked
      4. #98734 — use graph-derived merged groups
      5. #99750 — chunking takes a `ChunkGroupKey`
      6. #98823 — Pages Router dev client graph chaining
      7. #98685 — chunk-group availability bitmaps
      8. #99050 — keyed chunk-group index lookups
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4f67c6f7-bbe2-454b-9a17-822a60ef8f7e -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      26365e05
    • Tobias Koppers's avatar
      Turbopack: canonicalize chunk group identity (#98733) · 62bf969d
      Tobias Koppers authored
      ### What?
      
      Makes `ChunkGroupInfo` resolve chunk groups through their canonical
      `ChunkGroupKey` identity.
      
      ### Why?
      
      Merged chunk groups carry an entry list whose order is intentionally
      unspecified. Looking up the full `ChunkGroup` value therefore makes
      identity depend on incidental entry ordering, even though the module
      graph already indexes groups by parent and merge tag.
      
      This is PR 1 of an eight-PR stack (on top of #99100, already merged):
      
      1. **This PR** — canonical chunk-group identity
      2. #99686 — chunk several chunk groups in one `chunk_group` call
      3. #99749 — register the chunk groups that are chunked
      4. #98734 — use graph-derived merged groups
      5. #99750 — chunking takes a `ChunkGroupKey`
      6. #98823 — Pages Router dev client graph chaining
      7. #98685 — chunk-group availability bitmaps
      8. #99050 — keyed chunk-group index lookups
      
      It provides stable identity for the graph-derived chunk-group work above
      it.
      
      ### How?
      
      Adds a canonical key conversion for every chunk-group variant and uses
      the existing `chunk_group_keys` index for lookup. Merged keys
      intentionally contain only their parent group and merge tag.
      
      ### Verification
      
      - `cargo test -p turbopack-core` — 160 passed
      - `cargo test -p turbopack-tests --test snapshot` — 125 passed
      - Affected Cargo checks and Rust formatting
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4f67c6f7-bbe2-454b-9a17-822a60ef8f7e -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      62bf969d
    • Tobias Koppers's avatar
      Turbopack: add zstd compression flags for NEXT_TURBOPACK_TRACING (#99808) · 4b28e261
      Tobias Koppers authored
      ## Summary
      
      Adds zstd compression flags for `NEXT_TURBOPACK_TRACING`, next to `gz`
      and `gz-best`:
      
      - `zstd`: level 3. Recommended: about the same writer CPU as `gz`, about
      25% smaller files.
      - `zstd-fast`: level 1, the lowest-CPU option, still smaller than `gz`.
      - `zstd-best`: level 19.
      
      The trace writer drops the encoder on exit (`auto_finish`), so the zstd
      frame is complete. If several compression flags are given, the last one
      wins, as before. The default stays uncompressed, and the trace format is
      unchanged. `zstd` was already in the dependency graph, so no new crate
      is compiled.
      
      `contributing/turbopack/tracing.md` documents the flags. It also notes
      that `zstd-best` and `gz-best` can fall behind on large traces: the data
      waiting to be compressed is kept in memory, and the process waits for it
      on exit.
      
      Stack (on top of #99765):
      
      1. #99777: `no-memory` flag
      2. #99778: Merge allocation counters into Enter/Exit rows
      3. #99779: Delta-encode allocation counters, skip unchanged ones
      4. #99780: Omit Exit+Enter pairs with (almost) no gap
      5. #99808: **This PR**: zstd flags
      6. #99809: Delta-encoded timestamps
      7. #99781: Bump the trace header to `TRACEv1`
      8. #99810: `upload-trace` accepts compressed traces
      
      ## Verification
      
      `next build` of `bench/heavy-npm-deps` with a release binding built from
      this branch:
      
      | flag | `NEXT_TURBOPACK_TRACING=1` trace |
      | --- | --- |
      | none | 23.8 MB |
      | `zstd-fast` | 7.2 MB |
      | `zstd` | 6.1 MB |
      | `zstd-best` | 5.1 MB |
      | `turbo-tasks,zstd` | 27.8 MB (raw: 155.7 MB) |
      
      - Every zstd capture passes `zstd -t`, is fully decoded by
      `turbo-trace-size` and loads completely in the trace server.
      - `1,gz,zstd` writes zstd, and `1,zstd,gz` writes gzip.
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4a52842b-f1a2-43cb-9779-3655caada6a0 -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      4b28e261
    • Tobias Koppers's avatar
      Turbopack: omit Exit+Enter trace row pairs with (almost) no gap (#99780) · e08d99ac
      Tobias Koppers authored
      ## Summary
      
      When a span is exited and then entered again on the same thread almost
      immediately, the writer drops both rows. Async spans do this on every
      poll. It cuts the number of Enter/Exit rows almost in half.
      
      A pair is only omitted when all of these hold:
      
      - same span, same thread, and the `Exit` is still the last row in the
      thread-local buffer (not sent to the writer thread yet)
      - nothing was (de)allocated between the Exit and the Enter (otherwise
      the Enter would need to report it for whatever ran in between)
      - the gap is **≤ 1µs**, or **≤ 0.1%** of the time between the last
      `Enter` row written on this thread (of any span; omitted `Enter` rows
      don't count) and the Exit. For nested spans the last `Enter` can be a
      nested span's, which only shrinks the allowance. Memory samples are
      still taken when the `Enter` row is omitted.
      
      Allocations reported with the dropped Exit aren't lost. The baseline is
      rolled back, so the next row of the thread reports them, while the span
      is on top of the stack again.
      
      The viewer then shows the span as entered during the gap. Its self time
      can be slightly too large, by at most 1µs or 0.1% per gap. This is
      documented in `contributing/turbopack/tracing.md`.
      
      Implementation:
      
      - `TraceWriter`'s `WriteGuard` can mark exactly what a callback writes
      (`mark(marker, |guard| ...)`) and remove that row again with
      `remove_last_row(marker)`, as long as it still ends the thread local
      buffer. Any other write, or sending the buffer, invalidates it. `Exit`
      rows are marked with the span id.
      - `RawTraceLayer` keeps per-thread state (last Enter timestamp, last
      exit, allocation baseline). It is reset when the thread id changes. The
      allowed gap is only computed in `on_enter`, after the cheaper checks
      pass. Allocations made by this bookkeeping are excluded from the
      counters.
      - The clock and the allocation counters can be injected in tests.
      
      Stack (on top of #99765):
      
      1. #99777: `no-memory` flag
      2. #99778: Merge allocation counters into Enter/Exit rows
      3. #99779: Delta-encode allocation counters, skip unchanged ones
      4. #99780: **This PR**: omit Exit+Enter pairs with (almost) no gap
      5. #99781: Bump the trace header to `TRACEv1`
      
      ## Measurements
      
      `next build` of `bench/heavy-npm-deps`, release native binding built
      from source:
      
      | | trace size | Enter rows |
      | --- | --- | --- |
      | PR 3 | 31.6 MiB | 1,138,850 |
      | same-timestamp pairs only | 27.2 MiB | 875,258 |
      | this PR (≤ 1µs or ≤ 0.1%) | 22.9 MiB | 626,956 |
      
      A dev build of the binding has almost no same-µs pairs (it's slower), so
      measure this with a release build.
      
      ## Verification
      
      - Unit tests for each condition: same/different span, thread and
      timestamp; allocations in between; an intervening row; a sent buffer;
      thread slot reuse; the 1µs fast path; exactly at and just over the 0.1%
      bound; chained omissions; allocation totals preserved
      - `TraceWriter` tests for marking and removing rows
      - Captured a trace with a locally built release binding and loaded it in
      the trace server
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4a52842b-f1a2-43cb-9779-3655caada6a0 -->
      
      ---------
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      e08d99ac
    • Tobias Koppers's avatar
      Turbopack: delta-encode trace allocation counters and skip unchanged ones (#99779) · 0e324e12
      Tobias Koppers authored
      ## Summary
      
      The allocation counters on `Enter`/`Exit` rows are now the **delta**
      since the previous report of the same thread, not cumulative per-thread
      totals. When nothing was (de)allocated, the delta is omitted (`None`).
      
      Cumulative counters are large numbers, so their varints take many bytes.
      Deltas are mostly small or zero: in a typical trace, half of all reports
      had an unchanged counter.
      
      - The writer keeps the last reported counters per thread. The first
      report of a thread only sets the baseline (`None`). That state also
      stores the thread id, because `thread_local` slots are reused after a
      thread exits, so a new thread never diffs against an old thread's
      counters.
      - The trace server attributes the delta directly, with no per-thread
      cumulative state.
      
      Stack (on top of #99765):
      
      1. #99777: `no-memory` flag
      2. #99778: Merge allocation counters into Enter/Exit rows
      3. #99779: **This PR**: delta-encode allocation counters, skip unchanged
      ones
      4. #99780: Omit Exit+Enter pairs with (almost) no gap
      5. #99781: Bump the trace header to `TRACEv1`
      
      ## Measurements
      
      `next build` of `bench/heavy-npm-deps`, release native binding built
      from source:
      
      | | trace size |
      | --- | --- |
      | original | 68.2 MiB |
      | PR 2 | 58.8 MiB |
      | this PR | 31.6 MiB |
      
      ## Verification
      
      - Unit tests in `raw_trace.rs` for deltas, omitted zero deltas, the
      per-thread baseline and a reused thread slot
      - Captured a trace with a locally built binding and loaded it in the
      trace server
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4a52842b-f1a2-43cb-9779-3655caada6a0 -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      0e324e12
    • Tobias Koppers's avatar
      Turbopack: merge allocation counters into trace Enter/Exit rows (#99778) · 1012b220
      Tobias Koppers authored
      ## Summary
      
      Removes the separate `AllocationCounters` (and the unused `Allocation`)
      trace rows. Their data is attached to the `Enter`/`Exit` rows as
      `allocations: Option<Allocations>` instead.
      
      Before, the writer emitted one `AllocationCounters` row before every
      Enter and Exit. Each carried its own tag, timestamp and thread id. Those
      rows were **66%** of a typical trace. Since the counters are always
      paired with an Enter/Exit, the duplicated tag, timestamp and thread id
      can go.
      
      - `TraceRow::Enter`/`Exit` get an `allocations` field (`None` when
      memory isn't tracked). The new `Allocations` struct is shared by writer
      and readers.
      - Trace server: the counters on Enter/Exit go through the same
      diff-and-attribute logic as before. The span on top of the thread's
      stack before the row is applied gets the allocations: for Enter, the
      previously running span; for Exit, the exited span.
      - `turbo-trace-size`: the `AllocationCounters`/`Allocation` row kinds
      are removed. Enter/Exit now have an `allocations` component.
      
      This is an incompatible format change. The `TRACEv1` header bump comes
      last in the stack (PR 5), and older traces are then rejected with an
      error. The stack is meant to land together.
      
      Stack (on top of #99765):
      
      1. #99777: `no-memory` flag
      2. #99778: **This PR**: merge allocation counters into Enter/Exit rows
      3. #99779: Delta-encode allocation counters, skip unchanged ones
      4. #99780: Omit Exit+Enter pairs with (almost) no gap
      5. #99781: Bump the trace header to `TRACEv1`
      
      ## Measurements
      
      `next build` of `bench/heavy-npm-deps`, release native binding built
      from source:
      
      | | trace size | rows |
      | --- | --- | --- |
      | before (PR 1) | 68.2 MiB | 4.65 M |
      | this PR | 58.8 MiB | 2.37 M |
      
      ## Verification
      
      - New trace server test checks allocation attribution for Enter/Exit
      rows through `TurbopackFormat`
      - Captured a trace with a locally built binding and loaded it in the
      trace server
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 4a52842b-f1a2-43cb-9779-3655caada6a0 -->
      Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
      1012b220
    • Aurora Scharff's avatar
      fix: classify collapsed generated paths from child routes (#99864) · 4bee1b4c
      Aurora Scharff authored
      ### What
      
      Fix the build route table so a collapsed generated-path row uses the
      shared symbol of the concrete paths it represents. The Maintainer Agent
      regression test now expects the Static symbol.
      
      ### Before
      
      The generated paths are static, but the collapsed row inherits the
      Partial Prerender symbol from the dynamic route pattern:
      
      ```text
      └   /blog/[...slug]
        ├ ◐ /blog/[...slug]
        ├ ○ /blog/post-1
        ├ ○ /blog/post-2
        └ ◐ [+10 more paths]
      ```
      
      ### After
      
      The collapsed row uses the shared Static symbol from the generated paths
      it represents:
      
      ```text
      └   /blog/[...slug]
        ├ ◐ /blog/[...slug]
        ├ ○ /blog/post-1
        ├ ○ /blog/post-2
        └ ○ [+10 more paths]
      ```
      
      The route pattern remains Partial Prerender because it can still handle
      paths outside `generateStaticParams`. Only the collapsed generated-path
      row changes.
      
      ### Why
      
      With Cache Components, Partial Prefetching, and `ensureStatic =
      'navigation'`, a catch-all route can have a Partial Prerender route
      pattern while every generated path is complete and static. The synthetic
      `[+N more paths]` label has no `pageInfos` entry, so it previously fell
      back to the route pattern and printed Partial Prerender for those static
      paths.
      
      ### How
      
      Compute the hidden paths’ symbols in both the regular and
      duration-sorted truncation branches. Use the shared child symbol when
      every hidden path agrees; if the hidden paths have mixed symbols,
      preserve the conservative route-pattern fallback.
      
      The regression test asserts the real `next build` CLI output and
      verifies that every generated path produces complete static HTML.
      
      ### Documentation
      
      The Building guide introduces the collapsed `[+N more paths]` notation
      at first use and shows the correct symbol as the rendering
      classification changes.
      
      ### Validation
      
      - `NEXT_SKIP_ISOLATE=1 pnpm test-start-turbo
      test/e2e/app-dir/build-output-truncated-generated-paths/` — 2 passed
      - `NEXT_SKIP_ISOLATE=1 pnpm test-start-turbo
      test/production/build-output/build-output.test.ts` — 10 passed, 2
      skipped
      - `pnpm --filter=next build` — passed
      - Pre-commit Prettier and ESLint checks passed
      - Prettier check for the documentation — passed
      
      Maintainer investigation:
      https://next-maintainer-agent.vercel.tools/investigations/feedback/64
      DX Agent feedback:
      https://dxagent.labs.vercel.dev/dashboard/feedback/3fbc3904-2843-4eb6-9033-312f4306b66b
      
      Prepared in fork:
      https://github.com/vercel-labs/next.js-experimental/pull/237
      
      ---------
      Co-authored-by: 's avatarvercel-gh-bot-3[bot] <282332853+vercel-gh-bot-3[bot]@users.noreply.github.com>
      4bee1b4c
    • next-js-bot[bot]'s avatar
    • Sebastian "Sebbie" Silbermann's avatar
      [cd] Replace versioned release branches with fixed `releases/lts/*` refs (#99807) · 03d5842d
      Sebastian "Sebbie" Silbermann authored
      Release branches no longer carry the version number. Two long-lived,
      manually-created branches replace them: `releases/lts/active` (current
      major's release line) and `releases/lts/maintenance` (previous major's).
      
      From then on, triggering a stable release moves the refs automatically,
      via the release GitHub App (next.js bot) credentials already used for
      the signed release commit:
      
      - **patch**: no ref moves — the release commit already advances the
      branch it was cut on
      - **minor**: routed by the released version's major against the latest
      major (the one `releases/lts/active` currently points at) — equal moves
      `releases/lts/active` to the new tag, latest − 1 moves
      `releases/lts/maintenance` to the new tag, anything else moves nothing
      - **major**: `releases/lts/maintenance` takes `releases/lts/active`'s
      previous position, then `releases/lts/active` moves to the new tag
      
      Supporting changes:
      
      - `scripts/release-branches.json` lists the fixed branch set (`canary` +
      both LTS branches) so `version-bump.js` allows bumps on them
      - `build_and_test.yml` / `build_and_deploy.yml` run on pushes to the LTS
      branches, and the staging deploy-target condition covers them (parity
      with the per-branch rewrite the removed script used to produce)
      - `backport-pr` skill, `AGENTS.md`, `release-channels-publishing.md`,
      and a stale `version-bump.js` comment updated for the new branch model
      Co-authored-by: 's avatarClaude Code <noreply@anthropic.com>
      03d5842d
    • Niklas Mischkulnig's avatar
      test: Really use pnpm on deploy tests (#95360) · 76bed42c
      Niklas Mischkulnig authored
      We already set `package.json#packageManager`
      
      <img width="539" height="388" alt="Bildschirmfoto 2026-07-01 um 16 26
      30"
      src="https://github.com/user-attachments/assets/8f6f3e8f-60a6-484d-ac57-f8dc261f8b85"
      />
      
      But the Vercel deployment tests still used npm to install dependencies
      because you need to set `ENABLE_EXPERIMENTAL_COREPACK` so that
      `packageManager` applies.
      
      pnpm should be hopefully faster, and also improves consistency across
      the test environments
      
      Full deploy test run:
      ~~https://github.com/vercel/next.js/actions/runs/28528683809~~
      ~~https://github.com/vercel/next.js/actions/runs/28531873334~~
      ~~https://github.com/vercel/next.js/actions/runs/28542029071~~
      ~~https://github.com/vercel/next.js/actions/runs/29311003094~~
      ~~https://github.com/vercel/next.js/actions/runs/32731722428~~
      ~~https://github.com/vercel/next.js/actions/runs/37841713568~~
      https://github.com/vercel/next.js/actions/runs/37900216932
      76bed42c
    • Niklas Mischkulnig's avatar
      test: compare cache-control directives as a set in deploy tests (#99892) · a9f0a668
      Niklas Mischkulnig authored
      Imported https://github.com/vercel/next.js/pull/99872 by @pieh as a
      local branch to be able to run CI
      Closes https://github.com/vercel/next.js/pull/99872
      
      ---
      
      
      <!-- 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
      
      We encourage you to use AI to assist you in researching, creating, and
      reviewing changes. However, you must review and deeply understand the
      contributions you are making. For this reason, **pull request
      descriptions from external contributors must be written by a human**.
      
      ### 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
      
      ### Signed commits
      
      - This repository requires verified commit signatures on protected
      branches.
      - If this pull request is blocked for unsigned commits, re-sign the
      commits and force-push the branch.
      - A `Signed-off-by` line in the commit message is not enough.
      
      ## 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 #
      
      -->
      
      ### What?
      
      Adjust existing `cache-control` assertions in e2e tests running in
      deploy mode to compare directives in a way that whitespace changes don't
      fail a test, but still assert that exact set of expected directives is
      received.
      
      To minimize the change I avoided changing tests that do not run in
      deploy mode.
      
      ### Why?
      
      Tests asserting on exact string are failing like this when testing
      Netlify deployments:
      ```
      Error: expect(received).toBe(expected) // Object.is equality
      
      Expected: "public, max-age=0, must-revalidate"
      Received: "public,max-age=0,must-revalidate"
          at Object.toBe (/home/runner/work/opennextjs-netlify/opennextjs-netlify/nextjs/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts:26:48)
          at processTicksAndRejections (node:internal/process/task_queues:95:5)
      ```
      
      which still has same overall behavior, just not the same exact
      formatting
      
      ### How?
      
      Extract pre-existing local `expectDirectives` helper from one of the the
      [tests](https://github.com/vercel/next.js/blob/ea119d2702ba9252233c678ca74b4a310b5eedd0/test/e2e/app-dir/ppr-full/ppr-full.test.ts#L70-L83)
      to shared utils, generalize it to allow regex rules and adjust deploy
      tests to use it instead of strict string comparisons.
      Co-authored-by: 's avatarpieh <misiek.piechowiak@gmail.com>
      a9f0a668
  2. 08 Oct, 2026 9 commits