Skip to content

docs(cache-components): clarify allow-runtime, sync-IO and instant=false, CLS fallback#94997

Merged
aurorascharff merged 14 commits into
canaryfrom
codex/pp-guide-cls-docs
Jun 24, 2026
Merged

docs(cache-components): clarify allow-runtime, sync-IO and instant=false, CLS fallback#94997
aurorascharff merged 14 commits into
canaryfrom
codex/pp-guide-cls-docs

Conversation

@aurorascharff

@aurorascharff aurorascharff commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What?

Docs-only follow-ups for Cache Components and Partial Prefetching, from agent migration friction logs and Joseph's review of #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.
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: cac8d42

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Stats cancelled

Commit: cac8d42
View workflow run

@aurorascharff aurorascharff requested a review from icyJoseph June 20, 2026 18:19
@aurorascharff aurorascharff marked this pull request as ready for review June 20, 2026 18:19
Copilot AI review requested due to automatic review settings June 20, 2026 18:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Next.js documentation to more accurately describe Cache Components / Partial Prefetching behavior and to standardize guidance around CLS-safe Suspense fallbacks across related error pages.

Changes:

  • Reframes prefetch = 'allow-runtime' as an optional enhancement (runtime prefetching of request data) rather than a way to address the dev <Link prefetch={true}> warning, and adds a clarifying “Good to know” callout.
  • Adds consistent CLS guidance + a canonical deep-link to the Streaming guide’s CLS section across several blocking-prerender-* error pages.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
errors/blocking-prerender-random.mdx Adds CLS-safe fallback guidance link in the Trade-off section.
errors/blocking-prerender-random-client.mdx Adds CLS-safe fallback guidance link in the Trade-off section.
errors/blocking-prerender-current-time.mdx Expands Trade-off to include CLS-safe fallback guidance + link.
errors/blocking-prerender-current-time-client.mdx Adds CLS-safe fallback guidance link in the Trade-off section.
errors/blocking-prerender-crypto.mdx Expands Trade-off to include CLS-safe fallback guidance + link.
errors/blocking-prerender-crypto-client.mdx Adds CLS-safe fallback guidance link in the Trade-off section.
docs/01-app/02-guides/adopting-partial-prefetching.mdx Clarifies allow-runtime vs partial (warning/opt-in) and updates audit table wording accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

All broken links are now fixed, thank you!

Comment thread docs/01-app/02-guides/adopting-partial-prefetching.mdx Outdated
Comment thread docs/01-app/02-guides/migrating-to-cache-components.mdx Outdated
@aurorascharff aurorascharff changed the title docs: clarify allow-runtime is an enhancement + standardize CLS fallback guidance Jun 20, 2026
@aurorascharff aurorascharff changed the title docs: Cache Components / Partial Prefetching clarifications Jun 20, 2026
Comment thread docs/01-app/02-guides/migrating-to-cache-components.mdx Outdated
aurorascharff added a commit that referenced this pull request Jun 23, 2026
### What

Driven by three friction logs from agents running
`next-cache-components-adoption` against starting points the skill
silently assumed.

- Restructure `## requires` as a labeled checklist: **App Router
project**, **Next.js 16.3 or later**, **No incompatible config keys**.
Each item names what's checked, what the failure mode is, and where to
resolve it.
- Hoist the **No green baseline before the flag** note out of the prereq
pile into a separate `### notes` block (alongside **Offline docs**), so
a reader scanning prereqs doesn't conflate it with a hard requirement.
- Tighten the codemod block: explain `@canary`'s necessity in one line
so an agent hitting `Invalid transform choice` from `@latest` knows the
workaround.

### Why

Three friction logs each hit a different version of the same gap:

- **react.dev migration**: agent ran codemod with `@latest` (16.2.9) →
`Invalid transform choice` → applied transform by hand.
- **Marketing-site case**: agent built the spec with `revalidate`
exports, codemod left them in, `cacheComponents: true` rejected the
build.
- **E-commerce case**: `experimental.dynamicIO`/`useCache` left in
`next.config` → fatal config error.

In each case the skill *technically* said what to do but it was buried.

### Related

The migration-guide changes that were originally in this PR moved to
[#94997](#94997).

### Type of Change

- [x] Documentation (adds or changes documentation)

<!-- NEXT_JS_LLM_PR -->
Comment thread docs/01-app/02-guides/migrating-to-cache-components.mdx Outdated
Comment thread docs/01-app/02-guides/migrating-to-cache-components.mdx Outdated
Comment thread errors/blocking-prerender-current-time.mdx Outdated
@aurorascharff aurorascharff requested a review from icyJoseph June 24, 2026 06:28
@aurorascharff aurorascharff merged commit ab4b191 into canary Jun 24, 2026
227 of 230 checks passed
@aurorascharff aurorascharff deleted the codex/pp-guide-cls-docs branch June 24, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants