mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This hard deprecates the `experimental.ppr` configuration, requiring users to opt-in instead via `experimental.cacheComponents`. This does mean that the previous `experimental.ppr = "incremental"` will no longer be supported. NAR-433
48 lines
1.9 KiB
TypeScript
48 lines
1.9 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
// TODO: the incremental option has been removed, update to use cacheComponents
|
|
describe.skip('app-dir - metadata-streaming-config', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should have the default streaming metadata config output in routes-manifest.json', async () => {
|
|
const requiredServerFiles = JSON.parse(
|
|
await next.readFile('.next/required-server-files.json')
|
|
)
|
|
|
|
expect(requiredServerFiles.config.htmlLimitedBots).toMatchInlineSnapshot(
|
|
`"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight"`
|
|
)
|
|
|
|
const prerenderManifest = JSON.parse(
|
|
await next.readFile('.next/prerender-manifest.json')
|
|
)
|
|
const { routes } = prerenderManifest
|
|
|
|
const bypassConfigs = Object.keys(routes)
|
|
// Pick the user-agent bypass config of each route
|
|
.map((route) => [
|
|
route,
|
|
routes[route].experimentalBypassFor?.find(
|
|
(bypassConfig) => bypassConfig.key === 'user-agent'
|
|
),
|
|
])
|
|
.filter(([, bypassConfig]) => Boolean(bypassConfig))
|
|
.reduce((acc, [route, bypassConfig]) => {
|
|
acc[route] = bypassConfig
|
|
return acc
|
|
}, {})
|
|
|
|
expect(bypassConfigs).toMatchInlineSnapshot(`
|
|
{
|
|
"/ppr": {
|
|
"key": "user-agent",
|
|
"type": "header",
|
|
"value": "[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight",
|
|
},
|
|
}
|
|
`)
|
|
})
|
|
})
|