Unverified Commit 9fb99c7a authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Enable `metadata-streaming-config` for Cache Components (#94936)

parent ee6cef2e
import { connection } from 'next/server'
export default async function Page() {
await connection()
return <p>dynamic</p>
}
import { Suspense } from 'react' import { Suspense } from 'react'
export default function Root({ children }) { export default function Root({ children }: { children: React.ReactNode }) {
return <Suspense fallback={<p>Loading...</p>}>{children}</Suspense> return <Suspense fallback={<p>Loading...</p>}>{children}</Suspense>
} }
import { connection } from 'next/server' import { connection } from 'next/server'
export const instant = false
export default async function Page() { export default async function Page() {
await connection() await connection()
return <p>ppr</p> return <p>ppr</p>
} }
export const experimental_ppr = true
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO: the incremental option has been removed, update to use cacheComponents describe('app-dir - metadata-streaming-config-customized', () => {
describe.skip('app-dir - metadata-streaming-config-customized', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
overrideFiles: { overrideFiles: {
'next.config.js': ` 'next.config.js': `
module.exports = { module.exports = {
htmlLimitedBots: /MyBot/i, htmlLimitedBots: /MyBot/i,
experimental: { cacheComponents: true,
ppr: 'incremental',
}
} }
`, `,
}, },
...@@ -32,6 +29,21 @@ describe.skip('app-dir - metadata-streaming-config-customized', () => { ...@@ -32,6 +29,21 @@ describe.skip('app-dir - metadata-streaming-config-customized', () => {
expect(bypassConfigs).toMatchInlineSnapshot(` expect(bypassConfigs).toMatchInlineSnapshot(`
{ {
"/": {
"key": "user-agent",
"type": "header",
"value": "MyBot",
},
"/_global-error": {
"key": "user-agent",
"type": "header",
"value": "MyBot",
},
"/_not-found": {
"key": "user-agent",
"type": "header",
"value": "MyBot",
},
"/ppr": { "/ppr": {
"key": "user-agent", "key": "user-agent",
"type": "header", "type": "header",
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO: the incremental option has been removed, update to use cacheComponents describe('app-dir - metadata-streaming-config', () => {
describe.skip('app-dir - metadata-streaming-config', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -36,6 +35,21 @@ describe.skip('app-dir - metadata-streaming-config', () => { ...@@ -36,6 +35,21 @@ describe.skip('app-dir - metadata-streaming-config', () => {
expect(bypassConfigs).toMatchInlineSnapshot(` expect(bypassConfigs).toMatchInlineSnapshot(`
{ {
"/": {
"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",
},
"/_global-error": {
"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",
},
"/_not-found": {
"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",
},
"/ppr": { "/ppr": {
"key": "user-agent", "key": "user-agent",
"type": "header", "type": "header",
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
* @type {import('next').NextConfig} * @type {import('next').NextConfig}
*/ */
const nextConfig = { const nextConfig = {
experimental: { cacheComponents: true,
ppr: 'incremental',
},
} }
module.exports = nextConfig module.exports = nextConfig
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment