Replace PPR config helpers with cacheComponents checks#90704
Replace PPR config helpers with cacheComponents checks#90704devjiwonchoi merged 2 commits intocanaryfrom
Conversation
The `cacheComponents` flag already auto-enables `experimental.ppr` during config normalization (config.ts line 1399), making the PPR helper functions `checkIsAppPPREnabled` and `checkIsRoutePPREnabled` just unnecessary indirection. This consolidates PPR configuration to a single source of truth. Since users cannot set `experimental.ppr` directly (throws HardDeprecatedConfigError), the behavior is unchanged when replacing PPR config checks with direct `cacheComponents` checks. This is the first PR of a 3-part series to safely remove legacy PPR code incrementally.
Tests Passed |
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **401 kB** → **401 kB** ✅ -23 B80 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (9 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsDiff too large to display app-page-tur..time.prod.jsfailed to diffapp-page.runtime.dev.jsDiff too large to display app-page.runtime.prod.jsfailed to diffserver.runtime.prod.jsDiff too large to display 📎 Tarball URL |
|
Notifying the following users due to files changed in this PR based on this repo's notify modifiers: @timneutkens, @ijjk, @shuding, @huozhi: |
| ) | ||
|
|
||
| const isAppPPREnabled = checkIsAppPPREnabled(config.experimental.ppr) | ||
| const isAppPPREnabled = !!config.cacheComponents |
There was a problem hiding this comment.
rename the const as well
| const couldSupportPPR: boolean = checkIsAppPPREnabled( | ||
| nextConfig.experimental.ppr | ||
| ) | ||
| const couldSupportPPR: boolean = !!nextConfig.cacheComponents |
There was a problem hiding this comment.
rename the const as well
packages/next/src/build/index.ts
Outdated
| config.experimental.authInterrupts | ||
| ) | ||
| const isAppPPREnabled = checkIsAppPPREnabled(config.experimental.ppr) | ||
| const isAppPPREnabled = isAppCacheComponentsEnabled |
There was a problem hiding this comment.
use isAppCacheComponentsEnabled at the usage sites
| ? checkIsRoutePPREnabled(config.experimental.ppr) | ||
| : false | ||
| const isRoutePPREnabled: boolean = | ||
| !!appConfig && isAppCacheComponentsEnabled |
There was a problem hiding this comment.
note to self: this gets removed in the upstack PR
| * The Partial Prerendering feature is still available via `cacheComponents`. | ||
| */ | ||
| ppr?: ExperimentalPPRConfig | ||
| ppr?: boolean | 'incremental' |
There was a problem hiding this comment.
Will this be removed in an upstack PR?
There was a problem hiding this comment.
In this PR, the entire file is deleted: packages/next/src/server/lib/experimental/ppr.ts forExperimentalPPRConfig
EDIT: Do you mean the ppr option?
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Tests Passed |
…anch (#90713) Stacked on #90704 This PR replaces `experimental.isRoutePPREnabled` render options with `cacheComponents` and removes unused code. Verified deployment tests pass on CI: https://github.com/vercel/next.js/actions/runs/22536405880
This reverts commit 70a2e8d.
This reverts commit 70a2e8d.
This PR replaces the legacy PPR configs in the codebase with the `cacheComponents` config. Confirmed deployment test passes https://github.com/vercel/next.js/actions/runs/22533307017 --------- Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
…anch (#90713) Stacked on #90704 This PR replaces `experimental.isRoutePPREnabled` render options with `cacheComponents` and removes unused code. Verified deployment tests pass on CI: https://github.com/vercel/next.js/actions/runs/22536405880
This PR replaces the legacy PPR configs in the codebase with the
cacheComponentsconfig.Confirmed deployment test passes https://github.com/vercel/next.js/actions/runs/22533307017