- 25 Jun, 2026 13 commits
-
-
next-js-bot[bot] authored
-
Hendrik Liebau authored
The cold cache dev indicator added in #94611 surfaces a load that filled an empty cache while streaming. After the load settles it leaves a persistent "Cold cache" badge in the corner. That badge is visually too loud and disruptive in its current form, so we want to keep iterating on its UI and UX before showing it to everyone. Until then it should be off by default. This change puts that persistent badge behind a new, default-off `experimental.coldCacheBadge` flag, plumbed to the dev overlay as `process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE` via the define plugin. The transient "Rendering (cold cache)" pill shown during a navigation is intentionally kept regardless of the flag: it is transient and clears itself once the blocking navigation transition has committed, so it stays valuable without being disruptive. Only the permanent badge was the problem. The pre-existing "Cache disabled" (bypass) badge and the DevTools menu's cold-cache entry are also unaffected. The gate lives in `computeIntent`, so when the flag is off a cold load resolves to no badge and the indicator follows its existing empty-badge render path. Storybook forces the flag on through its `env` hook so the badge stories remain the surface for iterating on the design, and every test suite that asserts on the badge opts into the flag so none of them regress while it is disabled by default.
-
dan authored
Alternative to https://github.com/vercel/next.js/pull/95135. ## Summary This fixes a bunch of papercuts I discovered by running this skill repeatedly and analyzing logs: - Set the min version to https://github.com/vercel-labs/agent-browser/pull/1483 which fixes `--wait`. - Push the agent to read the docs so it doesn't guess browser commands incorrectly. - Ask agent to derive session name from CWD so that it doesn't conflict for git worktrees or same-named directories. - Explain the daemon warning better so the agent doesn't restart sessions for no reason. - The `mcp` prefix was confusing the agent and it was invoking the commands wrong. - Add a few more gotchas that the agent often runs into. ## Test Plan ### Harness I've been running this in an eval that runs a small next project and navigates around it. The eval penalizes the score if the log shows the agent stumbling, waiting unnecessarily, getting errors, etc. This version was most successful so far: <img width="801" height="78" alt="Screenshot 2026-06-25 at 05 14 43" src="https://github.com/user-attachments/assets/9c1c8744-2fe9-4c88-ab49-a44966f7515d" /> ### Real Project I've also tried it with a real project as a part of CC migration skill. It started the browser and later was able to talk via MCP and do edits seemingly without problems. More real testing would be nice — I don't have much experience with skills. --------- Co-authored-by:
Jude Gao <jude.gao@vercel.com>
-
Janka Uryga authored
Extracted from #94595 . The root layout includes a timestamp that we use to check if the root layout changed during a navigation, but it was unnecessarily using `await connection(); Date.now()` when a `performance.now()`would be enough. Changing it to not introduce a random dynamic hole which could affect validation in some way. This change revealed that some client component tests were implicitly relying on the dynamic timestamp component as a workaround for NAR-800 . I've added a workaround dynamic component to each of the relevant tests, those can be removed when we fix the bug.
-
Joseph authored
Rewrites the `io()` API reference around what it expresses: with Cache Components `await io()` keeps the operation that follow afterward out of the static shell. Adds Server/Client usage examples and a composition note, a "When you don't need `io()`" section, and reframes the `connection()` comparison around prefetching. --------- Co-authored-by:
Aurora Scharff <66901228+aurorascharff@users.noreply.github.com> Co-authored-by:
Aurora Scharff <aurora.sofie@gmail.com>
-
Hendrik Liebau authored
The Instant Navigation lock makes a development render reflect the route's prefetched state: while the lock is held, a navigation shows only what was prefetched and keeps navigation-time data deferred. Both the `instant()` testing API from `@next/playwright` and the Instant Navigation devtools rely on it. The client side of that behavior, restricting the navigation read to the prefetched shell unless the link opts into a runtime prefetch and ignoring cache entries acquired before the lock, landed separately in #95150, which this change builds on. What remained were two ways the development app render diverged from what a production build serves, both in `app-page.ts`, so this PR contains no client-side router changes. While the lock is held, the app render now permits an empty static shell. A route that reads dynamic data such as `cookies()` outside any `<Suspense>` boundary has no static shell, so the on-demand render previously threw a static generation bailout, served an error page, and entered a `/_tree` redirect loop that committed the blocked data. Permitting an empty shell lets the render emit the shell instead. The override is scoped to the prefetch render made while the lock is held, a document request or a `'1'` static prefetch; a regular dynamic navigation, including the one that commits once the lock releases, runs without it. So the validation that flags a blocking route is not weakened: production validation runs at build time, and the development validation still runs and is shown in the dev overlay. The development fallback-shell render now reads the per-URL `fallbackParams` request meta that base-server derives for the requested URL, so the instant shell defers exactly the params a production prefetch would: `generateStaticParams`-covered params resolve in the shell and only the uncovered ones are deferred. When the URL is fully covered the meta is absent and nothing is deferred. That per-URL computation landed in #95066, which this change depends on. This suite now runs with App Shells enabled, which is the default under Cache Components. #94516 had temporarily forced it back to `false` here while the prefetch behavior settled and left the migration as a follow-up; re-enabling it is what lets these tests exercise the app-shell prefetch path the changes above target. New end-to-end coverage exercises the cases this render path affects. A deeper-segment blocking navigation must stay parked on the committed parent while the lock is held. Two mixed routes pair a `generateStaticParams`-covered param with an uncovered one: a plain route where a normal navigation surfaces only the covered param while the uncovered param and a request-time `connection()` sibling stay deferred, and an `allow-runtime` route where a `prefetch={true}` link additionally surfaces the uncovered param from the runtime prefetch. A blocking route that reads request data outside any `<Suspense>` boundary cannot be built for production, so it lives in a development-only fixture, guarded so the production job registers only a placeholder. The default fixture moves the dev-tools indicator to `bottom-right` so the Instant Navigation panel does not overlap the left-aligned test links during a navigation. One client-navigation cookie case is marked `it.failing`: on a non-partial route the speculative static prefetch is fuller than the app-shell render and supersedes it in the segment cache, so the cookie that only the app shell carries never reaches the instant shell. #95150's shell handling only engages under partial prefetching. Closing this needs a separate server-side change so that a route reading `cookies()` during app-shell generation opts into either partial prefetching, where only the app shell is fetched and nothing fuller can supersede it, or a runtime prefetch, where the speculative prefetch carries the cookie and no longer regresses what the app shell initially showed. -
Janka Uryga authored
When `partialPrefetching` is on, the shell that we usually care about displaying is the App Shell, which is represented by the ShellRuntime stage. We should only show the cold cache indicator for caches that happen up until then, and release the client-side promise appropriately. This PR extends the existing `revealAfterStage` mechanics to account for this. > Note that this is incomplete: if we're navigating via `<Link prefetch={true}>` (or have `partialPrefetching: "unstable_eager"), we might want to use the Runtime stage instead. I'm leaving those for a follow up -- representing the common case (a shell prefetch) seems like the most useful thing. I've re-worked the `revealAfterStage/holdStreamUntilRevealed` setup into an object (`DevNavigationKind`) that represents the navigation that we're trying to simulate -- either an initial load or a client nav. This gets rid of the invalid `holdStreamUntilRevealed = true` + `revealAfterStage = RenderStage.Runtime/ShellRuntime` combination and lets us bring the logic closer to where the stream blocking tricks actually happen. I've also done some drive-by refactoring of `streamStagedRenderInDev` to dedupe some repetitive code, because every task was basically doing the same thing. I've also moved all `revealAfter.resolve()` calls into separate tasks -- we were inconsistent about this, and the `Static` `revealAfter.resolve()` was done together with the next stage, but the `RenderStage.Runtime` was done in a separate task. --- Strangely, despite the changes working as expected for the Cold Cache indicator, I can't actually get link data (`await searchParams`) to trigger a fallback when navigating, so there's a failing test for that in `cache-components-dev-streaming.test.ts`. I'm not sure why what's causing this, but I'm leaving that investigation for a follow-up as well. -
Aurora Scharff authored
## Summary When the root layout reads request data (`cookies()`, `headers()`) under Cache Components, the validation error often surfaces on `/_not-found` — a real prerendered route that inherits the root layout, even though the user has no `not-found.tsx` file. This is consistently confusing (#67532), so: - `errors/blocking-prerender-runtime.mdx` and `errors/blocking-prerender-dynamic.mdx`: added a gotcha bullet pointing the fix at the root layout when the failing route is `/_not-found`. - `docs/01-app/02-guides/migrating-to-cache-components.mdx`: added a `Good to know` callout in the `cookies, headers, and searchParams` section linking to the existing [Themes recipe](/docs/app/guides/preventing-flash-before-hydration#themes) for the `<html data-theme>` case, since attributes on the root element can not be wrapped in `<Suspense>`. ## Verification - `npx alex` clean on all three files. <!-- NEXT_JS_LLM_PR --> --------- Co-authored-by:
Joseph Chamochumbi <joseph.chamochumbi@vercel.com> Co-authored-by:
Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
-
Sam Poder authored
[turbopack] Discover `ServiceWorkerEntryModule`s in `next-api` and compile + serve those service workers (#94922) This is the big change in the `next-` part of the repo to support this. The code goes through the module graph to find any service workers that need compiling and then compiles them. It also has the code changes to `packages/next/src/server/lib/router-utils/filesystem.ts` that serve these files on their respective routes.
-
Sam Poder authored
This is what will be inserted by the analyzer into a page's module graph: https://github.com/vercel/next.js/pull/94923. This allows `next-api` to discover these modules (see https://github.com/vercel/next.js/pull/94922) and compile them.
-
Andrew Clark authored
When using the instant() API, or the Navigation Inspector, the prefetched state should match what a user is most likely to see in production with a warm cache. So, when Partial Prefetching is enabled, and the Link does not have a prefetch prop, only the shell should be allowed to render. Before this PR, the _entire_ prefetched state would display, regardless of the prefetch configuration of the route and the link. This is essential to prevent false negatives in tests that assert on the prefetched state: the test must not depend on data that wouldn't be prefetched in a real production environment. As part of the fix, I also updated the logic to ignore any cache entries that were already present before the `instant()` lock was acquired, to ensure the test is not "polluted" by earlier prefetches or navigations. Theoretically we could optimize this in the future but this is the cleanest way to ensure this property for now. <!-- NEXT_JS_LLM_PR -->
-
Sam Poder authored
Broke these changes out into a separate PR but these are needed later down the stack in https://github.com/vercel/next.js/pull/94922 which changes `next-api`.
-
- 24 Jun, 2026 27 commits
-
-
Joseph authored
Before this guide existed, often we linked, incorrectly, to mutating-data. Also adding more related links pointing to this guide.
-
next-js-bot[bot] authored
-
Aurora Scharff authored
-
Andrew Clark authored
In dev with Cache Components, navigating via a `<Link prefetch={true}>` to a route that hasn't opted into Partial Prefetching logs a warning, since the full prefetch pulls in dynamic data and defeats the static/dynamic split. `instant = false` is the explicit API for opting a route out of this validation, so it should silence the warning. Previously it didn't: an `instant = false` segment set no prefetch hint at all, so the warning still fired. Add a `SubtreeHasInstantFalse` PrefetchHint, set on any segment that exports `instant = false` and propagated up to the root (mirroring `SubtreeHasPartialPrefetching`). The dev warning now skips routes where this bit is present anywhere on the target subtree. This is warning-only and kept separate from the existing `PrefetchDisabled` bit, which feeds `StaticPrefetchDisabled` and would change actual prefetch behavior. -
Andrew Clark authored
When the Navigation Inspector (Instant Navigation Testing API) is active, the server renders only a route's static shell. A blocking route — one that reads a dynamic value such as `await cookies()` at the root with no Suspense boundary above it, opting into blocking via `export const instant = false` — produces an empty shell. We served that empty shell directly, so the browser showed a blank document with no DevTools. With no DevTools, there's no way to release the inspector lock from the UI, so every reload stayed blank and the user was stuck. Detect the empty static shell at serve time and throw to surface a normal error page instead, and clear the instant-navigation cookie so the next reload renders the route normally. In the future we plan to render this error message inline in the Navigation Inspector panel rather than as a full-page error.
-
Joseph authored
Clarify `root-params` w/ gSP - Required with CC, otherwise optional
-
Hendrik Liebau authored
Follow-up to #94957, which made cached `ImageResponse` routes statically prerenderable by serializing the constructor arguments through React Flight (to build a cache key and to run the element's async Server Components once). A custom font passed as a `Buffer` in the options was corrupted by that round-trip: Flight applies the `toJSON` method that Node's `Buffer` carries, so the font reached satori as a `{ type: 'Buffer', data: [...] }` plain object rather than binary, and satori's font parser threw `TypeError: First argument to DataView constructor must be an ArrayBuffer`. The crash happened even without a user `'use cache'` directive, because the serialization runs unconditionally during the prerender. We now serialize only the element through Flight, which is the only part that needs async resolution and dynamic-input detection, and pair the resolved element with the original in-memory options when handing the tree to satori. The font `Buffer` is therefore never serialized and reaches satori intact. The cache key no longer comes from the serialized arguments either; it is derived from a SHA-256 hash of the serialized element combined with a content hash of the options, with binary font data hashed by its bytes and everything else by a sorted, type-tagged walk. Besides fixing the crash, this keeps font bytes out of the cache key and removes the "Uint8Array objects are not supported" warning that the dev React runtime emitted during `next build --debug-prerender`. The custom-fonts documentation example now loads the font once at module scope. This keeps the route statically generated, since reading inside the component would be uncached I/O that Cache Components treats as dynamic, and it steers users away from wrapping the read in `'use cache'`, which would route the font `Buffer` through use-cache's own Flight serialization and reintroduce the same corruption upstream of `ImageResponse`, where this fix cannot reach it. A regression test loads a local font via a module-scope `readFile` and asserts the route prerenders statically. -
next-js-bot[bot] authored
-
next-js-bot[bot] authored
-
Sebastian "Sebbie" Silbermann authored
A `pnpm install` installs native bindings for Next.js by default. This makes sense for local development where half of the team doesn't work on native code and just needs the most recent bindings. However, CI almost exclusively wants to test with bindings that are built from the current commit. The rest doesn't need native bindings at all. The only exception is `test_examples` which is likely not functional. Though we still support it by allowing to opt-into automatically installing native bindings in CI. ## test plan - [x] fetch test timings still skips: https://github.com/vercel/next.js/actions/runs/28087707205/job/83157705446?pr=95114#step:7:228
-
next-js-bot[bot] authored
-
Hendrik Liebau authored
The `hmr-intercept-routes` test created the `@intercept` parallel-route slot files before editing the root layout to render the slot. Adding a new parallel-route slot is a structural change that forces a full page reload, and that reload raced with the Fast Refresh for the layout edit. Under load the client's `reloading` guard could drop the in-flight refresh, so the new slot never reached the browser and the test timed out waiting for `#default-intercept`, [failing 30-40% of the time in CI](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40git.repository.id%3A%22github.com%2Fvercel%2Fnext.js%22%20%40test.name%3A%22hmr-intercept-routes%20should%20update%20intercept%20routes%20via%20HMR%22%20%40test.status%3A%28fail%20OR%20pass%29&agg_m=count&agg_m_source=base&agg_t=count¤tTab=overview&eventStack=&fromUser=false&index=citest&start=1781719381980&end=1782324181980&paused=false). <img width="428" height="176" alt="Screenshot 2026-06-24 at 20 04 01" src="https://github.com/user-attachments/assets/0272886e-dd75-4dbd-bd8c-b26ee8f40082" /> This change edits the layout first, so the `intercept` slot is already rendered as an undefined, no-op prop before the slot files exist. Creating the slot files afterward triggers the structural reload, and because the layout already renders the slot, that reload serves the complete updated route tree in a single fetch with no competing Fast Refresh. The server always resolved the route correctly; only the browser-side delivery was racy.
-
Sam Selikoff authored
Before: <img width="505" height="457" alt="image" src="https://github.com/user-attachments/assets/5f30079f-1d6e-44f6-8c3a-476f6463f346" /> <img width="498" height="457" alt="image" src="https://github.com/user-attachments/assets/d14e3cb2-fc14-4d01-bf13-00dd8478f06e" /> After: <img width="518" height="464" alt="image" src="https://github.com/user-attachments/assets/0d89a389-eb25-4d3a-b6e6-58cb084bc661" /> <img width="505" height="454" alt="image" src="https://github.com/user-attachments/assets/a985e10a-a7c1-4314-9061-f531fab49a05" />
-
Hendrik Liebau authored
Reverts vercel/next.js#95127 This was a stale merge, now the case was duplicated.
-
Hendrik Liebau authored
The `switch` statement was added in #95100 when the `'prerender-ppr'` didn't exist anymore. Afterwards #95113 landed and re-introduced the `'prerender-ppr'` case, but it was not added to the `switch` statement, which caused a type error.
-
Sebastian "Sebbie" Silbermann authored
Add a `preview` release type so `@preview` npm releases can be cut **ad-hoc from `canary`** via the `Trigger Release` workflow, retiring the dedicated long-lived preview branch. The GitHub environment has been updated accordingly. A preview cut produces **two commits**, pushed in a single update: 1. **Bump-to-preview** — all packages set to the computed preview version, tagged `v…-preview.N`. This tag's build publishes `@preview` (relies on #95085). 2. **Revert-to-canary** — restores the `-canary.N` versions so `canary` keeps advancing its own line and isn't stranded on a preview version. ``` B canary HEAD before cut (e.g. 16.3.0-canary.61) │ P v16.3.0-preview.N ← tag here; tag build publishes @preview │ R canary HEAD after cut (versions restored to 16.3.0-canary.61) ``` ### Preview version numbering `base = max(canary major.minor.patch, npm @preview major.minor.patch)`: - base still on the published preview line → continue it (`n + 1`) - canary advanced to a higher base (or no `@preview` published) → reset to `.0` So if `canary` jumps to `18.0.0-canary.x` since the last `16.3.0-preview.x`, the next cut is `18.0.0-preview.0`, not a continuation. ## Test plan The dry mode of `start-release.js` was extended to intercept the GH requests and log the relevant data. ```console $ node ./scripts/start-release.js --release-type preview --dry-run Dry run: keeping commits locally, skipping git push and GitHub release creation Running pnpm release-preview... [...] > lerna version 16.3.0-preview.4 --force-publish -y --no-push --allow-branch '**' [...] Creating GitHub-signed release commit(s) for v16.3.0-preview.4 from local commits 0f5c1e865cc34edb257a16823ed6525d9cd58bfc..0062348c411776271fe7eac64e97b8bad2775b77 [dry-run] GitHub API POST /repos/vercel/next.js/git/blobs [...] [dry-run] GitHub API POST /repos/vercel/next.js/git/commits {"message":"v16.3.0-preview.4","tree":"0000000000000000000000000000000000000016","parents":["0f5c1e865cc34edb257a16823ed6525d9cd58bfc"]} [dry-run] GitHub API POST /repos/vercel/next.js/git/commits {"message":"Restore canary version 16.3.0-canary.61 after v16.3.0-preview.4 preview release","tree":"000000000000000000000000000000000000002d","parents":["0000000000000000000000000000000000000017"]} [dry-run] GitHub API POST /repos/vercel/next.js/git/refs {"ref":"refs/tags/v16.3.0-preview.4","sha":"0000000000000000000000000000000000000017"} [dry-run] GitHub API PATCH /repos/vercel/next.js/git/refs/heads/sebbie/preview-release-from-canary {"sha":"000000000000000000000000000000000000002e","force":false} Dry run: skipping local branch sync; would set sebbie/preview-release-from-canary to 000000000000000000000000000000000000002e and tag v16.3.0-preview.4 at 0000000000000000000000000000000000000017 Created GitHub-signed release tag v16.3.0-preview.4 at 0000000000000000000000000000000000000017; branch sebbie/preview-release-from-canary now at 000000000000000000000000000000000000002e Dry run: skipping GitHub release creation Release process is finished ``` -
Sebastian "Sebbie" Silbermann authored
Fixes >This environment is not supported by Next.js or publish of 16.3.0-canary.64 is incomplete. -- https://github.com/vercel/next.js/actions/runs/28082958066/job/83141991913#step:7:246
-
Joseph authored
## Summary - `prefetch.mdx`: corrections, disambiguation and TS signature update - `runtime-prefetching.mdx`: App Shells section corrections - `instant-navigation.mdx`: DevTools section re-aligned (mpa/spa split, panel labels, cold-cache indicator) - x-refs ## TODO - [x] `partialPrefetching.mdx` API reference with the three levels of prefetch - [x] runtime prefetching journey
-
Aurora Scharff authored
### What? Wires the dev-only `<Link prefetch={true}>` Partial Prefetching warning from [#94672](https://github.com/vercel/next.js/pull/94672) into the Instant Insights surface. Code frame, call stack, three fix cards: **Upgrade** `prefetch = 'partial'` · **Disable** the prop · **Ignore** with `instant = false`. Demo: [93-link-prefetch-without-partial](https://error-messages-overhaul-ibsl.labs.vercel.dev/scenario/93-link-prefetch-without-partial). ### How? - Warning factored into a shared `instant-messages.ts` factory. - New `link-prefetch-partial` overlay kind + `Instant` label + `InstantRuntimeError` dispatcher. - Two new fix-card groups: **Upgrade** (amber, arrow-up), **Disable** (gray, minus). - New `instant-link-prefetch-partial.mdx` rule page + "Auditing existing calls" section in the adoption guide. - Unit tests for the matcher, cards, and `isInstantNavigationError`. ### Related - [#94818](https://github.com/vercel/next.js/pull/94818) — broader Partial Prefetching docs cleanup. Lands independently. - [vercel/front#73592](https://github.com/vercel/front/pull/73592) — next-site `upgrade` + `disable` `FixGroup` values. -
Sebastian "Sebbie" Silbermann authored
-
next-js-bot[bot] authored
-
Hendrik Liebau authored
`getHeaders` in the request store strips internal flight and dev request-id headers before sealing the object exposed to userland `headers()`. It built that object with `HeadersAdapter.from(req.headers)`, which wraps `IncomingHttpHeaders` (and returns a `Headers` instance) without copying, so the `delete` calls mutated the shared `req.headers` as a side effect. This regressed redirects from a server action that reads `headers()` when `cacheComponents` is enabled in `next dev`, introduced by #94703. That change added the dev request-id headers (`x-nextjs-request-id` and `x-nextjs-html-request-id`) to the set stripped in `getHeaders`. The flight headers had been stripped from the shared object for a long time without issue because their absence is a handled state, but the request-id headers are different: the action's `headers()` access now deleted them from `req.headers`, and the dev instant-navigation render of the redirect target, which reuses the same request, then read a missing request id and fabricated a mismatched HTML request id. The React dev debug channel was registered under that wrong id, so the client overlay stayed in "Rendering..." and never applied the navigation. This change copies the headers before stripping so only the sealed userland view is affected, leaving the shared request headers intact. It adds an e2e test that reproduces the regression. fixes #95103
-
Hendrik Liebau authored
To make `cacheMaxMemorySize: 0` fast in development, the `'use cache'` wrapper forced every built-in cache entry to a dynamic cache life (`revalidate: 0`, a five-minute `expire`) so that warm reads would serve the stale value and regenerate a fresh one in the background. That forcing leaked into the stored entry, and an entry with `revalidate: 0` is treated as too dynamic to live in a static shell. On a warm reload of a route that is fully cached and has no `<Suspense>` above the `'use cache'`, the dev validation prerender read the entry and threw an error claiming that a `'use cache'` with zero `revalidate` was nested inside another `'use cache'` that has no explicit `cacheLife`, even though nothing was actually nested, and reported the route as a blocking route. The cold load was unaffected because the entry did not exist yet. With this change the size-0 case no longer forces a dynamic cache life and keeps the entry's resolved life instead: the explicit `cacheLife()` values when the user set them, otherwise the default (a 15-minute `revalidate` and an infinite `expire`). That default sits well above the dynamic thresholds, so a fully cached route can be prerendered again and the false-positive blocking error is gone. An explicitly short `cacheLife()` still makes the route legitimately dynamic without a spurious throw, because the explicit-revalidate and explicit-expire flags are then set. Private caches are unchanged and remain forced-dynamic. So that reloads keep showing a fresh value now that the stored life is no longer always stale, the background revalidation in the cache-hit path also fires for size-0 built-in entries regardless of the stored `revalidate`, restricted to the dynamic dev request render so the dev validation prerender does not also regenerate.
-
Aurora Scharff authored
### What? Docs-only follow-ups for Cache Components and Partial Prefetching, from agent migration friction logs and Joseph's review of [#95082](https://github.com/vercel/next.js/pull/95082). - **`adopting-partial-prefetching.mdx`** — reframe the `allow-runtime` row in the audit table (it's an enhancement, not the `<Link prefetch={true}>` warning fix; the per-route opt-in is `prefetch = 'partial'`). - **`migrating-to-cache-components.mdx`** — split the `## Enable Cache Components` section into before-flag (remove `dynamic` / `revalidate` / `fetchCache`) and after-flag (translate `revalidate`, `fetchCache`, `unstable_cache`, `fetch` cache options) steps. Flag the `revalidateTag` second-argument requirement, with a Before / After example. Add two Good-to-know callouts: off-grid `revalidate` values map to the closest `cacheLife` profile; `instant = false` is allowed-to-block, not forced-dynamic. - **`blocking-prerender-current-time` / `-random` / `-crypto`** (and their `-client` siblings) — drop the misleading "Don't want this validation?" opt-out section. `instant = false` is an instant-navigation knob and doesn't suppress sync-IO prerender errors. - **Remaining `blocking-prerender-*` pages** — standardize the CLS fallback callout so they all link the canonical section. ### Why? Friction logs surfaced four recurring misreads: 1. Devs expected `prefetch = 'allow-runtime'` to silence the `<Link prefetch={true}>` warning. The docs implied it would. 2. The migration guide mixed `dynamic` removal with `unstable_cache` translation, so it wasn't clear which had to happen before the flag and which after. 3. `revalidateTag` now requires a cache profile, but the on-demand revalidation section didn't say so. 4. Sync-IO error pages still carried a "Don't want this validation?" opt-out that doesn't actually work for those errors.
-
next-js-bot[bot] authored
-
Sebastian "Sebbie" Silbermann authored
That way we can push multiple commits when doing a release. For canaries, nothing will change. In a follow-up, we'll start cutting `@preview` from the `canary` branch. To support that case, we need to immediately revert the version in `lerna.json`. We shouldn't push commits indidually to avoid having an incomplete release if something else is pushed between `@preview` version bumps and `@canary` version reverts. ## test plan After merge, the next canary release should publish from the `v…-canary.N` tag run (`deploy-target = production`), while the canary branch push for the same commit shows `skipped` — exactly one production run per release. <!-- NEXT_JS_LLM_PR -->
-
Tobias Koppers authored
### What? Adds a `TURBOPACK_DEBUG_CSS_CHUNKING` environment variable. When set to a truthy value, the graph-based CSS chunker (`experimental.cssChunking: "graph"`) writes a JSON snapshot of its inputs and outputs to the current working directory on each invocation. ### Why? We are investigating problems with the new graph-based CSS chunking algorithm. The pipeline (`create_graph` → `make_acyclic` → `linearize` → `split_into_chunks`) is internal to `turbopack-core` and doesn't surface enough information through normal build output to debug bad chunking decisions post-hoc. A side-channel dump lets us reproduce and reason about a problematic build without instrumenting Rust on a user's machine. ### How? In `turbopack/crates/turbopack-core/src/module_graph/style_groups_graph/mod.rs`, between `split_into_chunks` and the result assembly: - Whether the dump is enabled is cached in a `static DEBUG_DUMP_ENABLED: LazyLock<bool>` so the env var is read exactly once per process. Truthy = anything other than unset, empty, `0`, or `false` (case-insensitive). - When enabled, every call to `compute_style_groups_graph` resolves `ident_string()` for every CSS module in parallel via `try_join` and writes a pretty-printed JSON file `turbopack-css-chunking-debug-<unix_ms>-<seq>.json` in the current working directory. The timestamp + atomic counter suffix ensures concurrent or repeated calls don't clobber each other. - Failures while writing the dump are logged to stderr and otherwise swallowed — a debug toggle must never fail a build. The JSON document contains: - `chunk_groups`: `string[][]` — module idents per chunk group, in the order the algorithm sees them. - `global_order`: `string[]` — the flat global order produced by `linearize`. - `global_order_chunks`: `string[][]` — the same modules grouped by the merged segments produced by `split_into_chunks` (e.g. `[["a","b"], ["c"], ["d","e","f"]]`). - `modules`: `[{ ident, size, style_type }]` — per-module metadata where `size` is the chunk item size in bytes (the same value used by the cost model) and `style_type` is `"GlobalStyle"` or `"IsolatedStyle"`. Verification: `cargo clippy -p turbopack-core --no-deps` is clean and the existing `style_groups_graph` test suite passes (53 tests). No user-facing config change, no docs change — the env var is intentionally undocumented and only meant for triage. Closes NEXT- Fixes # --------- Co-authored-by:v-work-app[bot] <262237222+v-work-app[bot]@users.noreply.github.com> Co-authored-by:
Claude <noreply@anthropic.com> Co-authored-by:
Tobias Koppers <sokra@users.noreply.github.com>
-