Skip to content

Remove legacy PPR codepaths#94955

Merged
eps1lon merged 11 commits into
canaryfrom
sebbie/remove-legacy-ppr
Jun 22, 2026
Merged

Remove legacy PPR codepaths#94955
eps1lon merged 11 commits into
canaryfrom
sebbie/remove-legacy-ppr

Conversation

@eps1lon

@eps1lon eps1lon commented Jun 18, 2026

Copy link
Copy Markdown
Member

These should be unreachable since we removed support for config.experimental.ppr.

Had to be previously reverted in #90948.

No new findings from my side. I added new errors where in forceDynamic && staticGeneration && cacheComponent branches. These should not be reachable but now we throw explicitly instead of trying to reconcile that defect.

We'll check in closely with the people previously seeing regressions.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Stats cancelled

Commit: 81ffcd6
View workflow run

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 81ffcd6

@vercel vercel Bot 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.

Additional Suggestion:

Removing route-level isRoutePPREnabled plumbing routes the Instant Navigation Testing API / debug static shell into app-render's legacy prerender branch when cacheComponents is disabled, which the in-code comment says "hangs in dev mode."

Fix on Vercel

@eps1lon eps1lon force-pushed the sebbie/remove-legacy-ppr branch 4 times, most recently from 3210e66 to 2868ad9 Compare June 18, 2026 22:52
}

if (typeof dynamic === 'string') {
if (cacheComponents) {

@vercel vercel Bot Jun 18, 2026

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.

After the output: 'export' branch synthesizes dynamic = 'error' for pages with no authored dynamic, the second if (typeof dynamic === 'string') { if (cacheComponents) throw } block still fires, so every page/layout in an output: 'export' + cacheComponents: true project throws a misleading "Please remove it" error even when no dynamic config was authored.

Fix on Vercel

@eps1lon eps1lon force-pushed the sebbie/remove-legacy-ppr branch from 2868ad9 to 13959c3 Compare June 18, 2026 23:21
@eps1lon eps1lon marked this pull request as ready for review June 22, 2026 12:19
@eps1lon eps1lon force-pushed the sebbie/remove-legacy-ppr branch from 13959c3 to 9b19d8c Compare June 22, 2026 12:19
Comment on lines +268 to +272
// TODO: Remove this since this should be caught during compilation.
// Left as a guard in case usage of Postpone was attempted
throw new Error(
`Route segment config "dynamic" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.`
)

@unstubbable unstubbable Jun 22, 2026

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.

Nit: In other similar cases we're throwing an invariant error like this:

throw new InvariantError(
`${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure yet if this is an invariant yet or an actual export const dynamic that we didn't catch at build time.

)
}

// TODO: vroom

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.

🚗 Did you plan to revisit this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah. When inlining the flag, I wasn't sure yet if this is actually just the CC flag. But it's also based on the whether this is app dir or pages dir so I kept it. Removing the comment.

}
export function Postpone({ reason, prerenderState, pathname }) {
postponeWithTracking(prerenderState, reason, pathname);
export function ApiThatShallNotBeNamed({ reason, prerenderState, pathname }) {

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.

😆

@eps1lon eps1lon force-pushed the sebbie/remove-legacy-ppr branch from 9b19d8c to 47e5f6c Compare June 22, 2026 14:01
@eps1lon eps1lon force-pushed the sebbie/remove-legacy-ppr branch from 47e5f6c to 7552a45 Compare June 22, 2026 18:11
@eps1lon eps1lon enabled auto-merge (squash) June 22, 2026 18:12
@eps1lon eps1lon merged commit e7f4e33 into canary Jun 22, 2026
127 of 128 checks passed
@eps1lon eps1lon deleted the sebbie/remove-legacy-ppr branch June 22, 2026 19:21
Comment on lines -1573 to -1577
if (result.cacheComponents) {
// TODO: remove once we've finished migrating internally to cacheComponents.
result.experimental.ppr = true
}

@eps1lon eps1lon Jun 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Broke legacy builders that require changes like vercel/vercel#16706.

Fixing in #95111

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reverting for now (#95113) and then thinking about forward fix.

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

Labels

None yet

2 participants