- 07 Oct, 2026 7 commits
-
-
next-js-bot[bot] authored
-
Sebastian "Sebbie" Silbermann authored
lerna's last job was bumping the version, and it needed a dependency graph of exact pins to do it. Internal dependencies now use the `workspace:*` protocol instead, which pnpm substitutes for the concrete version when packing, so published manifests are unchanged. `workspace:*` resolves to the same bare exact version that was pinned before. That leaves the bump itself, which `scripts/version-bump.js` now does: write one version field per package, commit, tag. It stays small because every package is versioned in lockstep and releases always bumped all of them (`--force-publish`), so there is no changed-detection to reimplement. `packages/next/package.json` replaces `lerna.json` as the version source of truth. The release branch gate moves to `scripts/release-branches.json`. Three things fall out: - `normalize-version-bump.js` no longer has to normalize internal dependency specs, since `workspace:*` carries no version. Those specs also stop contributing to turbo input hashes. - `set-preview-version.js` no longer needs to check out a branch first. That only existed because `lerna version` refused to run on a detached HEAD. - no more lockfile regeneration after a release which means we can reuse n_m caches `create-preview-tarballs.js` keeps `npm pack`: it rewrites internal dependencies to tarball URLs rather than versions, because that is what preview installs need, so pnpm's substitution would be the wrong transform. It now throws if any `workspace:` specifier survives that rewrite. ## test plan ``` $ git switch -c scratch/release-dry-run sebbie/remove-lerna $ node scripts/start-release.js --release-type canary --dry-run Dry run: keeping commits locally, skipping git push and GitHub release creation Running release-canary... Bumping 16.4.0-canary.39 -> 16.4.0-canary.40 Updated 20 packages [...] Creating GitHub release v16.4.0-canary.40 (changelog range v16.4.0-canary.39..v16.4.0-canary.40, 30 commits) [dry-run] GitHub API POST /repos/vercel/next.js/releases {"tag_name":"v16.4.0-canary.40","name":"v16.4.0-canary.40","body":"### Misc Changes\n\n- Remove lerna\n- [PPF] Implement `unstable_ensureStatic = \"shell\" | \"prefetch\"` (#98191)\n- [PPF] Valid… (1939 chars)","prerelease":true,"draft":true} Created draft prerelease v16.4.0-canary.40 Release process is finished $ git show HEAD --oneline c198fa45fae (HEAD -> scratch/release-dry-run, tag: v16.4.0-canary.40) v16.4.0-canary.40 $ node scripts/publish-release.js --dry-run $ git diff diff --git a/packages/next/package.json b/packages/next/package.json [...] "optionalDependencies": { - "sharp": "^0.35.4" + "sharp": "^0.35.4", + "@next/swc-darwin-arm64": "16.4.0-canary.40", + "@next/swc-darwin-x64": "16.4.0-canary.40", + "@next/swc-linux-arm64-gnu": "16.4.0-canary.40", + "@next/swc-linux-arm64-musl": "16.4.0-canary.40", + "@next/swc-linux-x64-gnu": "16.4.0-canary.40", + "@next/swc-linux-x64-musl": "16.4.0-canary.40", + "@next/swc-win32-arm64-msvc": "16.4.0-canary.40", + "@next/swc-win32-x64-msvc": "16.4.0-canary.40" }, [...] diff --git a/packages/third-parties/package.json b/packages/third-parties/package .json index 7a7fab8790..8cbf23b9cd 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -32,7 +32,7 @@ "typescript": "6.0.2" }, "peerDependencies": { - "next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", + "next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || 16.4.0-canary.40", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" } ``` -
Alex Kulikovskikh authored
-
Benjamin Woodruff authored
Minor cleanup opportunities I noticed after reviewing https://fleet-review.vercel.tools/vercel/next.js/pull/99711/changes/ba6208431008d331bb3c738cd32643c61c04f411..18e7c6dee5d4f85aa1c9a9a68a50830fc73b52f8
-
Tobias Koppers authored
## Summary Stacked above #99254. Allow `blocking = true` on elapsed-duration events and entered tracing spans, using the same ignore-self-time accounting as existing `blocking` spans. Waiting durations otherwise inflate concurrency and CPU totals even after the tasks yield—for example, a pending fetch emits overlapping request and attempt durations. Blocking spans now keep their elapsed ranges and metadata, but contribute no own CPU time, corrected time or concurrency, and do not affect other work's correction factor. Counted descendants remain included. Classify network and Node.js pool-acquisition waits as blocking, while keeping Node.js startup, initialization and evaluation counted as external work. Missing/false attributes preserve legacy accounting. No trace format or viewer payload changes. Existing name-exempt `thread`/`blocking` spans also retain their full elapsed end now, rather than dropping it along with self-time. Attributes are classified at creation, not retroactively via record updates. External-work durations remain elapsed approximations, not OS-measured CPU time. ## Verification - 85 trace-server/trace-utils tests passed, including new reader regressions for flags, retained ranges, counted children, correction factors and live cache invalidation; affected Rust producers and native bindings compile. - Rebuilt trace server queried over WebSocket: the 40-wait fixture changes from concurrency 80 to 0 during the wait when its duration events carry `blocking = true`. Root CPU totals drop from 8002ms to the 2ms entered work; waiting leaf retains its 100ms elapsed range with zero CPU/corrected duration. - No new benchmark screenshot: actual raw-reader tests and the rebuilt-server fixture verify the changed accounting. <!-- NEXT_JS_LLM --> <!-- fleet 0c297c2c-8e55-4012-be8a-752ff8175d1b --> Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
Tobias Koppers authored
## Summary Show how much traced work was happening concurrently throughout a selected span. The trace server divides its range into up to 200 equal-duration segments and returns the time-weighted average number of active global self-time intervals per segment as `concurrencySamples` in the WebSocket query result. It traverses the self-time tree once and rounds averages to hundredths. **Depends on [#99233](https://github.com/vercel/next.js/pull/99233)** and targets its branch so this PR only adds derived concurrency samples. The matching [trace-viewer PR](https://github.com/vercel/turbo-trace-viewer/pull/36) graphs the new values. ## Verification - `cargo test --locked -p turbopack-trace-server` (28 library and 27 binary tests pass) - `cargo check --locked -p next-napi-bindings` - Local native build, `pnpm build-all`, and traced `bench/heavy-npm-deps` Turbopack build passed. The generated 272 MB trace contained 851,901 spans and showed nonzero concurrency for the selected top-level span in the updated viewer. <!-- NEXT_JS_LLM --> <!-- fleet 0c297c2c-8e55-4012-be8a-752ff8175d1b --> Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
Tobias Koppers authored
## What? Record the number of non-idle Tokio scheduler worker threads alongside Turbopack's existing process-memory samples. The span-query API and MCP output expose it as the fourth value in each memory sample. The WebSocket query result adds a parallel worker series for visualization in [vercel/turbo-trace-viewer#33](https://github.com/vercel/turbo-trace-viewer/pull/33), retaining the original memory-only series. ## Why? Memory samples alone do not show whether Tokio's workers were busy or parked at a given point in a trace. The aligned worker count makes it easier to correlate memory changes and traced work with scheduler activity. ## How? Each traced runtime builder initializes one global atomic counter with its worker capacity, then Tokio's worker-only park/unpark callbacks adjust it. This avoids counting blocking-pool threads and assumes one traced Tokio runtime per process; shutdown bookkeeping is unnecessary for this metric. The counter is read at the existing memory-sampling cadence rather than emitting trace rows on each worker transition. Trace ingestion, span-query downsampling, and the WebSocket worker series preserve the count from the same sample as the selected memory value. ## Verification - `cargo test --locked -p turbopack-trace-utils -p turbopack-trace-server` - `cargo check --locked -p turbopack-cli -p turbopack-nft -p next-build-test -p next-napi-bindings` - `cargo fmt --all -- --check`; `git diff --check` - Not run: Next.js TypeScript/prettier/full build (checkout has no `node_modules`). <!-- NEXT_JS_LLM --> <!-- fleet 0c297c2c-8e55-4012-be8a-752ff8175d1b --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
- 06 Oct, 2026 32 commits
-
-
Abhay Mishra authored
Fixes #97378 ### What? Turbopack turns a failed `next/font/google` font file download into an unresolvable request. Build then dies with: ``` Module not found: Can't resolve '@vercel/turbopack-next/internal/font/google/font' ``` Real cause (`Received response with status 404 when requesting <url>`) shows only as a warning earlier in the log. ### Why? Hit this on Vercel with 16.3.6 and EB Garamond. Build failed with 56 of these errors, redeploy of same commit passed. Nothing in the error pointed at the font download. ### How? Font file fetch now follows the stylesheet fetch: error in `next build`, warning in `next dev`. A failed file is served empty, so dev falls back to the next font in the stack. Retries unchanged; `max_retries: 1` already covers connect errors, timeouts and 5xx. Differs from #97520: dev keeps rendering instead of failing, message comes from the existing fetch issue, and global retry count and webpack mock stay as they are. ### Tests `test/e2e/next-font/google-font-file-fetch-error.test.ts`, Turbopack only, since webpack in mock mode does not download font files. Mocked stylesheet points at a missing gstatic file. Without the fix both dev and start fail with `Module not found`. With it both pass. `google-fetch-error` and `index` next-font suites still pass in Turbopack dev and start. `cargo clippy -D warnings`, rustfmt, prettier and eslint clean.
-
Will Binns-Smith authored
-
next-js-bot[bot] authored
-
Luke Sandberg authored
## Summary This experiment builds on the copy-on-write snapshot design from #99649, which is now on canary. It holds the operation exclusion while `take_snapshot` runs, so the scan can move modified bits into new `meta_snapshot_pending` / `data_snapshot_pending` bits safely. Holding the exclusion means a task touched for the first time during the snapshot doesn't need a `None` placeholder in `snapshots`. The map now stores only copy-on-write `SnapshotItem`s, and `end_snapshot` just leaves snapshot mode and clears the map. It no longer has to promote during-snapshot flags or take paired shard locks. Why: compare this simpler bookkeeping with #99649's approach, which keeps the scan outside the exclusion. The trade-off is that operations stay blocked during the O(N) capture scan. Encoding still happens later in the snapshot iterators, after the exclusion is released. This design was rejected earlier on #99649 ("delaying the snapshot to set these bits is not acceptable"), so this PR is meant for comparison, not as the assumed final direction. How: - The scan moves the modified bits into pending bits and records each captured task. - The first mutation of a captured task encodes all of its pending categories before the mutation, so cases where different categories change in different orders are covered. - Pending bits stay set until the iterator yields the task. Undo and eviction still see those bits until then. - Shutdown drain mode still uses the modified bits directly. - If persisting stops early (an error or a panic), each dropped shard clears the pending bits of its captured tasks that weren't yielded, before `end_snapshot` clears `snapshot_mode`. Pending bits never outlive a snapshot, so `track_modification` decides copy-on-write from the pending bits and the map alone, without reading `snapshot_mode`. The iterator removes a task from its list only after it has finished with that task, so a panic while encoding is cleaned up too. - The snapshot callbacks take a `TaskDataCategory` (`Meta` / `Data` / `All`) instead of a two-bool mask, because a persisted task always has at least one category. - The lower-layer changes are kept: the local copy-on-write buffer, stats on encoded items, and `LastPersistenceStatus`. ## Verification - `cargo test -p turbo-tasks-backend` - `cargo test -p turbo-tasks-macros-tests` - `cargo test -p turbo-tasks-backend --lib --features verify_serialization,print_cache_item_size` - `cargo clippy -p turbo-tasks-backend --all-targets -- -D warnings`, with default features and with `verify_serialization,print_cache_item_size` - Mutation check: skipping copy-on-write for tasks with pending bits made 6 tests fail. One of them shows the persisted meta bytes no longer matching the captured meta. - Failed-persist cleanup: `dropping_shards_early_leaves_no_copy_on_write_items` and `panic_while_encoding_clears_pending_flags` both failed before the shard-drop cleanup existed. Emptying the `Drop` cleanup makes both fail again. Removing a task from the list before encoding it makes only the panic test fail. The panic test is skipped on wasm, which can't unwind; the early-drop test still runs there. - wasm: `cargo test -p turbo-tasks-backend --lib --target wasm32-wasip1-threads` under `scripts/wasi-test-host` passes (108 passed, 14 ignored). - Not run: benchmarks of how long the exclusion lasts or how long a full snapshot takes. Holding the scan under the exclusion is a deliberate trade-off here. - Not run: `pnpm build-all` (this worktree has no `node_modules`). <!-- NEXT_JS_LLM --> <!-- fleet 98a896e8-00fa-4f81-97f0-48bd49e2a9a2 --> --------- Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
Josh Story authored
## Summary Loading custom routes currently writes original redirects and rewrites onto resolved configuration. Return the redirect metadata with the loaded routes for client-router filtering, and remove the unused rewrite snapshots and obsolete webpack arguments. This removes post-load config writes as part of making completed configuration immutable for adapters and other runtime consumers. ## Verification - Existing configured rewrites and redirects suite: 14 tests passed in development with both bundlers and in production with webpack. - Existing middleware redirect test exercises client navigation through a configured redirect with client-router filtering enabled in development with Turbopack and production with webpack. - Existing custom-route loader and next-types-plugin unit tests. <!-- NEXT_JS_LLM -->
-
Luke Sandberg authored
### What? During a snapshot, a task's first modification now copies the task's pre-mutation state whenever any of its categories is part of the snapshot, whichever category the modification touches. A `None` marker is inserted only for tasks with no modified category. ### Why? `track_modification` used to decide based on the touched category only. That let a snapshot persist inconsistent state. Take a task with dirty meta and clean data: 1. The snapshot begins. 2. Data is modified. Data wasn't part of the snapshot, so only a `None` marker is inserted. 3. Meta is modified. A marker is already present, so nothing is copied. 4. Persistence encodes the live meta, already mutated by step 3. ### How? The design is otherwise unchanged: `*_modified_during_snapshot` bits, `None` markers and the promotion in `end_snapshot` all stay, and nothing new happens inside the operation exclusion. Only the first-modification check in `track_modification_internal` changes, from "is the touched category modified" to "is any category modified". The copy still encodes with the live modified bits, so categories that weren't part of the snapshot aren't persisted. A regression test covers the sequence above. It checks that the persisted item carries the pre-snapshot meta and no data, and that both modifications are left for the next snapshot. <!-- NEXT_JS_LLM --> <!-- fleet 98a896e8-00fa-4f81-97f0-48bd49e2a9a2 --> Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
-
Tobias Koppers authored
### What? A failed persist (the snapshot cycle returning an error or panicking) disables persisting for the rest of the session. Later persistence cycles, including the one at shutdown, are skipped: `snapshot_and_persist` returns `Ok(None)` without starting a snapshot or GC. ### Why? A failed persist leaves the task graph and the database out of sync. For example, `save_snapshot` may already have consumed `persisted_task_cache_log` entries. Persisting again after that could write inconsistent state. Split out of #99649 as requested in review. ### How? `snapshot_in_progress` (the mutex that serializes persistence cycles) now holds a `LastPersistenceStatus { Ok, Failed }`. The backend starts at `Ok`. The status is set to `Failed` before a cycle starts and reset to `Ok` only when the cycle succeeds, so a panic also leaves it `Failed` (`parking_lot` mutexes don't poison). `Failed` is sticky for the rest of the session. Treating a disabled persist as a skipped cycle means `stop` needs no separate check. The test helper skips eviction on `None`, as it does on an error. What the existing design does with tasks the failed snapshot didn't yield is unchanged. A unit test checks that a failed persist through the noop backing storage sets the status to `Failed`, and that the next persist returns `None` and leaves the task's modification for later. The panic path has no test, since that would need a backend test hook; it was checked by reading the control flow. <!-- NEXT_JS_LLM --> <!-- fleet 98a896e8-00fa-4f81-97f0-48bd49e2a9a2 --> --------- Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
-
Luke Sandberg authored
### What? When a task that is already part of an in-progress persistence snapshot is modified again, `track_modification_internal` now bincode-encodes the task's pre-mutation state into the `SnapshotItem` that persistence will write, and stores that in the `snapshots` map. Before, it stored a `clone_snapshot()` copy of the `TaskStorage`. ### Why? The copy-on-write path exists so persistence sees a consistent snapshot even if a task is mutated while the snapshot is being written. Cloning `TaskStorage` doesn't guarantee that: cell contents are held behind `SharedReference` (`Arc`), so the clone shares them with the live task. If a cell value has interior mutability, a later mutation shows up in the "frozen" copy and the persisted state is no longer consistent. Encoding the state right away captures plain bytes that later mutations can't reach. The snapshot iterator hands the stored item straight to persistence, so nothing is encoded twice. The only cost is holding the encoded buffers in memory until the racing persistence picks them up, and this race is rare. <!-- NEXT_JS_LLM --> <!-- fleet 98a896e8-00fa-4f81-97f0-48bd49e2a9a2 --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
next-js-bot[bot] authored
-
next-js-bot[bot] authored
-
Jan Kassens authored
The world of AI is moving fast. Instead of hardcoding the available models, discover them from the CLIs. This is a bit hacky, but probably more reliable than hardcoding a list that will become outdated fast. The available models might be different for different accounts. This involved a bit of code moving as I wanted to have the model discovery run in parallel to displaying the user the harness selection to reduce delay in selecting the model. ## Test Plan: In addition to new tests, also tested interactively with: ``` DEBUG=next:upgrade node -e \ "require('./packages/next/dist/lib/upgrade/harness').handoffUpgrade('This is a harness test. Do not modify files.', process.cwd(), null).catch(console.error)" ``` -
next-js-bot[bot] authored
-
Will Binns-Smith authored
## Summary Document `next analyze export` with a snapshot capture/export example and a link to its CLI options. ## Verification - Prettier and ESLint passed. - Runtime tests not run (docs only). <!-- NEXT_JS_LLM -->
-
Andrew Clark authored
Stabilizing `forbidden()` and `unauthorized()` means the built-in 403 and 401 fallbacks are rendered into every page's payload, even for apps that don't define `forbidden.tsx` or `unauthorized.tsx`. On a fresh create-next-app that's about 2.3KB of uncompressed HTML per page (~125 bytes gzipped). I knew about the regression but I forgot that it applied to every app and every page, rather than just those that use `forbidden.tsx` or `unauthorized.tsx`. To avoid blocking the 16.4 release, we'll keep this feature in experimental for now until we fix the implementation to render the fallbacks lazily.
🤖 Generated with [Claude Code](https://claude.com/claude-code) -
Josh Story authored
## Summary Static export with a custom `distDir` currently overwrites that option with `.next` during the build. Keep the configured export destination intact and derive the intermediate build directory separately, so adapters receive the original option while their build-directory argument still points to the artifacts. This removes a post-load config mutation as part of making completed configuration immutable for adapters and other runtime consumers. Preserve support for both relative and absolute Turbopack project output paths. ## Verification - Existing adapter tests pass in both production bundlers; custom export-directory coverage passes with Turbopack. - Existing server trace suite passes with Turbopack: six tests and five snapshots. - Existing Rust API suite passes its 25 main cases and 15 snapshots in each bundler. Its RSS stabilization stress case fails locally on both this branch and unmodified canary. <!-- NEXT_JS_LLM --> --------- Co-authored-by:Jamiboy Mohammad <jamiboym@gmail.com>
-
Will Binns-Smith authored
## Summary Rename `next-browser-initial-load-optimizer` to `next-bundle-optimizer` and update the skill directory, metadata, links, and install commands. Document how to use the skill with Turbopack's bundle analyzer, with prompts for audits, fixes, and route-specific optimization. ## Verification - Prettier passed for the skill and both guides. - Runtime tests not run (docs and skill rename only). <!-- NEXT_JS_LLM -->
-
Tobias Koppers authored
## What? Task completion now cleans up the task's per-execution state (removing cells that no longer exist, `cleanup_after_execution`) under the same task lock that finishes the execution, before the completion is published (in-progress state removed, `done_event` notified). Previously the cleanup ran afterwards, under a second lock acquisition. A waiter could invalidate the task in that gap and its next execution could start. The old cleanup would then remove that execution's state, e.g. the `outdated_*_dependencies` it was just given, and could also remove cells it had created. ## Why? `collectibles_outdated_dependency` fails locally on canary (5/5 runs here) and passes in CI only by timing. Tracing showed the old cleanup observing the next collector execution already running with populated `outdated_collectibles_dependencies`, then clearing them. Later collectible emissions then made the waiting collector stale, so it executed an extra time. The optimization from #99386 assumes that bookkeeping is intact. There is a second, independent reason the test can see an extra execution: `State::set` invalidates its readers one at a time. The collector can then read the source before the source was invalidated, see the old collectibles, and legitimately re-execute when the new ones arrive. ## How? - `task_execution_completed_cleanup` now takes the held `TaskGuard`. `task_execution_completed_finish` calls it after setting output and immutability, before dropping the guard and notifying `done_event`. The canceled path still cleans up, and stale reschedules (including `verify_determinism` reruns) still skip cleanup, as before. Removed cell data is still dropped outside the critical section. - Tests: - The existing test is unchanged. Its docs now say it is timing-dependent and also covers this cleanup race. - A new gated variant stages the overlap explicitly: the collector waits until the new emitter execution has started, polls its strongly consistent source read to `Pending`, and only then lets the emitter emit. This deterministically covers the dirty-not-stale optimization, independent of `State` invalidation order. ## Verification - With the fix: both tests pass 30/30 locally, and `cargo test -p turbo-tasks-backend` passes. - Mutant (always stale on collectible change): the gated test fails 10/10. - Known limitation: there is no deterministic regression for the cleanup race itself without a backend test hook. With canary's ordering restored, the ungated test failed intermittently, between 0/20 and 8/20 depending on test layout and invocation. The fix was confirmed by tracing and by an experiment that widened the old gap. - Clippy (default and `verify_serialization,print_cache_item_size`), a `verify_determinism` check, and `cargo test -p turbo-tasks-macros-tests` pass. <!-- NEXT_JS_LLM --> <!-- fleet 98a896e8-00fa-4f81-97f0-48bd49e2a9a2 --> Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by:
Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
-
next-js-bot[bot] authored
-
Aurora Scharff authored
## Summary - explain that request-time work conflicts with the route's static requirement without repeating “fully static” - align the overlay explanations, build messages, and error pages for route body, `generateMetadata()`, and `generateViewport()` errors - replace the cookie-specific runtime-data card with short browser-data pseudocode while preserving its existing docs anchor - update the affected build-output snapshots ## Verification - `pnpm jest packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.test.ts` - formatted and linted all changed source, test, and MDX files - Not run: full package build (the isolated worktree reused an older dependency install that does not include the latest `@base-ui-components/react` packages) <!-- NEXT_JS_LLM -->
-
Aurora Scharff authored
## Summary - add API references for `turbopackGc`, `turbopackLazyDynamicImports`, `turbopackLazyDynamicImportsSSR`, and `turbopackPluginRuntimeStrategy` - document each option’s defaults, supported values, runtime behavior, and relevant limitations - cross-link related Turbopack configuration options ## Verification - Verified configuration types and defaults against the current config source and Turbopack tests - `pnpm prettier --with-node-modules --ignore-path .prettierignore --check <new-docs>` - `npx eslint --config eslint.config.mjs --fix <new-docs>` <!-- NEXT_JS_LLM --> --------- Co-authored-by:Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Jiwon Choi authored
show choice for upgrade prompt | Before | After | | --- | --- | | <img src="https://github.com/devjiwonchoi/next.js/raw/604a56efdcbf2ead22d16c3098ae695eaff7558b/before.png" alt="Upgrade prompts before: answered prompts show only the question, hint and a blank gap" width="480"> | <img src="https://github.com/devjiwonchoi/next.js/raw/604a56efdcbf2ead22d16c3098ae695eaff7558b/after.png" alt="Upgrade prompts after: each answered prompt shows the confirmed choice" width="480"> |
-
Aurora Scharff authored
## Summary - add a **Keeping pages static** guide that applies `ensureStatic = 'shell'`, `'prefetch'`, and `'navigation'` to a store, then works through the validation errors and fixes in development - expand **Optimizing prefetching** around the App Shell, per-link prefetch, and navigation stages, including how `prefetch()` and `navigation()` defer cached work - align the `ensureStatic`, `instant`, `prefetch()`, and `navigation()` references with the guide and clarify how `instant = false` affects validation - document blocking generation for complete static output in the Cache Components ISR guide and update the related migration cross-links - add reusable docs-diagram tooling and the uploaded light and dark `ensure-static-visual` and `navigation-stage-visual` assets This PR is stacked on #97801. #99355 has merged. The Client fix cards, build-output category, and `#read-the-data-on-the-client` anchors used by the guide depend on #99659 and should land first. ## Verification - Prettier and ESLint passed for the latest documentation changes through the pre-commit checks - `bash -n .agents/skills/docs-diagrams/scripts/render.sh` - guide error ordering and route output were checked against development and build output <!-- NEXT_JS_LLM --> --------- Co-authored-by:Claude Fable 5.1 <noreply@anthropic.com>
-
Benjamin Woodruff authored
We don't need to add a file path to a batch and extend the batch deadline if the path isn't contained in the invalidator map. Prevents us from getting logspam like this: ``` Turbopack has seen frequent file updates and is waiting for the filesystem to settle (0.5s elapsed so far; last modified: "/Users/bgw/v0/chat/.next/dev/server/next-font-manifest.js"). ``` This is much less critical with the non-recursive watcher codepath, as we're only watching paths we might care about, but keeping it around in both cases helps ensure we get some CI coverage of this. I could put it behind `#[cfg(debug_assert)]` for non-recursive mode, IDK. --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
Aurora Scharff authored
## What? Adds an **Optimizing the static shell** guide that follows one team settings route through focused Suspense boundaries, deferred authentication, cache-versus-stream decisions, loading-state reuse, shared layouts, and parallel routes. Updates `next-cache-components-optimizer` to use that guide and the canonical Insight pages as its framework source of truth. The original phase-based Skill workflow is preserved, including the production rig, exact test contract, trustworthy RED-to-GREEN loop, parity check, differential, and reporting. Reusable implementation guidance now links to the corresponding guide section instead of being duplicated in Skill-only references. Clarifies that the optimizer can target either a direct page load or a named client navigation. Both use the same App Shell patterns and `instant()` verification loop. When the destination App Shell is already instant and the goal is to include additional URL-specific content before a click, the Skill hands off to the Partial Prefetching optimizer. Aligns the Cache Components and Partial Prefetching optimizers around the same workflow: define the contract, reuse the production rig, prove current behavior, make the smallest optimization, verify and ship. Their framework-specific decisions remain separate. The Partial Prefetching adoption rig also receives the shared visible, committed DOM-marker rule because it uses the same `instant()` testing API. ## Why? The optimizer's framework patterns are useful outside the agent workflow. Keeping them in public docs gives developers and agents one source of truth while each Skill stays focused on its product decision and reliable production verification. ## Eval The corrected-contract comparison uses Claude Opus 4.8 and Claude Sonnet 4.5 with a fixed Claude Haiku 4.5 judge. It compares the baseline, bundled guide, production Skill from `canary`, and proposed local Skill. The bundled-guide and Skill treatments use a local Next.js tarball containing the new guide. The eval now contains 11 granular checks so product behavior, test quality, and workflow discipline are visible independently. They cover configuration, direct and client-navigation `instant()` coverage, exact shell markers, preserved data sources, reusable and request-time UI placement, all completed-route variants, viewer-cookie behavior, trustworthy RED, full-suite GREEN, and the bounded differential. The prompt names the Aurora, Nebula, unknown-release, and viewer-cookie parity cases explicitly. All eight treatments were rerun against this 11-check rubric. | Model | Treatment | Checks passed | Overall | Duration | Tokens processed | Total run cost | Cost change | | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Opus 4.8 | Baseline | 9/11 | Fail | 26m 38s | 4.83M | $4.66 | — | | Opus 4.8 | Bundled guide | 8/11 | Fail | 36m 36s | 4.99M | $5.29 | +13.5% | | Opus 4.8 | Production Skill | 9/11 | Fail | 28m 20s | 3.25M | $3.35 | -28.0% | | Opus 4.8 | Proposed Skill | **11/11** | **Pass** | 32m 9s | 5.25M | $5.24 | +12.5% | | Sonnet 4.5 | Baseline | 8/11 | Fail | 22m 31s | 2.73M | $1.29 | — | | Sonnet 4.5 | Bundled guide | 8/11 | Fail | 17m 58s | 2.38M | $1.18 | -8.1% | | Sonnet 4.5 | Production Skill | 4/11 | Fail | 27m 18s | 2.94M | $1.38 | +7.3% | | Sonnet 4.5 | Proposed Skill | 4/11 | Fail | 25m 26s | 5.49M | $2.53 | +96.1% | Token totals count each unique model message once and include uncached input, cache creation, cache reads, and output. Total run cost applies the current AI Gateway base rates to each token category. Judge cost is excluded. The eight runs processed 31.87M tokens and cost $24.91 in total, excluding the judge. This is one run per model and treatment, so the comparison is descriptive rather than a stable pass-rate measurement. The proposed Opus Skill is the only treatment to pass every check. Baseline and production Skill each passed 9/11, but both skipped the bounded differential. Baseline also missed the viewer-cookie timing lock. Production Skill omitted exact loading-state coverage. The guide-only treatment implemented the product behavior but missed an exact selector, trustworthy RED, and the differential. The proposed Sonnet Skill preserved the exact `instant()` contract, but replaced the existing runtime file read with a build-time import. It then stopped using the documented production command, encountered port conflicts from starting another Playwright server lifecycle, and never completed parity, GREEN, or a valid differential. This is a model adherence failure rather than a sandbox or credential failure. It shows that the restored workflow is sufficient for Opus but still too easy for Sonnet to abandon after it encounters test friction. ## Verification - Local Next.js build passed. - Prettier, TypeScript, ESLint through the commit hook, Alex, and diff checks passed. - Documentation link validation passed in CI. - All eight treatments finalized against the current 11-check rubric.
-
Jiwon Choi authored
-
Aurora Scharff authored
## Summary - Replace generic `Unauthorized` and `Forbidden` errors with the stable `unauthorized()` and `forbidden()` APIs across the mutating data, forms, Server Actions, data security, and `use server` documentation. - Distinguish unauthenticated requests from authenticated users who lack permission in the security examples. - Link to the API references and explain that the functions render the matching fallback files. This PR is stacked on #99696, which adds the complete pattern to the error-handling guide. ## Verification - `pnpm prettier --with-node-modules --ignore-path .prettierignore --write docs/01-app/01-getting-started/07-mutating-data.mdx docs/01-app/02-guides/data-security.mdx docs/01-app/02-guides/forms.mdx docs/01-app/02-guides/server-actions.mdx docs/01-app/03-api-reference/01-directives/use-server.mdx` - `pnpm exec eslint --config eslint.config.mjs --fix docs/01-app/01-getting-started/07-mutating-data.mdx docs/01-app/02-guides/data-security.mdx docs/01-app/02-guides/forms.mdx docs/01-app/02-guides/server-actions.mdx docs/01-app/03-api-reference/01-directives/use-server.mdx` - `NO_UPDATE_NOTIFIER=1 pnpm exec alex docs/01-app/01-getting-started/07-mutating-data.mdx docs/01-app/02-guides/data-security.mdx docs/01-app/02-guides/forms.mdx docs/01-app/02-guides/server-actions.mdx docs/01-app/03-api-reference/01-directives/use-server.mdx --quiet` - Not run: framework tests (documentation-only change) <!-- NEXT_JS_LLM -->
-
Aurora Scharff authored
## Summary - Recommend `unauthorized()` for unauthenticated requests and `forbidden()` for authenticated users without access. - Add `Suspense` boundaries around the request-time reads in the existing `notFound()` example and the new authentication example so both patterns work with Cache Components. - Add corresponding `unauthorized` and `forbidden` fallback UI examples and clarify when to use `redirect()` for sign-in flows. - Document eager fallback rendering consistently across the `error.js`, `not-found.js`, `unauthorized.js`, and `forbidden.js` references, with links between the related conventions. This builds on #99689, which stabilizes the authentication interruption APIs. ## Verification - `pnpm prettier --with-node-modules --ignore-path .prettierignore --write docs/01-app/01-getting-started/10-error-handling.mdx docs/01-app/03-api-reference/03-file-conventions/error.mdx docs/01-app/03-api-reference/03-file-conventions/not-found.mdx docs/01-app/03-api-reference/03-file-conventions/forbidden.mdx docs/01-app/03-api-reference/03-file-conventions/unauthorized.mdx` - `pnpm exec eslint --config eslint.config.mjs --fix docs/01-app/01-getting-started/10-error-handling.mdx docs/01-app/03-api-reference/03-file-conventions/error.mdx docs/01-app/03-api-reference/03-file-conventions/not-found.mdx docs/01-app/03-api-reference/03-file-conventions/forbidden.mdx docs/01-app/03-api-reference/03-file-conventions/unauthorized.mdx` - `NO_UPDATE_NOTIFIER=1 pnpm exec alex docs/01-app/01-getting-started/10-error-handling.mdx docs/01-app/03-api-reference/03-file-conventions/error.mdx docs/01-app/03-api-reference/03-file-conventions/not-found.mdx docs/01-app/03-api-reference/03-file-conventions/forbidden.mdx docs/01-app/03-api-reference/03-file-conventions/unauthorized.mdx --quiet` - Not run: framework tests (documentation-only change) <!-- NEXT_JS_LLM -->
-
Benjamin Woodruff authored
Caused by: https://github.com/vercel/next.js/pull/99406 Failure: https://github.com/vercel/next.js/actions/runs/37390479841/attempts/2 Re-running with this PR here: https://github.com/vercel/next.js/actions/runs/37404978916
-
Will Binns-Smith authored
## Summary Make the bundle analyzer explain how emitted chunks can load other chunks. This gives the initial-load optimizer skill the relationships it needs to distinguish startup code from conditionally loaded code and trace why a dependency is reachable. - Export typed load relationships for dynamic imports, async manifests, and service-worker registration. - Tie async triggers to the actual dynamically imported module. - Preserve unresolved relationships and worker modules compiled in separate graphs so missing data is not mistaken for “nothing loads.” This builds on the preceding branch’s client chunk groups and machine-readable graph export. The relationships describe possible loads at build time; browser measurements are still needed to establish what actually loads initially. ## Verification - Previously reported: Next.js package no-emit types passed. - Native dev/prod analyzer e2e and a full Rust build were not run locally due to sandbox disk capacity. Current-head CI must validate them; earlier-head results do not verify this stack. - Analyzer graph-dump and snapshot-selection unit suites were removed earlier in the stack. Their malformed-data, stream, collision, packaging, and mocked-history/path coverage has no replacement. <!-- NEXT_JS_LLM --> <!-- fleet d7bdbc2b-b0bc-4591-99eb-dccb0fa49c73 --> <!-- fleet ea768377-d71c-4a15-90b2-f4d50d4f6a1c --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
Will Binns-Smith authored
## Summary This PR exposes **chunk groups**: sets of generated client files that the build associates with a route's client entry or with client components and layouts used by that route. They show how files relate to route code, beyond which modules ended up in any one file. When a route's client output is large, the groups help an agent narrow which related files and code to inspect. A file can appear in more than one group, and layout groups can include files from multiple levels. Groups do **not** show when a browser requests a file or how many bytes one component added; overlapping groups must not be added together as independent file sets. ## Verification - The broad graph-dump converter unit suite is removed in the root and not reintroduced here; existing e2e and producer code are unchanged. The snapshot-selection unit suite is removed too, without replacement tests; its targeted mocked-history/path coverage is intentionally dropped. Neither analyzer unit suite remains; Next package no-emit types pass. Unique removed edge-case coverage was explicitly accepted. - Earlier stack verification included Rust analyzer tests, analyzer e2e and a full build; these are historical results, not validation of the new signed heads. **New-head CI is pending.** <!-- NEXT_JS_LLM --> <!-- fleet d7bdbc2b-b0bc-4591-99eb-dccb0fa49c73 --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
Will Binns-Smith authored
## Summary Before this PR, an agent could see a route's generated files and follow imports to find modules relevant to that route. It could not reliably tell **which exact modules landed in a particular JavaScript or CSS file**. This PR adds that per-file mapping, so an agent can trace a large generated file back to the modules it contains. Files that cannot be mapped are marked as such rather than shown as empty. The graph checks the module information before reporting a match. ## Verification - The broad graph-dump converter unit suite is removed in the root and not reintroduced here; existing e2e and producer code are unchanged. The snapshot-selection unit suite is removed too, without replacement tests; its targeted mocked-history/path coverage is intentionally dropped. Neither analyzer unit suite remains; Next package no-emit types pass. Unique removed edge-case coverage was explicitly accepted. - Earlier stack verification included Rust analyzer tests, analyzer e2e and a full build; these are historical results, not validation of the new signed heads. **New-head CI is pending.** <!-- NEXT_JS_LLM --> <!-- fleet d7bdbc2b-b0bc-4591-99eb-dccb0fa49c73 --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
Will Binns-Smith authored
## Summary Export typed App, Pages and API endpoint roots and nested client references from analyzer route provenance into JSON Lines `route.entries`. Keep server/shared roles separate from verified client bootstrap identities: a client reference is not another endpoint or evidence of an observed initial request. Preserve UI binary artifacts internally while agents consume semantic records. ## Verification - This layer: root TypeScript and converter unit 5/5; targeted Rust analyzer tests 3/3. Completed stack: analyzer e2e 7/7 (App, Pages, API), full build 18/18. New-head CI pending. <!-- NEXT_JS_LLM --> <!-- fleet d7bdbc2b-b0bc-4591-99eb-dccb0fa49c73 --> <!-- fleet ea768377-d71c-4a15-90b2-f4d50d4f6a1c --> --------- Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
- 05 Oct, 2026 1 commit
-
-
Luke Sandberg authored
### What? When GC collects a task, it removes each dependent's forward edge to it, as before, but no longer marks the dependent dirty. ### Why? The dirty never helps, the dependent task's previous execution is still valid. But it is also 'stale', no task should ever read it again, so providing a hint that it should be recomputed is harmful. Such a task is in a "dead but doesn't know it yet" state and so we can ignore it until its parent disconnects it. We still need to remove the edges so when the dependent is itself collected it doesn't panic because its dependencies have disappeared.
-