- 21 Jan, 2026 10 commits
-
-
nextjs-bot authored
-
Hendrik Liebau authored
When deployed, the sentinels where showing `at runtime` instead of `at buildtime`. There are two reasons for this: 1. The page sentinel was accidentally rendered in a client component, which causes a hydration mismatch, and the value toggling from `at buildtime` to `at runtime` when the page is hydrated before the assertion is done. 2. The middleware was setting sentinel cookies that are intended for the `/cookies/*` pages, but not for the `/server-action-inline` page. This caused the server action (which is triggered in the second test) to consider the page as revalidated, which then led the client router to refetch the page. With `next start` this is not a problem because the RSC response is prerendered at build time, and returned as a static file, which contains the correct sentinel values. However, when deployed on Vercel, the RSC request results in an ISR cache miss for some reason, which causes the page to be revalidated (with runtime sentinel values), and then the third test fails when it receives the regenerated response instead of the build-time prerender result. This needs to be investigated separately, but for now we disable the middleware from setting cookies on this page to prevent the ISR revalidation request. closes #88817 closes NAR-740 > [!TIP] > Best reviewed with hidden whitespace changes.
-
Tobias Koppers authored
### What? Improve the feature flag to show compressed size
-
Hendrik Liebau authored
The recent change to always run all tests without aborting on failure (#88435) inadvertently broke manifest generation. Previously, test output was emitted for all tests when `NEXT_TEST_CONTINUE_ON_ERROR` was set, but that variable was removed. Now test output is only emitted for failing tests, causing the manifest to lose all passing test entries. This adds a new `NEXT_TEST_EMIT_ALL_OUTPUT` environment variable that restores the full output behavior specifically for the manifest generation workflows.
-
Niklas Mischkulnig authored
-
Tobias Koppers authored
### What? Use amortized shrinking. Capacity should always be a power of 2. We shrink when len is capacity / 3. Assuming the capacity was `2^x` we shrink to `2^(x-1)` which is `capacity / 2`. Therefore capacity is still larger than len, which avoids direct reallocation when items are added again.
-
Niklas Mischkulnig authored
-
Hendrik Liebau authored
-
Andrew Clark authored
This change adds infrastructure for a planned client-side optimization where the router can infer route structure from previously prefetched routes, avoiding redundant route tree requests. When the client prefetches /blog/post-1 and learns the route structure is /blog/[slug], it could potentially reuse that knowledge for /blog/post-2 without another server roundtrip. However, if a static route like /blog/featured exists at the same level, the client needs to know NOT to apply the dynamic template for that URL. staticSiblings provides this information. When a dynamic segment like [slug] has static siblings (e.g., "featured", "archive"), the server includes them in the prefetch response. The client can then check whether an incoming URL matches a known static sibling, and if so, recognize that the previously learned route structure does not apply.
-
Andrew Clark authored
During a Full prefetch (`<Link prefetch={true}>`), check the bfcache for matching segment data before issuing a new request. The bfcache stores data from previous navigations, which always includes dynamic data. This optimization avoids redundant server requests when the user has already navigated to a route and the data is still fresh according to the staleTimes.dynamic configuration.
-
- 20 Jan, 2026 17 commits
-
-
nextjs-bot authored
-
Zack Tanner authored
When digging into failing deployment tests, I often will re-run the test itself without wanting to change anything about Next.js or the test application, especially when I suspect a logic bug in the test itself or need to figure out what's causing a flake. This adds an environment variable that can be used to skip the build/deploy step and will use an existing deployment URL to run the tests against. I suggest reviewing this [without whitespace](https://github.com/vercel/next.js/pull/88829/changes?w=1).
-
Benjamin Woodruff authored
This is a crappy fuzzer I have to make sure that the filesystem watcher picks up changes to files. This didn't have coverage for links, so this tests that. I tested this on Windows and Linux. I don't care about the code quality here, so this was LLM-generated with very lightweight review.
-
Sebastian "Sebbie" Silbermann authored
Part of https://linear.app/vercel/issue/NAR-719/ We previously only supported a single manifest for filtering tests. However, Cache Component deploy tests have two manifests. Now we merge manifests append-only. ## Test plan - [x] https://github.com/vercel/next.js/pull/88821 adds a failed deploy test to a test suite also listed in the CC manifest. Tests from CC and deploy manifest are skipped ```console $ NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json,test/cache-components-tests-manifest.json" NEXT_TEST_MODE=deploy node run-tests.js -c 1 --retries 0 test/e2e/app-dir/searchparams-reuse-loading/searchparams-reuse-loading.test.ts ○ skipped should re-use loading from "full" prefetch for param-full URL when navigating to param-less route ○ skipped should re-use loading from "full" prefetch for param-less URL when navigating to param-full route ○ skipped should re-use loading from "full" prefetch for param-full URL when navigating to param-full route when aliasing is skipped ✕ should work for not found pages ✕ should work for route handlers ✕ should work for navigating to pages dir Without Middleware ✕ should correctly return different RSC data for full prefetches with different searchParam values With Middleware ○ skipped should correctly return different RSC data for full prefetches with different searchParam values ```
-
Jiachi Liu authored
-
Niklas Mischkulnig authored
We don't inline `process.env.NEXT_DEPLOYMENT_ID` anymore into browser chunks, and instead read it from `<html data-dpl-id` attribute at runtime. Closes PACK-6538 - [x] ~~Causes a hydration error at the moment.~~ Solved by removing the attribute immediately before hydration happens <img width="1443" height="620" alt="Bildschirmfoto 2026-01-20 um 12 32 06" src="https://github.com/user-attachments/assets/b69b3a0b-129d-44f4-84d1-10572b650437" />
-
Niklas Mischkulnig authored
Closes PACK-6539 When `experimental.runtimeServerDeploymentId` is enabled, read the `process.env.NEXT_DEPLOYMENT_ID` and append to the chunks when evaluating the `client-reference-manifest.js` Originally, I tried to do it after the manifest is loaded (in `loadComponents` or in the `RouteModule.prepare`) to "hydrate" the manifest, but that is too late because the manifest needs to be initialized immediately to make module-evaluation-time server actions work (which need the manifest immediately)
-
Tobias Koppers authored
- Adds a `process.env.NEXT_DEPLOYMENT_ID` -> `globalThis.NEXT_DEPLOYMENT_ID` replacement - On startup, `globalThis.NEXT_DEPLOYMENT_ID` is initialized to `process.env.NEXT_DEPLOYMENT_ID_COMPILE_TIME` This prepares for https://github.com/vercel/next.js/pull/88761 to replace `process.env.NEXT_DEPLOYMENT_ID_COMPILE_TIME` with reading `<html data-dpl-id>` so that we can remove the env var inlining However, all of this is only done for Turbopack, because we cannot forward `globalThis.NEXT_DEPLOYMENT_ID` to web workers with Webpack easily.
-
Hendrik Liebau authored
The function only used `url.pathname`, not `url.search`.
-
Niklas Mischkulnig authored
When `NEXT_DEPLOYMENT_ID` is set (and thus skew protection is enabled), then these pages router manifests are actually on a different path (so that the output paths doesn't change with the build id anymore) Fixup for https://github.com/vercel/next.js/pull/88641
-
xusd320 authored
-
Hendrik Liebau authored
The field stores a pathname, not a full URL.
-
Simeon Griggs authored
## Summary Updates the `with-mysql` example to use latest versions of all dependencies. ### What - Migrate from Pages Router to App Router - Update to React 19 and Next.js latest - Update to Tailwind CSS v4 with `@import "tailwindcss"` syntax - Update to Prisma 7 with `@prisma/adapter-planetscale` driver adapter - Convert all files to TypeScript - Remove unused API route and `vercel.svg` - Update README to clarify this is for PlanetScale MySQL and link to [vercel/postgres-next-starter](https://github.com/vercel/postgres-next-starter) for Postgres users ### Why The example was significantly outdated: - Prisma 3.10.0 → Prisma 7 (latest) - Tailwind 3.0.23 → Tailwind 4 - React 18.2.0 → React 19 - Pages Router → App Router ### How Followed the official migration guides: - [Prisma 7 upgrade guide](https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7) - [PlanetScale quickstart with Prisma](https://www.prisma.io/docs/getting-started/prisma-orm/quickstart/planetscale) - Aligned configuration files with a fresh `create-next-app` output ## Related N/A ## How to Test ```bash cd examples/with-mysql npm install # Set up .env with your PlanetScale DATABASE_URL npx prisma generate npx prisma db push npx prisma db seed npm run dev ``` ## Checklist - [x] Tests and samples are included - [x] Documentation is updated (README) --------- Co-authored-by:
vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
-
nextjs-bot authored
-
Andrew Clark authored
## Summary This adds a new experimental router method `experimental_gesturePush` that enables gesture-driven navigation. The feature is gated behind a new `experimental.gestureTransition` config flag, which implicitly opts the app into using the experimental React build. It is _not_ suitable for production use yet; it's a proof-of-concept so we can test the integration between the Next.js client router and React's Gesture Transitions experiment. You can use it to build demos, but it shouldn't be used in a real app. It dispatches updates through React's useOptimistic hook instead of the main router state queue, essentially forking the router state until the gesture completes. This should only be called inside `startGestureTransition`. It's a low-level method that is not meant to be used in application code, only in libraries that know how to properly integrate with both Next and React. ## Test Plan - E2E test that simulates a gesture by holding an async transition open between button clicks - Run: `pnpm testonly test/e2e/app-dir/gesture-transitions`
-
nextjs-bot authored
[diff facebook/react@41b3e9a6...d2908752](https://github.com/facebook/react/compare/41b3e9a6...d2908752) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/35567 - https://github.com/facebook/react/pull/35566 - https://github.com/facebook/react/pull/35565 - https://github.com/facebook/react/pull/35564 - https://github.com/facebook/react/pull/35559 - https://github.com/facebook/react/pull/35556 </details>
-
- 19 Jan, 2026 13 commits
-
-
nextjs-bot authored
-
Hendrik Liebau authored
When a page is accessed via a rewrite, use the destination path (not the source path) when computing implicit tags. This ensures that calling `revalidatePath('/dest')` correctly invalidates cache entries for pages rewritten to that destination. Fixes `'use cache'` and fetch cache with rewrites. ISR page cache was not affected because it already uses the rewritten pathname as the cache key (via `resolvedUrlPathname` in `base-server.ts`). -
Sebastian "Sebbie" Silbermann authored
Co-authored-by:nextjs-bot <it+nextjs-bot@vercel.com>
-
Hendrik Liebau authored
This change ensures that the `buildArgs` specified in `nextTestSetup` are also applied when running deploy tests. This is achieved by modifying the build command in the `package.json` file used for deploy tests to include the specified `buildArgs`. See also https://vercel.com/docs/builds/configure-a-build#build-command. The only current e2e test that uses the `buildArgs` option is `test/e2e/react-compiler/react-compiler.test.ts`, but that one is excluded from deploy tests via `deploy-tests-manifest.json`.
-
Hendrik Liebau authored
-
Sebastian "Sebbie" Silbermann authored
[test] Deflake `test/development/app-dir/hydration-error-count/hydration-error-count.test.ts` (#88749)
-
Hendrik Liebau authored
The commands must have been hallucinated.
-
Sebastian "Sebbie" Silbermann authored
[test] Deflake `test/development/app-dir/browser-log-forwarding/fixtures/verbose-level/verbose-level.test.ts` (#88754)
-
Sebastian "Sebbie" Silbermann authored
Co-authored-by:Cursor Agent <cursoragent@cursor.com>
-
Hendrik Liebau authored
Add support for the `--debug-build-paths` flag in Turbopack builds. Previously this flag only affected which routes were prerendered (statically generated), but the bundler still compiled all routes. Now routes are filtered early in `Project::entrypoints()`, so excluded routes are never compiled by Turbopack. Framework routes like `/_not-found` and `/_error` are always included to ensure the runtime works correctly. This significantly reduces build times in large apps when building individual routes for debugging purposes. It also allows us to exclude building incompatible paths in end-to-end tests depending on whether `__NEXT_CACHE_COMPONENTS` is defined or not (see upstack PR).
-
Sebastian "Sebbie" Silbermann authored
-
Niklas Mischkulnig authored
Goes from ``` /_next/static/THE_BUILD_ID/_buildManifest.js?dpl=123 /_next/static/THE_BUILD_ID/_ssgManifest.js?dpl=123 /_next/static/THE_BUILD_ID/_clientMiddlewareManifest.js?dpl=123 ``` to ``` /_next/static/_buildManifest.js?dpl=123 /_next/static/_ssgManifest.js?dpl=123 /_next/static/_clientMiddlewareManifest.js?dpl=123 ``` if skew protection is enabled. This makes the build-manifest.json not depend on the build id Closes PACK-6535
-
William Bout authored
<img width="4106" height="3504" alt="image" src="https://github.com/user-attachments/assets/102ddcd6-84c3-4cf7-be99-977473399570" /> Co-authored-by:
Jiwon Choi <devjiwonchoi@gmail.com>
-