- 21 Jan, 2026 17 commits
-
-
nextjs-bot authored
-
Benjamin Woodruff authored
In an attempt to reproduce https://github.com/vercel/next.js/discussions/88382, this tries creating and updating a bunch of symlinks/junction points in a tight loop with some parallelism. However, I've been unable to reproduce the error reported in that discussion. I don't care about the code quality here, so this was LLM-generated with very lightweight review. A simplified version of the fuzzer is also included as a unit test in `turbo-tasks-fs`. This version only does a few iterations and runs very quickly.
-
nextjs-bot authored
-
Benjamin Woodruff authored
This PR just moves things around for #88667. I don't care about the code quality here, so this was LLM-generated with very lightweight review.
-
Benjamin Woodruff authored
In addition to creating task invalidators for file reads, we also create invalidators for file writes. This extends the fuzzer to cover that. This is a bit trickier to test. Because the `write` call doesn't return anything, the caller of `write` never gets invalidated and re-executed, even though `write` does. So instead, we must observe that `write` was re-executed by looking at the contents of the file it wrote to. We write a sentinel value to files when we call the turbo-tasks-fs `write` function, and write random values to it to trigger an invalidation. 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.
-
Matt Mastracci authored
# What Closes https://github.com/vercel/next.js/issues/84782 Closes https://github.com/vercel/next.js/issues/74842 Closes https://github.com/vercel/next.js/issues/82520 Closes PACK-3723 Replace blob URLs for web workers with real entrypoint files, fixing relative URL resolution inside workers. Implements support for `SharedWorkers` since it's now a simple variation of the `Worker` case. Note that all generated files (and shared-worker querystrings) are appropriately content-hashed and do not rely on deployment IDs and will work w/immutable resources. # Why Workers created via `new Worker(new URL('./worker.js', import.meta.url))` previously got blob URLs. This breaks relative URL resolution inside workers - WASM imports like `new URL('./file.wasm', import.meta.url)` fail because `import.meta.url` returns `blob:http://...` instead of a real path. # How We emit a real worker entrypoint file instead of blob URLs. The entrypoint reads bootstrap config from URL hash params (`#params=....`), then loads the worker's chunks via `importScripts`. The `ChunkingContext` trait gets a new `worker_entrypoint()` method returning a singleton bootstrap asset. Node.js `bail!`s for now but could implement its own in the future. The browser implementation (`EcmascriptBrowserWorkerEntrypoint`) compiles and minifies `worker-entrypoint.ts`, which parses `#params={globals,chunks}` from the URL at runtime. `WorkerLoaderChunkItem` now emits `__turbopack_worker_url__(entrypoint, chunks, shared)` instead of the old blob URL shim. SharedWorker passes `shared=true` which adds a querystring - the browser handles worker identity via URL, so same URL means same instance. Generated code changes (pseudocode): ```javascript __turbopack_export_value__(__turbopack_worker_blob_url__(["chunk1.js", "chunk2.js"])); ``` After: ```javascript __turbopack_export_value__(__turbopack_worker_url__("worker-entrypoint.js", ["chunk1.js", "chunk2.js"], false)); ``` # Notes Webpack doesn't currently correctly support `SharedWorkers`. The e2e test behaves properly in turbopack after this change, but webpack spins up two separate workers where it should only be spinning up one. I generated snapshot tests for workers in the first and last commits to help understand the generated code better. # Testing - Snapshot tests for Worker, SharedWorker, and minified output - E2E tests for WASM loading in workers (`test/e2e/app-dir/worker/`)
-
Zack Tanner authored
When generating PPR fallback shells, a cache miss during warmup was being treated as a dynamic hole, so the warmup render never filled new cache entries. This caused root‑param fallback shells (e.g. `/en/blog/[slug]`) to suspend even though root params were already known. This change always creates a fresh prerender RDC for warmup and copies any seed hits into it. The final render then uses the warmed cache, so fallback shells can reuse populated entries without short‑circuiting. On the export side, we now choose a seed RDC by matching known params (e.g. locale) so /en/... fallback shells don’t get seeded with /fr/... data. (Previously, the RDC seed was "last-write-wins". Fixes NAR-716
-
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 6 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)
-