Files
67f16a522d Fix PPR rendering for configured HTML bots (#96364)
## Summary

When PPR is enabled, requests matching a custom `htmlLimitedBots`
pattern could still use the prerendered route path. As a result, the
configured blocking-metadata behavior was not applied consistently.

Use the existing streaming-metadata decision when selecting the PPR
render path. Built-in bots retain their existing fully buffered
behavior, custom HTML-limited bots can continue streaming body content
after metadata resolves, and regular user agents remain unchanged.

## Verification

- HEADLESS=true pnpm test-start-turbo
test/e2e/app-dir/html-limited-bots-ppr/html-limited-bots-ppr.test.ts
- HEADLESS=true pnpm test-start-webpack
test/e2e/app-dir/html-limited-bots-ppr/html-limited-bots-ppr.test.ts

Co-authored-by: Sebastian Silbermann <[email protected]>
2026-07-29 15:49:57 -07:00

39 lines
776 B
TypeScript

import { Suspense } from 'react'
import { connection } from 'next/server'
async function Dynamic({
searchParams,
}: {
searchParams: Promise<{ stream?: string }>
}) {
await connection()
if ((await searchParams).stream === '1') {
await new Promise<never>(() => {})
}
return <p id="dynamic-content">dynamic content</p>
}
export default function Page({
searchParams,
}: {
searchParams: Promise<{ stream?: string }>
}) {
return (
<div>
<h1 id="static-content">static shell</h1>
<Suspense fallback={<p id="dynamic-fallback">dynamic fallback</p>}>
<Dynamic searchParams={searchParams} />
</Suspense>
</div>
)
}
export async function generateMetadata() {
await connection()
return {
title: 'dynamic title',
}
}