- 01 Aug, 2026 2 commits
-
-
next-js-bot[bot] authored
-
Hendrik Liebau authored
-
- 31 Jul, 2026 16 commits
-
-
Zack Tanner authored
## Summary When Pages Router and App Router routes coexist, a Pages Router route that returns `notFound` will internally hand rendering to the App Router not-found page. Next.js [prefers the App Router `/_not-found` entry for 404 responses](https://github.com/vercel/next.js/blob/5f5e4773bbb54f19697063ea093e8d89ca7d081a/packages/next/src/server/base-server.ts#L2965-L2980) before falling back to a Pages Router `/404` page. When deployed via an adapter, this means it would have attempted to resume the Pages entry, which wouldn't contain the relevant prerendered shell or postponed state. If the not-found page suspends, its response cannot be resumed using the metadata associated with the Pages Router output. For adapter requests, this marks the handoff with an empty postponed state. This uses the existing resume protocol to perform a complete, non-cacheable dynamic render. `next start` continues to use the normal PPR path, where it can load and resume the App Router not-found output directly. This trades PPR shell reuse for correctness only during this cross-router not-found handoff. Longer term, adapters should have an explicit contract for cross-output handoffs so they can select and resume the App Router not-found output normally, without necessarily declaring the pages router output PPR-capable. The change also documents the empty postponed-state contract and adds deployment regression coverage. ## Verification - Added an end-to-end test that verifies a Pages Router `notFound` response includes the dynamic App Router not-found content when deployed. - `pnpm testheadless test/e2e/app-dir/pages-router-app-not-found` - `pnpm --filter=next types` <!-- NEXT_JS_LLM -->
-
next-js-bot[bot] authored
-
Zack Tanner authored
## Summary [PR #96354](https://github.com/vercel/next.js/pull/96354) changed `retry()` to enforce its duration as a wall-clock budget instead of effectively treating it as a retry count. This exposed the test’s previous two-second budget, which did not reliably cover the intentional one-second `after()` delay plus deployment and ISR latency. Separates the callback delay from the ISR settling timeout and waits for timestamp reads to stabilize before establishing a baseline. <!-- NEXT_JS_LLM -->
-
Marcos Hernanz authored
## Summary Adds one protected `pull_request_target` workflow for advisory automated review of non-draft, member-authored PRs. The existing Vercel reviewer runs Codex, Claude, and synthesis with read-only GitHub access. This base-owned workflow treats that result as untrusted, validates it, and owns the only GitHub mutation. ## Write boundary - no checkout, PR code execution, dependency installation, Actions secrets, or shell interpolation - globally empty permissions; the job has only OIDC and pull-request read - exact repository, event, author association, PR state, base SHA, and head SHA validation - final read-only PR revalidation immediately before publishing - HTML comments stripped, mentions neutralized, token patterns redacted, and output capped at 48 KB - a write token is minted only after validation - exactly one top-level comment `POST` or `PATCH` - existing comments are eligible only when attributed to one of gh-sts's immutable `general` GitHub App IDs and begin with the fixed marker - both actions are pinned to immutable commit SHAs The workflow intentionally runs once on `opened` or `ready_for_review`; it does not run on `synchronize`. ## Validation - `actionlint` - Prettier - syntax validation of all three embedded `github-script` programs - upstream commit verification for both pinned actions - independent Codex and Claude autoreview The workflow remains inert until the matching gh-sts policy is approved.
-
Sam Poder authored
Pulled out of https://github.com/vercel/next.js/pull/96398, wanted to edit this a bit before pushing.
-
Sebastian "Sebbie" Silbermann authored
Saves a click. These PRs still require approval as per repo settings. The commit description is empty so that the React PRs aren't mentioned again in commits. That'd be pretty noisy for the React PRs.
-
Sebastian "Sebbie" Silbermann authored
These are equally important if not more important (since they test build adapters) than next-start tests so we now run them immediately instead of waiting for test-prod. They job is now skipped entirely for docs changes. Which saves a few seconds for docs-only changes.
-
Vercel Release Bot authored
Co-authored-by:next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
-
Sam Poder authored
#95261 began to set `module_chunks` on browser chunks so that we can track components this meant that chunks stopped always being plain path strings: ```rust if included.is_empty() && excluded.is_empty() && module_chunks.is_empty() { return EcmascriptChunkData::Simple(path); // bare string } EcmascriptChunkData::WithRuntimeInfo { .. } // object ``` This broke workers when I was testing on `vercel/front`. -
Tobias Koppers authored
### What? Makes `experimental.turbopackFileSystemCacheForBuild` (Turbopack's on-disk filesystem cache for `next build`) enabled by default, matching the dev-mode flag. It stays disabled by default in non-Vercel CI environments, and can always be turned off explicitly with `experimental.turbopackFileSystemCacheForBuild: false`. ### Why? The build filesystem cache greatly speeds up warm builds, but was previously opt-in (only auto-enabled for canary builds on the Vercel builder). Defaulting it on gives everyone faster subsequent builds, while keeping it off in non-Vercel CI where the cache is unlikely to persist between builds. ### How? - `turbopackFileSystemCacheForBuildDefault()` now returns `true` except when `isCI && !NOW_BUILDER` (removed the `isStableBuild()` gate). - The explicit `false` opt-out already works via the existing `config.experimental?.turbopackFileSystemCacheForBuild || false` read. - Adds an e2e test (`test/e2e/app-dir/turbopack-fs-cache-build-default`) asserting `.next/cache/turbopack` is written by default, empty when the flag is `false`, and empty in non-Vercel CI. - Updates the `turbopackFileSystemCache` / Turbopack docs. <!-- NEXT_JS_LLM --> --------- Co-authored-by:
vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
An unhandled rejection was previously logged by up to three independent process listeners at once: the render runtime's crash-prevention handler in `process-error-handlers.ts` (a bare `console.error`), the router server's `Log.error('unhandledRejection: ', err)`, and the dev server's `logErrorWithOriginalStack`. The runtime handler must exist on every deployment target (#77997), but on self-hosted `next start`/`next dev` it shares a process with the router server's and dev server's listeners, so a single rejection was logged multiple times in different formats. THe first commits adds a test showing the current behavior where we log multiple times. The second commit introduces `registerUnhandledRejectionListener` and `isUnhandledRejectionListenerRegistered` in `process-error-handlers.ts`, and converts the router server and dev server to check-then-register instead of installing their own rejection loggers: - The listener function is shared via a `Symbol.for` key on `globalThis`, so multiple copies of the module (e.g. in the pre-compiled server bundle and in a route module bundle) register and detect a single listener instance. - The registration check queries `process.listeners('unhandledRejection')` instead of a module-global flag, so it stays accurate even after external code calls `process.removeAllListeners`. `installProcessErrorHandlers` therefore calls the register function unconditionally. The `uncaughtException` handlers are left as they are; they have the same duplication and could be consolidated the same way in a follow-up. -
Zack Tanner authored
## Summary Fix the build output for App Router `not-found` routes that get partially prerendered when cacheComponents is enabled. Previously, Next.js treated any statically generated `/_not-found` route as a complete static 404, even when it contained postponed state. It copied the partial HTML shell to `server/pages/404.html` and omitted the corresponding `/_not-found` prerender from adapter outputs. This change distinguishes fully static not-found routes from partially prerendered ones. Fully static routes retain the existing `404.html` behavior, while PPR routes remain resumable prerender outputs. This allows a `not-found.tsx` that suspends under Cache Components to render its dynamic content when deployed. Closes https://github.com/vercel/next.js/pull/96399 ## Testing Expanded `not-found-non-document-dynamic` coverage to verify that: - dynamic not-found content renders for ordinary missing paths - dynamic not-found content renders when `/_not-found` is selected by a rewrite - a PPR not-found does not emit `server/pages/404.html` - its adapter output includes `PARTIALLY_STATIC` metadata, postponed state, and a resume chain Also verified that fully static App Router not-found routes continue to emit and serve `pages/404.html`. - `__NEXT_CACHE_COMPONENTS=true pnpm test-start-turbo test/e2e/app-dir/not-found-non-document-dynamic/not-found-non-document-dynamic.test.ts` - `pnpm test-start-turbo test/e2e/app-dir/not-found/basic/index.test.ts`
-
Sebastian "Sebbie" Silbermann authored
-
Sam Poder authored
Built using @sokra's Fleet! This re-arranges all of our chunking experimental features under `experimental.turbopackChunking` and adds the following options: ```javascript /** * Avoid creating more than one chunk smaller than this size, in bytes. Smaller * chunks are merged into bigger ones to avoid that. Defaults to `50000` (50 KB). */ minChunkSize?: number /** * Avoid creating more than this number of chunks per chunk group. Chunks are * merged into bigger ones to avoid that. Defaults to `40`. */ maxChunkCountPerGroup?: number /** * Never merge chunks bigger than this size, in bytes, with other chunks. This keeps code * in big chunks from being duplicated across multiple chunks. Defaults to `200000` (200 KB). */ maxMergeChunkSize?: number /** * Minimum size, in bytes, for a component chunk to be emitted on its own when * `generateComponentChunks` is enabled. Component chunks smaller than this are folded into a * single remainder chunk. Defaults to `20000` (20 KB). */ minComponentChunkSize?: number ```
-
Andrew Clark authored
When a static fallback shell is served as-is — e.g. from a CDN in a deployed environment — the client can't hydrate from inline Flight data; it fetches the full RSC payload separately and reconstructs the initial payload on the client. During that reconstruction, the head's partiality flag was accidentally set to the head itself. Since the head is always truthy, the head was unconditionally treated as partial. This happens to be unobservable today: the only flows that reach the reconstruction are fallback-shell prerenders, where the server pessimistically marks the head partial anyway, and when Cache Components is enabled the client ignores the per-payload flag entirely in favor of response-level partiality. But we're about to rework the RSC response format so that head partiality has a single, load-bearing source of truth, so the flag needs to survive the reconstruction correctly rather than by coincidence. While auditing the payload consumers, I also fixed the payload shape check in segment prefetch generation (it used `&&` where `||` was intended, so it accepted any shape) and deleted `should-hard-navigate.ts`, which no longer has any callers on the client. Adds e2e coverage asserting that metadata survives hydrating a fallback shell page: the title is correct after hydration, the head is included in prefetched data, and a return navigation is served entirely from the cache that was populated during initial hydration. In deployed environments this exercises the client resume path, which is where the reconstruction runs.
-
- 30 Jul, 2026 17 commits
-
-
next-js-bot[bot] authored
-
Sam Poder authored
Closes https://github.com/vercel/next.js/issues/96333 by re-ordering the statements in `get_side_effect_free_declaration`. The rest of this PR is then a test + adding to a test fixture. This seems like a reasonable change to me as we'd match Webpack's behaviour. --------- Co-authored-by:
Luke Sandberg <lukesandberg@users.noreply.github.com>
-
Sam Poder authored
At the time we had assumed that these components would not be helpful, however, things can get put in the remainder that can be used on other routes so it is worthwhile to keep track of them.
-
Will Binns-Smith authored
This updates to nightly-2026-07-29 --------- Co-authored-by:
vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com> Co-authored-by:
Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
-
Zack Tanner authored
## Summary `shouldWaitOnAllReady` previously allowed an otherwise dynamic App Router render to wait for every Suspense boundary before sending the response. After [#96367](https://github.com/vercel/next.js/pull/96367), no caller enables this behavior anymore. This removes the unused option and makes `supportsDynamicResponse` the sole signal for whether App Router generates static HTML. Static generation still waits for `allReady`, while dynamic responses continue streaming. <!-- NEXT_JS_LLM -->
-
Vercel Release Bot authored
Co-authored-by:next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
-
Zack Tanner authored
## Summary DOM-capable crawlers can consume streamed metadata, but with cacheComponents enabled, it treated them like HTML-limited bots and forced a full dynamic render. This meant capable crawlers could not use the prerendered shell even when they were not matched by `htmlLimitedBots`. This change lets DOM-capable crawlers follow the normal PPR shell and streaming-metadata path. `htmlLimitedBots` remains the source of truth for requests that need blocking metadata, including when a custom pattern explicitly matches a DOM-capable crawler. ## Test Plan Tests were added that contained a Suspense boundary that intentionally never resolves. The test reads the response stream until it receives the fallback, then verifies that blocking metadata has already been emitted while the unresolved page content has not. A fully buffered response would never return, so this avoids relying on timing or arbitrary delays. This PR is stacked on #96366.
-
Zack Tanner authored
## Summary Expand Cache Components metadata streaming coverage across the default, custom, and wildcard `htmlLimitedBots` configurations. The active matrix now covers regular user agents, configured HTML-limited bots, built-in bot classifications, metadata placement for static and dynamic routes, PPR shell behavior, streaming versus buffered responses, and hydration after revalidation. It replaces the skipped legacy PPR metadata suite with active Cache Components coverage.
-
Steven authored
I noticed that this last question for AGENTS.md doesn't have any blue highlighted word. So I made AGENTS.md blue to follow the convention of the others. <img width="865" height="163" alt="image" src="https://github.com/user-attachments/assets/d10f74e1-f5ec-4c8a-9c6d-8d01b9c1abf3" /> --------- Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
dan authored
Extends the bench to run the edge versions of React SSR fixture. Co-authored-by:Claude Fable 5 <noreply@anthropic.com>
-
Vercel Release Bot authored
-
David Alexandru Ilie authored
## Summary - treat Fragment instances without client rects as unavailable route scroll targets - leave the shared scroll signal unconsumed so another changed segment can handle an empty route Fragment - avoid focus and scroll side effects when an empty segment cannot claim ownership - consume and clear an explicit hash intent when no matching target exists, without falling back to route content - cover empty and visible intercepted routes across both scroll handlers, including focus preservation and real hash scrolling This PR is stacked on #96323, which provides the minimal reproduction. ## Verification - `HEADLESS=true pnpm test-dev-turbo test/e2e/app-dir/parallel-routes-scroll-owner/parallel-routes-scroll-owner.test.ts` (8/8) - `HEADLESS=true pnpm test-dev-webpack test/e2e/app-dir/parallel-routes-scroll-owner/parallel-routes-scroll-owner.test.ts` (8/8) - `HEADLESS=true pnpm test-dev-turbo test/e2e/app-dir/navigation-focus/navigation-focus.test.ts` (5/5) <!-- NEXT_JS_LLM -->
-
Marcos Hernanz authored
## What changed Tracked output and cell reads now acquire the target task first. If the target is already immutable, the read skips locking the reader task because no dependency edge can be added and the target cannot be invalidated. Mutable targets drop the speculative target lock and reacquire the target/reader pair together, preserving the existing invalidation-race guarantee. `verify_immutable` deliberately retains the pair-lock path. Listener diagnostics also preserve the tracked reader ID when the fast path skips its guard. The separate current-task ID cache is in #96180. This PR is now backend-only so the lock-ordering change can receive focused backend review. ## Why The previous path locked both the target and reader task for every tracked read. That synchronization is necessary for mutable targets but redundant once the target is immutable. Instrumentation found that 1,541,880 of 4,501,364 sampled tracked reads (34.254%) could use the bypass. ## Performance evidence Measured at `0950e8ae` on a dedicated 8-vCPU/16-GiB Vercel Sandbox with frozen side-by-side binaries. These measurements are directional evidence, not precise estimates. Small percentage changes are difficult to resolve reliably. This campaign and #96180's incremental campaign used separate run sets: the absolute endpoint here does not match #96180's starting point, which demonstrates cross-campaign noise. The values must not be compared across PRs, and their percentages must not be added. ### Browser-driven HMR, 30-second B/C/C/B - Evaluation: 20.771360 → 19.176645 ms (**-7.677%**) - Commit: 21.714832 → 20.371425 ms (**-6.187%**) ### Production builds - First 12-campaign matrix: **-1.931%** - Complementary 12-campaign matrix: **-1.990%** - Combined 24-campaign aggregate: **-1.959%** Five of six balanced blocks favored the candidate. The conservative six-block 95% interval was -4.042% to +0.248%, so the production estimate is supporting evidence rather than a precise claim. ### Causal profiles - HMR `Storage::access_pair_mut` self time fell from 3.19%/3.19% to 1.21%/1.18%. - HMR voluntary context switches fell 32.898%. - Production pair-access self time and voluntary context switches also fell; production voluntary switches changed -14.552%. - All accepted perf captures reported zero lost samples. ## Validation On the exact backend-only head (`9ccfd6753526f716466a9584fba8c8753b7d83bf`): - Complete `turbo-tasks-backend` package tests, integrations, and doctests - Complete backend package matrix with `--features verify_immutable` - `cargo fmt --check -p turbo-tasks-backend` - `cargo clippy -p turbo-tasks-backend --all-targets -- -D warnings` - `git diff --check` - Conflict-free merge-tree check against current `canary` (`5cdcbbb0`)
-
Vercel Release Bot authored
Co-authored-by:next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
-
Zack Tanner authored
## Summary Adds a minimal App Router regression test for a soft navigation where an empty parallel route is rendered after persistent page content. The test runs with `appNewScrollHandler` both disabled and enabled. The legacy-handler case passes normally, while the new-handler case uses `it.failing` to highlight the regression.
-
Sebastian "Sebbie" Silbermann authored
-
Janka Uryga authored
Closes NAR-854 ### TLDR New approach to #94949. We can work around the problem of debug info getting clamped when re-serializing by doing more work, which should be good enough unless we can figure out the correct way to adjust the clamping behavior in react. ### The problem Before this PR, instant validation works like this: 1. deserialize the full page payload (in stages) 2. reserialize each segment (in stages) 3. reassemble the segments into a combined payload, varying the stage per segment as needed Unfortunately, in step 2, we lose timing debug info that tells us when IO operations started/ended: https://github.com/facebook/react/blob/c235eb40f1c3121798d233bf992fd8f8c8558d06/packages/react-server/src/ReactFlightServer.js#L5550-L5553 This means that even if we provide an appropriate `endTime` during step 3, no IO info will be omitted by `filterDebugInfo`, because it was all re-timed to when the render occurred. In practice, this means that when we report a blocking dynamic hole, it might point to a different await than the one that was actually blocking in the stage that we rendered the segment in. ### The solution (h/t to @gnoff for coming up with this trick) We can work around this problem with no changes in React. We just have to apply an `endTime` when deserializing the payload for the first time, before reserializing each segments. However, this means that we can no longer disassemble the payload into segments in one pass -- e.g. if we trim the debug info to what it'd be in the `Static` stage, we can't get good data for the `Runtime` stage anymore. So we have to run the segment disassembly separately for each stage we care about. The debugInfo can now vary depending on the stage, we need to change the shape of `SegmentCacheItem`. Previously, it was like this: ``` '/foo': chunks: Static: [...] Runtime: [...] Dynamic: [...] debugChunks: [...] ``` But to account for the varying debug info, we now need to store the partial chunks, the complete chunks, and the debug chunks separately for each stage: ``` '/foo': Static: chunks: [...] allChunks: [...] debugChunks: [...] Runtime: chunks: [...] allChunks: [...] debugChunks: [...] Dynamic: ... ``` Most of the changes in the PR come from adjusting the code to - create separate entries for each segmentPath + stage in the new way outlined above, using an `endTime` based on the stage - consume the cache entry appropriately
-
- 29 Jul, 2026 5 commits
-
-
next-js-bot[bot] authored
-
Adham Fayrouz authored
Updates the Progressive Web Apps guide’s Offline Support section to point the primary Serwist + Next.js example at [`next-turbo-basic`](https://github.com/serwist/serwist/tree/main/examples/next-turbo-basic) (Turbopack), and keeps a note linking the webpack-based [`next-basic`](https://github.com/serwist/serwist/tree/main/examples/next-basic) example. <!-- 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? Updates the Progressive Web Apps guide’s Offline Support section to point the primary Serwist + Next.js example at `next-turbo-basic` (Turbopack), and keeps a note linking the webpack-based `next-basic` example. ### Why? Turbopack is the default bundler, so the main docs link should match that setup. Webpack users still need a clear path to the older example without treating webpack as the default. ### How? In `docs/01-app/02-guides/progressive-web-apps.mdx`, changed the Serwist docs link from `examples/next-basic` to `examples/next-turbo-basic`, and rewrote the note to link `examples/next-basic` for webpack. Closes NEXT- Fixes # --> --------- Co-authored-by:
Joseph <sephxd1234@gmail.com>
-
Joseph authored
Dynamic pages (all pages in dev), blur and select the body as `activeElement`. - [x] e2e for https://github.com/vercel/next.js/issues/96050 - [ ] attempt a fix that prevents blur
-
Zack Tanner authored
## Summary When PPR is enabled, requests matching a custom `htmlLimitedBots` pattern could still use the prerendered route path. As a result, the configured blocking-metadata behavior was not applied consistently. Use the existing streaming-metadata decision when selecting the PPR render path. Built-in bots retain their existing fully buffered behavior, custom HTML-limited bots can continue streaming body content after metadata resolves, and regular user agents remain unchanged. ## Verification - HEADLESS=true pnpm test-start-turbo test/e2e/app-dir/html-limited-bots-ppr/html-limited-bots-ppr.test.ts - HEADLESS=true pnpm test-start-webpack test/e2e/app-dir/html-limited-bots-ppr/html-limited-bots-ppr.test.ts Co-authored-by:Sebastian Silbermann <sebastian.silbermann@vercel.com>
-
Joseph authored
Note that https://github.com/advisories/GHSA-6g55-p6wh-862q does not affect Next.js users unless they build from untrusted source code (which would have more severe security implications). We're merging this to reduce noise from security scanners. - 8.5.21 is 50h+ old so it can be installed - 8.5.22 is still under 48h - valid at 2026-07-24 08:48:15 UTC Closes: https://github.com/vercel/next.js/issues/96349
-