1. 09 Oct, 2026 18 commits
    • 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 13 commits
    • next-js-bot[bot]'s avatar
      v16.5.0-canary.5 · 6469906e
      next-js-bot[bot] authored
      6469906e
    • Benjamin Woodruff ‮'s avatar
    • Benjamin Woodruff ‮'s avatar
      Increase timeout on module-scope deployment test (#99891) · 48723bad
      Benjamin Woodruff authored
      Most of the time the `next.start()` call happens as part of
      `nextTestSetup`, but here it happens inside of the `it` block, so extend
      the timeout.
      
      It looks like this started timing out because of
      https://github.com/vercel/next.js/pull/98776 ?
      
      The webpack deployment tests frequently fail out:
      | Deployment | Remote build start → deployment complete |
      |---|---:|
      | [canary.4, first
      execution](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/9BSVkxJfRGBxgLjXWDK1sGVyfqwJ)
      | **61\.0s** |
      | [canary.4, second
      execution](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/2hwJUWduf2F1qMtsdC3CnwJGSQoA)
      | **53\.8s** |
      |
      [canary.62](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/FefU9FREV4BCmEo1dsu2to5Wx1uf)
      | **55\.7s** |
      48723bad
    • Benjamin Woodruff ‮'s avatar
      Fix google tag manager e2e test, assume GTM 200s instead of 404ing (#99896) · 619d36f5
      Benjamin Woodruff authored
      It sounds like the script tag for GTM 404ed in the past if given a bad
      tag id, and now it 200s. We need to only check for the events we care
      about instead of asserting exact sets of events.
      619d36f5
    • next-js-bot[bot]'s avatar
      v16.5.0-canary.4 · 7549879a
      next-js-bot[bot] authored
      7549879a
    • Aurora Scharff's avatar
      docs: align function sidebar titles (#99858) · ea119d27
      Aurora Scharff authored
      ## Summary
      
      Remove parentheses from the `navigation` and `prefetch` sidebar labels
      so they match the other function API references.
      
      ## Verification
      
      - `pnpm prettier --with-node-modules --ignore-path .prettierignore
      --check docs/01-app/03-api-reference/04-functions/navigation.mdx
      docs/01-app/03-api-reference/04-functions/prefetch.mdx`
      - Confirmed no function API reference has a `nav_title` ending in `()`
      
      <!-- NEXT_JS_LLM -->
      ea119d27
    • Jiwon Choi's avatar
      Fix telemetry delivery on Node.js 24 (#99842) · 25cfbd6a
      Jiwon Choi authored
      ### Why?
      
      Telemetry fails on Node.js 24 with this error before any HTTP request is
      sent:
      
      ```text
      TypeError: RequestInit: Expected signal ("AbortSignal {}") to be an instance of AbortSignal.
      ```
      
      Native `fetch` checks that `RequestInit.signal` is an instance of Node's
      native `AbortSignal`. The Edge Runtime ponyfill creates its own
      `AbortSignal` class: the name is the same, but the constructor is
      different, so the signal fails the instance check.
      
      The telemetry transport retries once and suppresses the final error, so
      the CLI can exit successfully without delivering events.
      
      The controller was introduced when Next.js supported Node.js 14.6.
      Next.js now requires Node.js 20.9 or later, where native
      `AbortController` is available on all supported versions.
      
      ### How?
      
      Use Node's native `AbortController` so its signal matches `fetch`,
      preserving the existing timeout.
      
      Verified real SDK HTTP delivery on Node.js 20.9, 22.6, and 24.1, and the
      five-second cancellation deadline. The patched CLI received HTTP 204 for
      all three upgrade lifecycle events; Snowflake persistence is not yet
      verified. The full repository build and test suite were not run.
      
      <!-- NEXT_JS_LLM -->
      25cfbd6a
    • Sebastian "Sebbie" Silbermann's avatar
      [test] Authenticate deploy tests via VERCEL_TOKEN instead of shared auth.json (#99846) · 4141a0a5
      Sebastian "Sebbie" Silbermann authored
      Deploy tests now authenticate the Vercel CLI via the `VERCEL_TOKEN` env
      var instead of writing a shared `$HOME/.vercel/auth.json` and passing
      `--global-config` to every CLI invocation.
      
      This reduces the chance of a read/write race on the shared auth.json.
      I've never seen this with our current concurrency limits (2) but we saw
      it immediately when bumping to 8
      (https://github.com/vercel/next.js/actions/runs/37704518620/job/113083223389#step:35:386)
      
      ---------
      Co-authored-by: 's avatarClaude Code <noreply@anthropic.com>
      4141a0a5
    • Jan Kassens's avatar
      Replace deprecated React.FormEvent with SubmitEvent (#99821) · b2490553
      Jan Kassens authored
      ## Summary
      
      `@types/react` 19.2.10 deprecates `FormEvent`/`FormEventHandler` (they
      don't correspond to a real DOM event). This switches `onSubmit` handlers
      to `SubmitEvent<HTMLFormElement>` in test fixtures, the docs
      (`authentication.mdx`, `preserving-ui-state.mdx`), and
      `examples/with-supabase`. It also removes an unused `FormEvent` import
      from a JSX docs sample.
      
      Examples still pinned to `@types/react` 18 are unchanged, since
      `SubmitEvent` only exists in `@types/react` >= 19.2.10.
      
      ## Verification
      
      - Type-checked the updated fixtures and the docs snippet patterns with
      `tsc` (strict) against `@types/react` 19.2.18, plus a negative check
      confirming the event type is enforced against `onSubmit`. The fixture
      files aren't in the root `tsconfig.json` include list, so `pnpm
      typescript` doesn't cover them.
      
      <!-- NEXT_JS_LLM -->
      b2490553
    • Tobias Koppers's avatar
      turbo-tasks-fs: Don't print NotFound watcher errors (#99794) · 1dd198b6
      Tobias Koppers authored
      ### What?
      
      Stop the Turbopack disk watcher from printing `watch error … NotFound`
      for paths that vanish while notify is scanning them, and send the
      remaining watcher errors to stderr instead of stdout.
      
      ### Why?
      
      In polling mode, notify's `PollWatcher` walks the tree with walkdir.
      When a directory is deleted between being listed and being opened or
      stat'ed, notify reports an `Io` error with `NotFound`. Deleting a large
      tree (`rm -rf`, a package install) produces a burst of these. A
      filesystem fuzzer saw about 4000 in two minutes. Each one was printed
      with `println!`, so a library was spamming the user's stdout.
      
      These errors don't signal a correctness problem. The watcher already
      invalidates the reported path recursively, and the next scan reports the
      removal anyway. The fuzzer runs had no missed invalidations.
      
      ### How?
      
      - A small private classifier recognizes notify errors of kind `Io`
      wrapping `std::io::ErrorKind::NotFound`. It matches on the structured
      error kinds, not on message text.
      - The watcher thread skips the print for those errors. Batch
      invalidation and batch-delay scheduling still run for every error, so
      invalidation behavior doesn't change.
      - Other notify error kinds, including `PathNotFound`, are still
      reported, now on stderr.
      
      ### Verification
      
      - `cargo test -p turbo-tasks-fs --lib watcher::tests`: 19 passed,
      covering native and polling watchers in both recursive and non-recursive
      modes
      - `cargo clippy -p turbo-tasks-fs --tests -- -D warnings`
      - Not run: a deletion stress test reproducing the race (the fuzzer
      finding above).
      
      <!-- NEXT_JS_LLM -->
      
      
      <!-- fleet 89bd34bb-fe6a-4ea4-abcc-abb97db76087 -->
      
      ---------
      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>
      1dd198b6
    • Benjamin Woodruff ‮'s avatar
      Revert "[ci] Increase deploy test concurrency to 8" (#99840) · a32ddfdf
      Benjamin Woodruff authored
      Reverts vercel/next.js#99770
      
      We're seeing a lot of deployment test failures due to rate limits. We
      can try bumping the rate limits and trying again, but reverting for
      right now to unblock deployment tests.
      a32ddfdf
    • Luke Sandberg's avatar
      Bump next in upgrade eval fixtures for CVE-2026-94483 (#99838) · c692e952
      Luke Sandberg authored
      ## Summary
      
      Bumps `next` in three upgrade eval fixtures that were pinned to versions
      affected by CVE-2026-94483 (Image Optimization SSRF via allow-listed
      remote patterns; fixed in 16.3.8):
      
      - `future-cache-components-nudge`: 16.3.5 → 16.4.0
      - `future-cache-components-same-version`: 16.3.5 → 16.4.0
      - `latest-same-major`: 16.2.12 → 16.3.8
      
      A few things needed to be updated to match
      
      - `latest/setup.ts` and `future/setup.ts` mock
      `registry.npmjs.org/next/latest` with a hardcoded `target`. That target
      is now 16.4.0 (the current `latest`), so the same-version scenarios
      still sit on "latest" and the same-major scenario still has a newer
      target in the same major.
      - `latest-same-major` uses 16.3.8 rather than 16.4.0 because it has to
      start below the target in the same major. 16.3.8 is the oldest patched
      release; there is no patched 16.2.x.
      - The `EVAL.ts` exact-version assertions are updated to match.
      
      The `latest-cross-major`, `latest-nudge` and `future-cache-components`
      scenarios now also upgrade to 16.4.0. Their starting versions are
      unchanged.
      
      Fixes VULN-16485
      Fixes VULN-16486
      Fixes VULN-16487
      
      <!-- NEXT_JS_LLM -->
      c692e952
    • Luke Sandberg's avatar
      turbopack: report the cause when saving the filesystem cache fails (#99823) · fce9c2fe
      Luke Sandberg authored
      ## What
      
      Builds with the Turbopack filesystem cache didn't give useful output
      when the cache couldn't be written during shutdown, for example because
      of a read-only directory or a full disk. The build succeeded, but it
      printed a bare `Shutting down failed: <message>` which was not useful
      
      Before:
      ```
      Persisting failed during shutdown: Unable to write SST file 00000020.sst
      
      Caused by:
      : Permission denied (os error 13)te/var/folders/p6/ytr7tcts5ndf72xw136ky30m0000gn/T/next-install-6cb7b5bc6e3b95a18ae07aa856827db93efc662fe73934ecebae8de778735e0c/.next/cache/turbopack/v16.5.0-canary.2-2c48f075ef/00000020.sst`
      Shutting down failed: A previous write operation failed with an unrecoverable error; no further writes are possible
      ```
      
      Now:
      
      ```
      WARNING: Saving the filesystem cache failed:
          Unable to write SST file 00000020.sst: failed to create file `/Users/lukesandberg/projects/next_2/next.js/test/tmp/next-test-1791392696220-115/.next/cache/turbopack/unversioned/00000020.sst`: Permission denied (os error 13)
      ```
      
      The "Shutting down failed" error is gone and the filesystem cache error
      is slightly improved.
      
      Also:
      - **Compaction is skipped once a write has already failed.** That avoids
      a second, redundant failure.
      - **Database shutdown can't fail anymore.** Compaction errors during
      shutdown are logged as warnings.
      
      ---------
      Co-authored-by: 's avatarvercel-gh-bot-5[bot] <312521305+vercel-gh-bot-5[bot]@users.noreply.github.com>
      fce9c2fe
  3. 07 Oct, 2026 9 commits
    • next-js-bot[bot]'s avatar
      v16.5.0-canary.3 · eeb353be
      next-js-bot[bot] authored
      eeb353be
    • Will Binns-Smith's avatar
      Document `next analyze export` and skill are added in 16.4 (#99738) · eda426e1
      Will Binns-Smith authored
      ## Summary
      
      Mark `next analyze export` and `next-bundle-optimizer` as added in
      v16.4. Add version history entries to the AI agents guide, package
      bundling guide, and CLI reference.
      
      ## Verification
      
      - Prettier and ESLint passed.
      - Runtime tests not run (docs only).
      
      <!-- NEXT_JS_LLM -->
      
      ---------
      Co-authored-by: 's avatarJan Kassens <kassens@vercel.com>
      eda426e1
    • Aurora Scharff's avatar
      create-next-app: write agent feedback block to AGENTS.md when enabled (#99813) · c6c7eae0
      Aurora Scharff authored
      ### What
      
      When `experimental.agentFeedback` is enabled, create-next-app now writes
      the `nextjs-agent-feedback` block into `AGENTS.md` along with the
      `nextjs-agent-rules` block.
      
      ### Why
      
      Before this change, create-next-app enabled the flag in `next.config.ts`
      but only wrote the rules block. The feedback block was added later by
      `next dev`, and only when `@vercel/detect-agent` found a coding agent
      (`syncAgentFeedbackForDev` in `app-info-log.ts`). As a result:
      
      - An agent that read `AGENTS.md` before running `next dev` never saw the
      feedback instructions.
      - The block then appeared as an uncommitted `AGENTS.md` change on top of
      the "Initial commit from Create Next App".
      
      ### How
      
      - `generateAgentFiles(root, { agentFeedback })` adds the feedback block
      after the rules block. The text is copied from
      `packages/next/src/server/lib/generate-agent-files.ts`, with a comment
      saying to keep them in sync. `next dev` compares the block
      byte-for-byte.
      - `create-app.ts` passes `agentFeedback: !example && agentFeedback`,
      because examples don't get `experimental.agentFeedback` written to their
      config.
      - `--no-agents-md` still writes no `AGENTS.md`.
      
      ### Verification
      
      I ran the new helper next to `next dev`'s `writeAgentFiles` +
      `writeAgentFeedbackFiles`, with the flag on and off:
      - The output is byte-identical in both cases.
      - `hasCurrentAgentRules` / `hasCurrentAgentFeedback` return true on
      create-next-app's output.
      - Running `next dev`'s writers again on that output returns `unchanged`.
      
      Tests in `test/production/create-next-app/index.test.ts`:
      - `--agents-md --agent-feedback` writes the rules block, then the
      feedback block, and `next dev`'s `writeAgentFiles` /
      `writeAgentFeedbackFiles` both report `unchanged`. This catches drift
      between the two copies of the text.
      - `--agents-md --no-agent-feedback` writes only the rules block.
      - `--no-agents-md --agent-feedback` creates no `AGENTS.md`.
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code)
      
      ---------
      Co-authored-by: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
      c6c7eae0
    • Jan Kassens's avatar
      [turbopack] fix some unused dependencies (#99825) · 0556f070
      Jan Kassens authored
      These were breaking some GitHub builds for me for some reason.
      
      ## Test Plan
      GitHub CI + local cargo check validation
      0556f070
    • Aurora Scharff's avatar
      Fix next-bundle-optimizer skill handoffs (#99818) · 5f0b8deb
      Aurora Scharff authored
      ## Summary
      
      Make each skill named by `next-bundle-optimizer` directly installable
      when it is unavailable, matching the inline handoff pattern used by the
      other Next.js skills.
      
      ## Verification
      
      - `pnpm prettier --with-node-modules --ignore-path .prettierignore
      --write skills/next-bundle-optimizer/SKILL.md`
      - Not run: runtime tests (skill text only)
      
      <!-- NEXT_JS_LLM -->
      5f0b8deb
    • Sebastian "Sebbie" Silbermann's avatar
      [ci] Increase deploy test concurrency to 8 (#99770) · 1aec1b2f
      Sebastian "Sebbie" Silbermann authored
      Increases test concurrency for the deploy test jobs to 8 (prev: 2 in the
      full suite, 1 in new build-and-test jobs).
      
      For deploy tests, the CPU-intensive work that should be as stable as
      possible (the Next.js build and server) does not happen on the runner.
      It happens remotely when the deployment is built at Vercel. The runner
      mostly handles I/O and setup: pushing the deployment, waiting for it to
      become ready, polling logs, and making requests against it. So the usual
      reason to cap concurrency (runner CPU contention) barely applies.
      
      Adjusted rate-limits:
      - 10x `api-projects-get` (prev failure:
      https://github.com/vercel/next.js/actions/runs/37617890690/job/112780953612#step:35:1159)
      
      Trade-offs to watch:
      
      - Peak concurrent Vercel deployments per run rises 4× (shards × 2 →
      shards × 8; 64 → 256 concurrent test files at today's shard counts). If
      we hit Vercel account deployment-concurrency limits, increase the limits
      - maybe we still need a bit beefier runners if the concurrent
      setup/tests starve runner CPU
      
      ## test plan
      
      - [x] [deploy tests with debug logging on this branch takes 30 minutes
      wall time without hitting Vercel rate
      limits](https://github.com/vercel/next.js/actions/runs/37627918534);
      usual flake on the 1st try (down from [97 minutes on
      canary](https://github.com/vercel/next.js/actions/runs/37588790388/attempts/1))
      
      ---------
      Co-authored-by: 's avatarClaude Code <noreply@anthropic.com>
      1aec1b2f
    • next-js-bot[bot]'s avatar
    • Tobias Koppers's avatar
      Turbopack: fix turbo-trace-size test after MemorySample gained active_worker_threads (#99824) · 6ebc729c
      Tobias Koppers authored
      ### What?
      
      Fixes the `rust check` (clippy) and `test cargo unit` jobs on canary,
      which fail with:
      
      ```
      error[E0063]: missing field `active_worker_threads` in initializer of `TraceRow<'_>`
         --> turbopack/crates/turbopack-trace-size/src/lib.rs:936:13
      ```
      
      The fix adds the missing field to the `TraceRow::MemorySample` row in
      the `turbo-trace-size` unit test.
      
      ### Why?
      
      This was a semantic merge conflict between two PRs that each passed CI
      on their own:
      
      - #99233 added `active_worker_threads` to `TraceRow::MemorySample`.
      - #99765 added the `turbo-trace-size` crate, whose test builds a
      `MemorySample` row without that field.
      
      Only test code is affected. Every other `MemorySample` constructor
      already sets the field.
      
      ### How?
      
      The test row now sets `active_worker_threads: 3`. The size assertions
      are computed from the serialized rows, so they don't change.
      
      Verified locally on top of `db03f83f`: before the change, `cargo test -p
      turbopack-trace-size` fails with the error above. After it, the
      following pass:
      
      - `cargo test -p turbopack-trace-size`
      - `cargo clippy --all-targets -- -D warnings` for
      `turbopack-trace-size`, `turbopack-trace-utils` and
      `turbopack-trace-server`
      - tests of `turbopack-trace-utils` and `turbopack-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>
      6ebc729c
    • Niklas Mischkulnig's avatar
      Turbopack: batch EsmBinding codegen (#99722) · db03f83f
      Niklas Mischkulnig authored
      **View diff without whitespace**
      
      Call these just once (per module), not once per referenced import
      - `unused_references()`
      - `reference.get_referenced_asset()`
      - `imported_module.get_ident(export)`
      db03f83f