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'
export default function Root({ children }) {
export default function Root({ children }: { children: React.ReactNode }) {
return <Suspense fallback={<p>Loading...</p>}>{children}</Suspense>
}
import { connection } from 'next/server'
export const instant = false
export default async function Page() {
await connection()
return <p>ppr</p>
}
export const experimental_ppr = true
import { nextTestSetup } from 'e2e-utils'
// TODO: the incremental option has been removed, update to use cacheComponents
describe.skip('app-dir - metadata-streaming-config-customized', () => {
describe('app-dir - metadata-streaming-config-customized', () => {
const { next } = nextTestSetup({
files: __dirname,
overrideFiles: {
'next.config.js': `
module.exports = {
htmlLimitedBots: /MyBot/i,
experimental: {
ppr: 'incremental',
}
cacheComponents: true,
}
`,
},
......@@ -32,6 +29,21 @@ describe.skip('app-dir - metadata-streaming-config-customized', () => {
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": {
"key": "user-agent",
"type": "header",
......
import { nextTestSetup } from 'e2e-utils'
// TODO: the incremental option has been removed, update to use cacheComponents
describe.skip('app-dir - metadata-streaming-config', () => {
describe('app-dir - metadata-streaming-config', () => {
const { next } = nextTestSetup({
files: __dirname,
})
......@@ -36,6 +35,21 @@ describe.skip('app-dir - metadata-streaming-config', () => {
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": {
"key": "user-agent",
"type": "header",
......
......@@ -2,9 +2,7 @@
* @type {import('next').NextConfig}
*/
const nextConfig = {
experimental: {
ppr: 'incremental',
},
cacheComponents: true,
}
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