- 10 Feb, 2026 14 commits
-
-
nextjs-bot authored
-
Will Binns-Smith authored
This PR mostly moves existing code. Most of the diff churn is from re-recording shapshots. This PR is nowhere as scary as the diffstat would have you believe. This extracts the core HMR client logic, abstracting away hooks for platform-specific features like the websocket transport and page reload. In a future PR this will be implemented as an in-process backend for nodejs server hmr. Test Plan: CI, existing hmr tests -
Janka Uryga authored
This PR makes instant validation work for client navigations, albeit in a pretty inefficent way. If we're navigating and have an `instant` config somewhere in the tree, we won't skip shared layouts like a client navigation usually would. Instead, we render all the shared segments too (via `createFullTreeFlightDataForNavigation`, a very simplified variation of `walkTreeWithFlightRouterState`) and use them to perform instant validation on the current page. The client router doesn't mind getting extra segments -- `startPPRNavigation` (and `updateCacheNodeOnNavigation` specifically) ignore segments that are already present in the old tree. This approach has some downsides: - It doesn't match prod behavior (parent layouts don't render there), so it could lead to user confusion - We're validating using different segments that the browser actually has, so we could see an error in the validation that isn't present in the browser but we'll iterate on this later. We only do this when a page is using `instant`, so for now the impact is narrowed down to early adopters. ### Test changes For each test case we have, we now run it both on initial load and on client nav. This got somewhat noisy because i had to reorganize the test files a bit. We use the index pages to test client navigations, but in order to do that, we need the source and the target to be inside the same root layout -- otherwise, they'd be an MPA nav.
-
Will Binns-Smith authored
This change moves runtime code that does not use a module system and is concatenated by Rust into a dedicated `runtime/` directory so it's not confused with other code. It also codifies this in a README and instructs agents to read nearby READMEs so they enforce this convention. **This change only moves code and does not refactor any further.** Snapshot updates reflect the new file paths in the generated runtime code. **Test Plan:** CI, existing tests
-
Will Binns-Smith authored
This adds some basic JavaScript/TypeScript infrastructure for Next to receive and handle server-side HMR updates from Turbopack. This: - Renames some existing hmr code as explicitly client hmr - Adds counterpart apis for server hmr (e.g. subscribe to server HMR events via `project.serverHmrEvents()`) - Add `__turbopack_server_hmr_apply__` runtime function (this is a stub for now, just logs on updates) **Alternatives considered** A single firehose for hmr events, pushing the filtering to the JS side. I figured separate dedicated apis would be cleaner since they’d have to be filtered and switched on anyway. **In future PRs** - Rust: Make Turbopack send 'partial' updates for server file changes - Node dev runtime: Implement module factory replacement in `__turbopack_server_hmr_apply__` - add client notification to trigger re-fetch of rsc - e2e tests
-
nextjs-bot authored
-
Will Binns-Smith authored
Analagous to the existing compile-path, which records compile times for each path in development, we now record path render times as `render-path`. It corresponds with the value we write to the tty when rendering routes (e.g. `GET / 200 in 228ms (compile: 129ms, render: 99ms)`). This change also adds tests for recording hmr data in the trace file. Test Plan: - CI - Made changes in a test app and verified the trace file included valid entries for these. Confirmed the duration matched what was shown in the cli.
-
Niklas Mischkulnig authored
The fixture contains both App and Pages router But the assertions only ever tested the App endpoints Fixed by https://github.com/vercel/vercel/pull/14878 There is still a bug in the builder: ``` FAIL webpack test/e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts (57.396 s) not-found-with-pages-i18n ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo (3528 ms) ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /foo (401 ms) ✓ should prefer the app router 404 over the pages router 404 when both are present - SSR /app-dir/foo (141 ms) ✕ should prefer the app router 404 over the pages router 404 when both are present - SSR /foo (249 ms) ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo expect(received).toBe(expected) // Object.is equality Expected: "APP ROUTER - 404 PAGE" Received: "PAGES ROUTER - 404 PAGE" 27 | 28 | await browser.loadPage(next.url) > 29 | expect(await browser.elementByCss('h1').text()).toBe( | ^ 30 | 'APP ROUTER - 404 PAGE' 31 | ) 32 | } at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:29:55) ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /foo expect(received).toBe(expected) // Object.is equality Expected: "APP ROUTER - 404 PAGE" Received: "PAGES ROUTER - 404 PAGE" 22 | async (s) => { 23 | const browser = await next.browser(s) > 24 | expect(await browser.elementByCss('h1').text()).toBe( | ^ 25 | 'APP ROUTER - 404 PAGE' 26 | ) 27 | at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:24:55) ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - SSR /foo expect(received).toContain(expected) // indexOf Expected substring: "APP ROUTER - 404 PAGE" Received string: "<!DOCTYPE html><html lang=\"en\" data-dpl-id=\"dpl_BM4HgVbmReroGBTz3augsyMX43xG\"><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/polyfills-42372ed130431b0a.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\"></script><script src=\"/_next/static/chunks/webpack-70c336f9a46f13b1.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/framework-8c604becf61eba86.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/main-16ce12b5863057b2.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app-688aa0c7241baf30.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/404-b7a49e5d00a03545.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_buildManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_ssgManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script></head><body><div id=\"__next\"><div><h1>PAGES ROUTER - 404 PAGE</h1><p>This page is using the PAGES ROUTER</p><p>Custom message fetched at build time</p></div></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"message\":\"Custom message fetched at build time\"},\"__N_SSG\":true},\"page\":\"/404\",\"query\":{},\"buildId\":\"build-TfctsWXpff2fKS\",\"isFallback\":false,\"isExperimentalCompile\":false,\"gsp\":true,\"locale\":\"en\",\"locales\":[\"en\",\"en-GB\"],\"defaultLocale\":\"en\",\"scriptLoader\":[]}</script></body></html>" 38 | const ssr = await next.fetch(s) 39 | expect(ssr.status).toEqual(404) > 40 | expect(await ssr.text()).toContain('APP ROUTER - 404 PAGE') | ^ 41 | } 42 | ) 43 | }) at toContain (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:40:32) ```
-
Tim Neutkens authored
### What? Reduces memory retention in two areas: response stream cleanup in `cloneResponse` and unnecessary runtime style initialization in Turbopack mode. Also adds a test fixture for standalone mode fetch memory leak detection. ### Why? Based on the reproduction provided in #85914, investigating potential sources of memory retention. When a `ReadableStream` is tee'd, both branches must be cancelled to release connection resources — previously only one branch was registered for GC cancellation. Additionally, `RuntimeStyles` and `_N_E_STYLE_LOAD` were always initialized even in Turbopack mode where they are unused. ### How? **`clone-response.ts`**: Register both `cloned1` and `cloned2` bodies with the `FinalizationRegistry` so that when either response is garbage collected, its stream branch is properly cancelled. **`app-router.tsx`**: Guard `_N_E_STYLE_LOAD` and style tracking `Set` initialization behind `!process.env.TURBOPACK && typeof window !== 'undefined'`. Rename the component to `RuntimeStylesForWebpack` and skip rendering it entirely when using Turbopack. Fixes #85914 --------- Co-authored-by:Unghee Lee <unghee66@gmail.com>
-
Hendrik Liebau authored
Follow-up to #89610. Adds an e2e test that detects linear heap growth caused by unclosed prefetch response streams. The test cycles through mounting/unmounting links to trigger repeated prefetches and LRU evictions, then uses CDP heap profiling with linear regression to verify the heap plateaus rather than growing steadily. 
-
Abhishek Mardiya authored
There’s an inconsistency in the docs: [unstable_cache](https://nextjs.org/docs/app/api-reference/functions/unstable_cache) has already been replaced by use cache, so I think the documentation should be updated accordingly. I’d appreciate it if you could look into this, should that be the case. @icyJoseph <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Niklas Mischkulnig authored
A few calls were missing `shouldCache`
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
- 09 Feb, 2026 9 commits
-
-
nextjs-bot authored
-
Luke Sandberg authored
We got a min and a max mixed up, so we treated all systems as if they had 64 cores and actually could overflow the usize on larger systems.
-
Hendrik Liebau authored
Previously, `createPrefetchResponseStream` intentionally never called `controller.close()` on the wrapper stream, to prevent React Flight from erroring on unresolved references (dynamic holes). However, Chrome and Firefox keep unclosed ReadableStreams with pending reads as native GC roots, preventing the stream — and the entire FlightResponse captured in the `reader.read().then(progress)` closure chain — from being garbage-collected. Now that React Flight supports `unstable_allowPartialStream` as an option for `createFromReadableStream` (facebook/react#35731), we can close the stream normally. Flight will mark unresolved chunks as "halted" instead of erroring, which is the correct behavior for prefetch responses. Also removes the now-unnecessary `createUnclosingPrefetchStream` wrapper from the legacy prefetch path in `fetch-server-response.ts`. closes #89485
-
nextjs-bot authored
[diff facebook/react@2dd9b7cf...272441a9](https://github.com/facebook/react/compare/2dd9b7cf...272441a9) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/35731 - https://github.com/facebook/react/pull/35730 </details>
-
Daniel Tao authored
Fixes #89620 Fix `findClosestQuality` returning `0` when the `quality` prop on `<Image>` is set to a low value (e.g. `quality={1}`), which causes the image optimization server to reject the request with a 400 error. ### Cause The `reduce` call in `findClosestQuality` used `0` as its initial accumulator. Since `0` is not a valid quality value (must be 1-100), it would win the "closest" comparison for any `quality <= 37` with the default `qualities: [75]` config. This produced `q=0` in the image URL, which the server rejects. ### Fix Description Changed the `reduce` initializer from `0` to `config.qualities[0]`. This is safe because the early return above already handles the empty array case, so `config.qualities[0]` is always defined when reached. Added a unit test for `quality=1` with `qualities=[75]` to verify it returns `75` instead of `0`. --------- Co-authored-by:Steven <steven@ceriously.com>
-
shadcn authored
### What? Moves the `fontName.variable` from `<body />` to `<html />` ### Why? This ensures that portalled elements receives the right font when used with `:root { }` Co-authored-by:Tim Neutkens <tim@timneutkens.nl>
-
Joseph authored
Removing examples that we are not using, or maintaining anymore.
-
JJ Kasper authored
Our reset script was failing from invalid body shape: ```sh Error: Create project failed. Got status: 400, {"error":{"code":"bad_request","message":"Invalid request: should NOT have additional property `env`."}} ``` x-ref: https://github.com/vercel/next.js/actions/runs/21793009770/job/62875798461 x-ref: https://github.com/vercel/next.js/actions/runs/21807482052/attempts/1 -
Benjamin Woodruff authored
Turbopack: Remove old `Vc::try_resolve_*` methods in favor of the `ResolvedVc` alternatives (#89696) These `try_resolve_*` methods predate the introduction of the `ResolvedVc` type. `ResolvedVc` has efficient synchronous `try_downcast`/`try_sidecast` functions, and there are only a few callsites that need to do this, so it makes more sense to split the resolution and the casting into to separate calls.
-
- 08 Feb, 2026 9 commits
-
-
nextjs-bot authored
-
Ben Brook authored
Co-authored-by:
bencmbrook <7354176+bencmbrook@users.noreply.github.com> Co-authored-by:
Cursor Agent <cursoragent@cursor.com>
-
Tobias Koppers authored
## What? Added a new section "Task Decomposition and Verification" to AGENTS.md that provides guidance on breaking down work into smaller, verifiable tasks and establishing verification practices before moving to the next step. ## Why? This guidance helps ensure that AI agents (and developers) work systematically by: - Breaking complex goals into incremental, independently verifiable steps - Establishing clear verification checkpoints before proceeding - Choosing appropriate verification methods for different types of changes - Asking for clarification when verification approaches are unclear This promotes more reliable and traceable development practices. ## How? Added four bullet points under a new "Task Decomposition and Verification" section that outline: 1. How to split work into smaller, verifiable tasks upfront 2. The importance of verifying each task before moving forward 3. Guidance on selecting appropriate verification methods (tests, type checking, linting, builds, etc.) 4. When and how to ask users for clarification on verification approaches https://claude.ai/code/session_012eJNxH5NRUHKdAaNpz4Yr6Co-authored-by:
Claude <noreply@anthropic.com>
-
nextjs-bot authored
[diff facebook/react@95ffd6cd...2dd9b7cf](https://github.com/facebook/react/compare/95ffd6cd...2dd9b7cf) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/35724 - https://github.com/facebook/react/pull/35711 - https://github.com/facebook/react/pull/35710 - https://github.com/facebook/react/pull/35708 - https://github.com/facebook/react/pull/35705 - https://github.com/facebook/react/pull/35700 </details>
-
Robert Webb authored
Note that this is my first contribution in Rust, so let me know if I missed anything idiomatic or if there is a particularly better way to do something. Also, I did not use AI to create this at all, although I did chat a bit to try to wrap my head around types. - Related issues linked using Fixes https://github.com/vercel/next.js/issues/88533 - Tests added. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md Summary of changes: Adds support for all of the attributes of `@import` for Turbopack, by modifying the turbopack-css package, including Layer, Media and Supports. [W3 Reference](https://www.w3.org/TR/css-cascade-5/#at-import) --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Luke Sandberg authored
Remove the field and corresponding generic type parameter. These are unused as of #88492
-
Luke Sandberg authored
# Implement Inline Value Storage in SST Files This PR enhances the Static Sorted Table (SST) file format by implementing inline value storage for small values (≤8 bytes). Instead of storing these small values in separate value blocks, they are now stored directly in the key blocks, which: 1. Reduces indirection overhead (8 bytes per value) 2. Improves read performance by eliminating an extra lookup 3. Reduces the total size of SST files The implementation: - Adds a new `EntryValue::Inline` variant for values ≤8 bytes - for values <=8 bytes the 'small value' encoding is pure overhead (8 bytes to address <=8 bytes). This threshold was chosen to not regress key block sizes. * from an 'overall data perspective' inline is beneficial for basically all acceptable value sizes. However, it will very likely regress binary search performance to stuff maximally large values inline, so we don't do this for now. - Introduces key block entry types 8-255 to encode inline values (supporting up to 247 bytes) - Updates the README to document the inline value format - Enhances `ArcSlice` with a new `slice_from_subslice` method for zero-copy access to inline values - Adds a `Read` implementation for `ArcSlice<u8>` to support streaming reads -
Tobias Koppers authored
### What? When AMQF is not available performance will degrade significately. So we want to make sure that AMQF is always cached. This removes the AMQF cache, which tends to overflow with very large databases. ### read, get, key = 8, value = 4, commits = 1, compacted, hit, uncached | entries | | Baseline | | This PR | | Change | | -------- | ---- | --------- | ---- | --------- | ---- | ------------------ | | 10.67Mi | 1.0x | 20.55 µs | 1.0x | 20.55 µs | 1.0x | ~same | | 21.33Mi | 2.0x | 23.30 µs | 1.1x | 23.30 µs | 1.1x | ~same | | 42.67Mi | 4.0x | 37.18 µs | 1.8x | 37.18 µs | 1.8x | ~same | | 85.33Mi | 8.0x | 27.80 µs | 1.4x | 27.80 µs | 1.4x | ~same | | 128.00Mi | 12x | 33.07 µs | 1.6x | 86.24 µs | 4.2x | 2.4x - 2.8x slower | | 170.67Mi | 16x | 807.11 µs | 39x | 180.47 µs | 8.8x | 4.1x - 4.8x faster | | 341.33Mi | 32x | 992.15 µs | 48x | 283.60 µs | 14x | 3.2x - 3.8x faster | ### read, get, key = 8, value = 4, commits = 1, compacted, miss, uncached | entries | | Baseline | | This PR | | Change | | -------- | ---- | --------- | ---- | --------- | ---- | -------------------- | | 10.67Mi | 1.0x | 302.07 ns | 1.0x | 302.07 ns | 1.0x | ~same | | 21.33Mi | 2.0x | 465.93 ns | 1.5x | 465.93 ns | 1.5x | ~same | | 42.67Mi | 4.0x | 757.96 ns | 2.5x | 757.96 ns | 2.5x | ~same | | 85.33Mi | 8.0x | 1.47 µs | 4.9x | 1.47 µs | 4.9x | ~same | | 128.00Mi | 12x | 4.30 µs | 14x | 367.02 ns | 1.2x | 5.9x - 23.0x faster | | 170.67Mi | 16x | 21.89 µs | 72x | 731.82 ns | 2.4x | 19.4x - 43.3x faster | | 341.33Mi | 32x | 39.28 µs | 130x | 972.98 ns | 3.2x | 31.5x - 52.7x faster |
-
Tobias Koppers authored
### What? They are basically identical to the cached variants and therefore not needed
-
- 07 Feb, 2026 6 commits
-
-
nextjs-bot authored
-
JJ Kasper authored
If an old version of the CLI is cached on a CI runner but still in the old range it can cause this test to fail. x-ref: [slack thread](https://vercel.slack.com/archives/C07UCHRBWGK/p1770501780921239?thread_ts=1770499294.893139&cid=C07UCHRBWGK)
-
Hendrik Liebau authored
Previously, unused argument omission was only applied to `"use cache"` functions called from the client (#72506). This enables it for server actions as well, and optimizes `omitUnusedArgs` to trim trailing unused arguments from the sparse array, so that nothing is sent to the server for those instead of `undefined`.
-
JJ Kasper authored
This is causing conflicts as the name value is relied on too much since it can differ heavily e.g. for `src` dir and if not. x-ref: https://github.com/vercel/next.js/actions/runs/21767409431/job/62826336354#step:34:240 Reverts vercel/next.js#89559
-
JJ Kasper authored
These are too specific as `charset` is valid to be included in the `content-type` as well so this loosens the assertion. x-ref: https://github.com/vercel/next.js/actions/runs/21767409431/job/62826336346#step:34:339 x-ref: https://github.com/vercel/next.js/actions/runs/21767409431/job/62826336379#step:34:294
-
JJ Kasper authored
This expands test suite for deferred entries experimental handling and fixes missing handling for metadata routes and route handlers when building the non-deferred entries.
-
- 06 Feb, 2026 2 commits
-
-
Maikel van Dort authored
### What? Fix deprecated warning: "Use Object.assign instead of deprecated util._extend" from http-proxy (which hasn't been updated for 5 years) ### Why? ### How? Fixes #74460 In favour of https://github.com/vercel/next.js/pull/81544 (which didn't use a patch, but manually updated the compiled version)
-
nextjs-bot authored
-