Skip to content

refactor(template): disable global partial prefetching#384

Open
laugharn wants to merge 1 commit into
mainfrom
chore/disable-partial-prefetching
Open

refactor(template): disable global partial prefetching#384
laugharn wants to merge 1 commit into
mainfrom
chore/disable-partial-prefetching

Conversation

@laugharn

Copy link
Copy Markdown
Collaborator

What

Flip partialPrefetching from true to false in apps/template/next.config.ts, backing out the partial-prefetch experiment from #322. The key is kept (explicitly false) to document the deliberate choice rather than relying on the implicit default.

-  partialPrefetching: true,
+  partialPrefetching: false,

Why it matters

partialPrefetching is the global default for a route segment's prefetch strategy — but only for segments that don't export their own prefetch. Next resolves it as:

const prefetchConfig = mod.prefetch ?? (partialPrefetching ? 'partial' : undefined)
  • With true: segments without a prefetch export default to 'partial', so an in-viewport <Link> (the prefetch: 'auto' default) carries only the per-route App Shell.
  • With false: those segments fall back to Next's standard prefetch default (undefined).

Routes that export their own prefetch are unaffected. In this template, app/search/page.tsx is the only such route (prefetch = "allow-runtime"), so it keeps runtime prefetch either way. Home, PDP, collections/[handle], and collections/all currently rely on the global default, so this change moves them off 'partial' back to standard prefetch.

cacheComponents: true stays on (a hard requirement for partialPrefetching when truthy), so this is the only edit needed and partial prerendering (PPR) is untouched — the static-shell routes still report ◐ in the route table.

Validation

  • tsc --noEmit
  • pnpm --filter template lint (oxlint + oxfmt --check)
  • Full production build validated by the preview deploy below.

Rollout log

Adds packages/plugin/template-rollout-log/2026-06-22-disable-partial-prefetching.md (defaultAction: review) so downstream storefronts can reason about adopting/skipping the revert. No docs update — partialPrefetching isn't referenced in apps/docs.

Notes

🤖 Generated with Claude Code

Flip `partialPrefetching` from `true` to `false` in next.config.ts,
backing out the partial-prefetch experiment (#322). The key stays
present (explicitly `false`) to document the deliberate choice.

`partialPrefetching` only sets the default route-segment prefetch
strategy for segments that don't export their own `prefetch`. With it
off, those segments revert from `'partial'` (App-Shell-only prefetch on
in-viewport links) to Next's standard prefetch default. `search` is the
only route that still exports `prefetch = "allow-runtime"`, so it is
unaffected; home, PDP, and the collection routes move back to the
default.

`cacheComponents` stays on, so partial *prerendering* (PPR) is
unchanged — the static-shell routes still report ◐ in the route table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shop-docs Ready Ready Preview, Comment Jun 24, 2026 12:24pm
shop-template Ready Ready Preview, Comment, Open in v0 Jun 24, 2026 12:24pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant