- const browser = await next.browser('/', {
- beforePageLoad(p: Playwright.Page) {
- act = createRouterAct(p)
- },
- })
-
- const linkVisibilityToggle = await browser.elementByCss(
- 'input[data-link-accordion="/dynamic-with-ppr"]'
- )
- await act(async () => {
- await linkVisibilityToggle.click()
- }, [
- // This assertion will fail if this string appears in multiple requests.
- {
- includes: 'Loading dynamic content...',
- },
- // Does not include the dynamic content
- {
- block: 'reject',
- includes: 'Dynamic Content',
- },
- ])
-
- // When navigating to the prefetched dynamic page, an additional request
- // is issued to fetch the dynamic content.
- const link = await browser.elementByCss('a[href="/dynamic-with-ppr"]')
- await act(
- async () => {
- await link.click()
- },
- {
- includes: 'Dynamic Content',
- }
- )
- const dynamicContent = await browser.elementById('dynamic-content')
- expect(await dynamicContent.innerHTML()).toBe('Dynamic Content')
- })
-
- it('prefetches a dynamic page (without PPR enabled)', async () => {
- let act: ReturnType
- const browser = await next.browser('/', {
- beforePageLoad(p: Playwright.Page) {
- act = createRouterAct(p)
- },
- })
-
- const linkVisibilityToggle = await browser.elementByCss(
- 'input[data-link-accordion="/dynamic-without-ppr"]'
- )
- await act(async () => {
- await linkVisibilityToggle.click()
- }, [
- // This assertion will fail if this string appears in multiple requests.
- {
- includes: 'Loading dynamic content...',
- },
- // Does not include the dynamic content
- {
- block: 'reject',
- includes: 'Dynamic Content',
- },
- ])
-
- // When navigating to the prefetched dynamic page, an additional request
- // is issued to fetch the dynamic content.
- const link = await browser.elementByCss('a[href="/dynamic-without-ppr"]')
- await act(
- async () => {
- await link.click()
- },
- {
- includes: 'Dynamic Content',
- }
- )
- const dynamicContent = await browser.elementById('dynamic-content')
- expect(await dynamicContent.innerHTML()).toBe('Dynamic Content')
- })
-})
diff --git a/test/e2e/app-dir/segment-cache/client-only-opt-in/components/link-accordion.tsx b/test/e2e/app-dir/segment-cache/client-only-opt-in/components/link-accordion.tsx
deleted file mode 100644
index c6848d479aef8..0000000000000
--- a/test/e2e/app-dir/segment-cache/client-only-opt-in/components/link-accordion.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-'use client'
-
-import Link, { type LinkProps } from 'next/link'
-import { useState } from 'react'
-
-export function LinkAccordion({
- href,
- children,
- prefetch,
-}: {
- href: string
- children: React.ReactNode
- prefetch?: LinkProps['prefetch']
-}) {
- const [isVisible, setIsVisible] = useState(false)
- return (
- <>
- setIsVisible(!isVisible)}
- data-link-accordion={href}
- />
- {isVisible ? (
-
- {children}
-
- ) : (
- <>{children} (link is hidden)>
- )}
- >
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/client-only-opt-in/next.config.js b/test/e2e/app-dir/segment-cache/client-only-opt-in/next.config.js
deleted file mode 100644
index 209191815e9e4..0000000000000
--- a/test/e2e/app-dir/segment-cache/client-only-opt-in/next.config.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @type {import('next').NextConfig}
- */
-const nextConfig = {
- experimental: {
- ppr: 'incremental',
- clientSegmentCache: 'client-only',
- },
-}
-
-module.exports = nextConfig
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/[projectSlug]/monitoring/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/[projectSlug]/monitoring/page.jsx
deleted file mode 100644
index bf6b50df6d8e0..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/[projectSlug]/monitoring/page.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function Page() {
- await connection()
-
- return /[lang]/[teamSlug]/[projectSlug]/monitoring
-}
-
-export const experimental_ppr = true
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/~/monitoring/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/~/monitoring/page.jsx
deleted file mode 100644
index 73113af389085..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/[teamSlug]/~/monitoring/page.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function Page() {
- await connection()
-
- return /[lang]/[teamSlug]/~/monitoring
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/layout.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/layout.jsx
deleted file mode 100644
index 088b825e33cad..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/layout.jsx
+++ /dev/null
@@ -1,11 +0,0 @@
-export default function RootLayout({ children, params }) {
- return (
-
- {children}
-
- )
-}
-
-export function generateStaticParams() {
- return ['en', 'fr'].map((lang) => ({ lang }))
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/loading.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/loading.jsx
deleted file mode 100644
index 09367d77b06ee..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/loading.jsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Loading() {
- return Loading...
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/page.jsx
deleted file mode 100644
index a281b7a197c36..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/[lang]/page.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import Link from 'next/link'
-
-export default function Page() {
- return (
-
- Monitoring
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/layout.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/layout.jsx
deleted file mode 100644
index 803f17d863c8a..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/layout.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function RootLayout({ children }) {
- return (
-
- {children}
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/page.tsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/page.tsx
deleted file mode 100644
index 72ece76bc5379..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/new/[teamSlug]/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Page() {
- return '/new/[teamSlug]/page.tsx'
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/[id]/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/[id]/page.jsx
deleted file mode 100644
index b2b537ebca2f7..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/[id]/page.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function Page() {
- await connection()
-
- return /prefetch-tests/[id]
-}
-
-export const experimental_ppr = true
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/dynamic/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/dynamic/page.jsx
deleted file mode 100644
index 9eb3f10e14e93..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/dynamic/page.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function Page() {
- await connection()
-
- return /prefetch-tests/dynamic
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/layout.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/layout.jsx
deleted file mode 100644
index 484952a22bcbe..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/layout.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function RootLayout({ children, params }) {
- return (
-
- {children}
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/page.jsx b/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/page.jsx
deleted file mode 100644
index baa9f6289f21c..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/app/prefetch-tests/page.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import Link from 'next/link'
-
-export default function Page() {
- return (
-
- Dynamic
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/conflicting-routes.test.ts b/test/e2e/app-dir/segment-cache/conflicting-routes/conflicting-routes.test.ts
deleted file mode 100644
index 01752a09b2ddc..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/conflicting-routes.test.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { nextTestSetup } from 'e2e-utils'
-import { computeCacheBustingSearchParam } from 'next/dist/shared/lib/router/utils/cache-busting-search-param'
-
-describe('conflicting routes', () => {
- const { next, isNextDev, isNextDeploy } = nextTestSetup({
- files: __dirname,
- })
- if (isNextDev) {
- test('prefetching is disabled', () => {})
- return
- }
-
- // The server will reject prefetch requests that don't set a cache-busting
- // search param.
- // TODO: We should try to avoid unit tests that simulate internal client
- // router requests. There are only a handful of cases that do this currently.
- // In the meantime, consider moving this into a shared testing utility.
- async function segmentPrefetch(url: string, segmentPath: string) {
- const fetchUrl = new URL(url, 'http://localhost')
- const searchParams = new URLSearchParams(fetchUrl.search)
- searchParams.set(
- '_rsc',
- computeCacheBustingSearchParam('1', segmentPath, undefined, undefined)
- )
- fetchUrl.search = searchParams.toString()
- return await next.fetch(fetchUrl.pathname + fetchUrl.search, {
- headers: {
- rsc: '1',
- 'next-router-prefetch': '1',
- 'next-router-segment-prefetch': segmentPath,
- },
- })
- }
-
- it.each([
- '/en/vercel/~/monitoring',
- '/fr/vercel/~/monitoring',
- '/es/vercel/~/monitoring',
- ])('%s matches the right route', async (path) => {
- const res = await segmentPrefetch(path, '/_tree')
- expect(res.status).toBe(200)
-
- if (isNextDeploy) {
- expect(res.headers.get('x-matched-path')).toBe(
- '/[lang]/[teamSlug]/~/monitoring.prefetch.rsc'
- )
- }
- })
-
- it('matches the right route when the original route has no dynamic params, is dynamic, and PPR is disabled', async () => {
- const res = await segmentPrefetch('/prefetch-tests/dynamic', '/_tree')
- expect(res.status).toBe(200)
-
- if (isNextDeploy) {
- expect(res.headers.get('x-matched-path')).toBe(
- '/prefetch-tests/dynamic.prefetch.rsc'
- )
- }
- })
-
- it('handles conflict between App Router and Pages Router routes', async () => {
- const res = await segmentPrefetch('/new/templates', '/_tree')
-
- expect(res.status).toBe(200)
- expect(await res.text()).toContain(
- // when deployed we map to an empty object to signal to
- // client router it should MPA navigate
- isNextDeploy ? '{}' : '/new/templates/[[...slug]].js'
- )
- })
-})
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/next.config.js b/test/e2e/app-dir/segment-cache/conflicting-routes/next.config.js
deleted file mode 100644
index 1fb210a73ee9e..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/next.config.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @type {import('next').NextConfig}
- */
-const nextConfig = {
- experimental: {
- ppr: 'incremental',
- clientSegmentCache: true,
- },
-}
-
-module.exports = nextConfig
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_app.js b/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_app.js
deleted file mode 100644
index cf06318a0f30f..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_app.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function App({ Component, pageProps }) {
- return
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_document.js b/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_document.js
deleted file mode 100644
index 54e8bf3e2a290..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/_document.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Html, Head, Main, NextScript } from 'next/document'
-
-export default function Document() {
- return (
-
-
-
-
-
-
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/new/templates/[[...slug]].js b/test/e2e/app-dir/segment-cache/conflicting-routes/pages/new/templates/[[...slug]].js
deleted file mode 100644
index acad19b3cc2c7..0000000000000
--- a/test/e2e/app-dir/segment-cache/conflicting-routes/pages/new/templates/[[...slug]].js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Page() {
- return '/new/templates/[[...slug]].js'
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/layout.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/layout.tsx
deleted file mode 100644
index dbce4ea8e3aeb..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/layout.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-export default function RootLayout({
- children,
-}: {
- children: React.ReactNode
-}) {
- return (
-
- {children}
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/link-accordion.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/link-accordion.tsx
deleted file mode 100644
index 40e57151e3055..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/link-accordion.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-'use client'
-
-import Link, { type LinkProps } from 'next/link'
-import { useState } from 'react'
-
-export function LinkAccordion({
- href,
- children,
- prefetch,
- id,
-}: {
- href: string
- children: string
- prefetch?: LinkProps['prefetch']
- id?: string
-}) {
- const [isVisible, setIsVisible] = useState(false)
- return (
- <>
- setIsVisible(!isVisible)}
- data-link-accordion={href}
- id={id}
- />
- {isVisible ? (
-
- {children}
-
- ) : (
- `${children} (link is hidden)`
- )}
- >
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/layout.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/layout.tsx
deleted file mode 100644
index cf9cbb2176600..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/layout.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { Suspense } from 'react'
-import { connection } from 'next/server'
-
-async function DynamicContentInSharedLayout() {
- await connection()
- return (
-
- Dynamic content in shared layout
-
- )
-}
-
-export default function SharedLayout({
- children,
-}: {
- children: React.ReactNode
-}) {
- return (
-
-
- Loading (PPR shell of shared-layout)...
-
- }
- >
-
-
- {children}
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-disabled/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-disabled/page.tsx
deleted file mode 100644
index 94bb9c4715b42..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-disabled/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Suspense } from 'react'
-import { connection } from 'next/server'
-
-async function Content() {
- await connection()
- return Dynamic page content
-}
-
-export default async function Page() {
- return (
- Loading page...}>
-
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-enabled/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-enabled/page.tsx
deleted file mode 100644
index 88abcd9dc8431..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/a/b/shared-layout/ppr-enabled/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Suspense } from 'react'
-import { connection } from 'next/server'
-
-export const experimental_ppr = true
-
-async function Content() {
- await connection()
- return Dynamic page content
-}
-
-export default async function Page() {
- return (
- Loading page...}>
-
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/layout.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/layout.tsx
deleted file mode 100644
index 2806da8c0b0c7..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/layout.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function SharedLayout({
- children,
-}: {
- children: React.ReactNode
-}) {
- return {children}
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/loading.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/loading.tsx
deleted file mode 100644
index dfcf368a51424..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/has-loading-boundary/loading.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function Loading() {
- return (
-
- Loading (has-loading-boundary/loading.tsx)...
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/page.tsx
deleted file mode 100644
index bc02ad99ecf63..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/mixed-fetch-strategies/page.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { LinkAccordion } from '../link-accordion'
-
-export default function MixedFetchStrategies() {
- return (
- <>
-
- This page tests what happens when a shared layout belongs to both a
- PPR-enabled route and a non-PPR enabled route. The layout data should be
- omitted when prefetching the non-PPR enabled route, because it's inside
- another layout that has a loading boundary. But it should be included
- when prefetching the route that has PPR enabled.
-
-
- -
-
- Link to PPR enabled page
-
-
- -
-
- Same link, but with prefetch="unstable_forceStale"
-
-
-
-
- -
-
- Link to PPR disabled page
-
-
-
- >
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx
deleted file mode 100644
index 1c3c2e2ac7744..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { LinkAccordion } from './link-accordion'
-
-export default function Page() {
- return (
- <>
-
- This page is used to test that if you prefetch a link multiple times,
- the prefetches are deduped by the client cache (unless/until they become
- stale). The e2e associated with this page works by toggling the
- visibility of the links and checking whether any prefetch requests are
- issued.
-
-
- You can test the behavior manually by opening up the network tab in the
- browser's DevTools and seeing what happens when you toggle a Link's
- visibility.
-
-
- -
-
- Page with PPR enabled
-
-
- -
-
- Page with PPR enabled but has dynamic param
-
-
- -
-
- Page with PPR disabled
-
-
- -
-
- Page with PPR disabled, but has a loading boundary
-
-
- -
-
- Another dynamic page that shares the same loading boundary
-
-
-
-
- -
-
- Page with PPR disabled and a dynamic head, prefetch=true
-
-
-
- >
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx
deleted file mode 100644
index 3d3488f4b41d5..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Suspense } from 'react'
-import { connection } from 'next/server'
-import { Metadata } from 'next'
-
-export async function generateMetadata({
- searchParams,
-}: {
- searchParams: Promise<{ foo: string }>
-}): Promise {
- const { foo } = await searchParams
- return {
- title: 'Dynamic Title: ' + (foo ?? '(empty)'),
- }
-}
-
-async function Content() {
- await connection()
- return Page content
-}
-
-export default function PPRDisabledDynamicHead() {
- return (
-
-
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/child/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/child/page.tsx
deleted file mode 100644
index 07dd4704a4a36..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/child/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function PPRDisabledWithLoadingBoundaryChildPage() {
- await connection()
- return Child page content
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/loading.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/loading.tsx
deleted file mode 100644
index d28ada742ee64..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/loading.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Loading() {
- return Loading...
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/page.tsx
deleted file mode 100644
index 379aaf559743a..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-with-loading-boundary/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { connection } from 'next/server'
-
-export default async function PPRDisabledWithLoadingBoundary() {
- await connection()
- return Page content
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled/page.tsx
deleted file mode 100644
index 71adef20a785a..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled/page.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Suspense } from 'react'
-import { connection } from 'next/server'
-
-async function Content() {
- await connection()
- return Page content
-}
-
-export default function PPRDisabled() {
- return (
-
-
-
- )
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/[dynamic-param]/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/[dynamic-param]/page.tsx
deleted file mode 100644
index 20f9d2f245e60..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/[dynamic-param]/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function Page() {
- return Page content
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/layout.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/layout.tsx
deleted file mode 100644
index 877c4a4112361..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/layout.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-export const experimental_ppr = true
-
-export default function RootLayout({
- children,
-}: {
- children: React.ReactNode
-}) {
- return children
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/page.tsx
deleted file mode 100644
index b531e1eee30b6..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-enabled/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function PPREnabled() {
- return Page content
-}
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/next.config.js b/test/e2e/app-dir/segment-cache/incremental-opt-in/next.config.js
deleted file mode 100644
index 1fb210a73ee9e..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/next.config.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * @type {import('next').NextConfig}
- */
-const nextConfig = {
- experimental: {
- ppr: 'incremental',
- clientSegmentCache: true,
- },
-}
-
-module.exports = nextConfig
diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts b/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts
deleted file mode 100644
index 3d13c83f53a7d..0000000000000
--- a/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts
+++ /dev/null
@@ -1,510 +0,0 @@
-import { nextTestSetup } from 'e2e-utils'
-import { createRouterAct } from 'router-act'
-import { Page } from 'playwright'
-
-describe('segment cache (incremental opt in)', () => {
- const { next, isNextDev } = nextTestSetup({
- files: __dirname,
- })
- if (isNextDev) {
- test('ppr is disabled', () => {})
- return
- }
-
- async function testPrefetchDeduping(linkHref) {
- // This e2e test app is designed to verify that if you prefetch a link
- // multiple times, the prefetches are deduped by the client cache
- // (unless/until they become stale). It works by toggling the visibility of
- // the links and checking whether any prefetch requests are issued.
- //
- // Throughout the duration of the test, we collect all the prefetch requests
- // that occur. Then at the end we confirm there are no duplicates.
- const prefetches = new Map()
- const duplicatePrefetches = new Map()
- const unexpectedResponses = []
-
- let currentPage: Page
- const browser = await next.browser('/', {
- async beforePageLoad(page) {
- currentPage = page
- await page.route('**/*', async (route) => {
- const request = route.request()
- const headers = await request.allHeaders()
- const isPrefetch =
- headers['rsc'] !== undefined &&
- headers['next-router-prefetch'] !== undefined
- if (isPrefetch) {
- const url = request.url()
- const prefetchInfo = {
- href: new URL(url).pathname,
- segment: headers['next-router-segment-prefetch'],
- base: headers['next-router-state-tree'] ?? null,
- }
- const key = JSON.stringify(prefetchInfo)
- if (prefetches.has(key)) {
- duplicatePrefetches.set(key, prefetchInfo)
- } else {
- prefetches.set(key, prefetchInfo)
- }
- const response = await page.request.fetch(request, {
- maxRedirects: 0,
- })
- const status = response.status()
- if (status !== 200) {
- unexpectedResponses.push({
- status,
- url,
- headers: response.headers(),
- response: await response.text(),
- })
- }
- return route.fulfill({ response })
- }
- route.continue()
- })
- },
- })
-
- // Each link on the test page has a checkbox that controls its visibility.
- // It starts off as hidden.
- const checkbox = await browser.elementByCss(
- `input[data-link-accordion="${linkHref}"]`
- )
- // Confirm the checkbox is not checked
- expect(await checkbox.isChecked()).toBe(false)
-
- // Click the checkbox to reveal the link and trigger a prefetch
- await checkbox.click()
- await browser.elementByCss(`a[href="${linkHref}"]`)
-
- // Toggle the visibility of the link. Prefetches are initiated on viewport,
- // so if the cache does not dedupe then properly, this test will detect it.
- await checkbox.click() // hide
- await checkbox.click() // show
- const link = await browser.elementByCss(`a[href="${linkHref}"]`)
-
- // Navigate to the target link
- await link.click()
-
- // Confirm the navigation happened
- await browser.elementById('page-content')
- expect(new URL(await browser.url()).pathname).toBe(linkHref)
-
- // Wait for all pending requests to complete.
- await currentPage.unrouteAll({ behavior: 'wait' })
-
- // Finally, assert there were no duplicate prefetches and no unexpected
- // responses.
- expect(prefetches).not.toBeEmpty()
- expect(duplicatePrefetches).toBeEmpty()
- expect(unexpectedResponses).toBeEmpty()
- }
-
- describe('multiple prefetches to same link are deduped', () => {
- it('page with PPR enabled', () => testPrefetchDeduping('/ppr-enabled'))
- it('page with PPR enabled, and has a dynamic param', () =>
- testPrefetchDeduping('/ppr-enabled/dynamic-param'))
- it('page with PPR disabled', () => testPrefetchDeduping('/ppr-disabled'))
- it('page with PPR disabled, and has a loading boundary', () =>
- testPrefetchDeduping('/ppr-disabled-with-loading-boundary'))
- })
-
- it('prefetches a dynamic route when PPR is disabled if it has a loading.tsx boundary', async () => {
- let act
- const browser = await next.browser('/', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Initiate a prefetch for a dynamic page with no PPR, but with a
- // loading.tsx boundary. We should be able to prefetch up to the
- // loading boundary.
- await act(async () => {
- const checkbox = await browser.elementByCss(
- `input[data-link-accordion="/ppr-disabled-with-loading-boundary"]`
- )
- await checkbox.click()
- }, [
- // Response includes the loading boundary
- { includes: 'Loading...' },
- // but it does not include the dynamic page content
- { includes: 'Page content', block: 'reject' },
- ])
-
- // Navigate to the page
- await act(
- async () => {
- await browser
- .elementByCss(`a[href="/ppr-disabled-with-loading-boundary"]`)
- .click()
- // We can immediately render the loading boundary before the network
- // responds, because it was prefetched
- const loadingBoundary = await browser.elementById('loading-boundary')
- expect(await loadingBoundary.text()).toBe('Loading...')
- },
- // The page content is fetched on navigation
- { includes: 'Page content' }
- )
- const pageContent = await browser.elementById('page-content')
- expect(await pageContent.text()).toBe('Page content')
- })
-
- it(
- 'skips prefetching a dynamic route when PPR is disabled if everything up ' +
- 'to its loading.tsx boundary is already cached',
- async () => {
- let act
- const browser = await next.browser('/', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Initiate a prefetch for a dynamic page with no PPR, but with a
- // loading.tsx boundary. We should be able to prefetch up to the
- // loading boundary.
- await act(async () => {
- const checkbox = await browser.elementByCss(
- `input[data-link-accordion="/ppr-disabled-with-loading-boundary"]`
- )
- await checkbox.click()
- }, [
- // Response includes the loading boundary
- { includes: 'Loading...' },
- // but it does not include the dynamic page content
- { includes: 'Page content', block: 'reject' },
- ])
-
- // When prefetching a different page with the same loading boundary,
- // we should not need to fetch the loading boundary again
- await act(
- async () => {
- const checkbox = await browser.elementByCss(
- `input[data-link-accordion="/ppr-disabled-with-loading-boundary/child"]`
- )
- await checkbox.click()
- },
- { includes: 'Loading...', block: 'reject' }
- )
-
- // Navigate to the page
- await act(async () => {
- await browser
- .elementByCss(`a[href="/ppr-disabled-with-loading-boundary/child"]`)
- .click()
- // We can immediately render the loading boundary before the network
- // responds, because it was prefetched
- const loadingBoundary = await browser.elementById('loading-boundary')
- expect(await loadingBoundary.text()).toBe('Loading...')
- }, [
- // The page content is fetched on navigation
- { includes: 'Child page content' },
- // The loading boundary is not fetched on navigation, because it
- // was already loaded into the cache during the prefetch for the
- // other page.
- { includes: 'Loading...', block: 'reject' },
- ])
- const pageContent = await browser.elementById('child-page-content')
- expect(await pageContent.text()).toBe('Child page content')
- }
- )
-
- it('skips prefetching a dynamic route when PPR is disabled if it has no loading.tsx boundary', async () => {
- let act
- const browser = await next.browser('/', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Initiate a prefetch for a dynamic page with no loading.tsx and no PPR.
- // The route tree prefetch will tell the client that there is no loading
- // boundary, and therefore the client can skip prefetching the data, since
- // it would be an empty response, anyway.
- await act(
- async () => {
- const checkbox = await browser.elementByCss(
- `input[data-link-accordion="/ppr-disabled"]`
- )
- await checkbox.click()
- },
- // We should not prefetch the page content
- { includes: 'Page content', block: 'reject' }
- )
-
- // Navigate to the page
- await act(
- async () => {
- await browser.elementByCss(`a[href="/ppr-disabled"]`).click()
- },
- // The page content is fetched on navigation
- { includes: 'Page content' }
- )
- const pageContent = await browser.elementById('page-content')
- expect(await pageContent.text()).toBe('Page content')
- })
-
- it(
- 'prefetches a shared layout on a PPR-enabled route that was previously ' +
- 'omitted from a non-PPR-enabled route',
- async () => {
- let act
- const browser = await next.browser('/mixed-fetch-strategies', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Initiate a prefetch for the PPR-disabled route first. This will not
- // include the /shared-layout/ segment, because it's inside the
- // loading boundary.
- await act(async () => {
- const checkbox = await browser.elementById('ppr-disabled')
- await checkbox.click()
- })
-
- // Then initiate a prefetch for the PPR-enabled route. This prefetch
- // should include the /shared-layout/ segment despite the presence of
- // the loading boundary, and despite the earlier non-PPR attempt
- await act(async () => {
- const checkbox = await browser.elementById('ppr-enabled')
- await checkbox.click()
- })
-
- // Navigate to the PPR-enabled route
- await act(async () => {
- const link = await browser.elementByCss('#ppr-enabled + a')
- await link.click()
-
- // If we prefetched all the segments correctly, we should be able to
- // reveal the page's loading state, before the server responds.
- await browser.elementById('page-loading-boundary')
- })
- }
- )
-
- it(
- 'when a link is prefetched with , no dynamic request ' +
- 'is made on navigation',
- async () => {
- let act
- const browser = await next.browser('/mixed-fetch-strategies', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- await act(
- async () => {
- const checkbox = await browser.elementById(
- 'ppr-enabled-prefetch-true'
- )
- await checkbox.click()
- },
- {
- includes: 'Dynamic page content',
- }
- )
-
- // Navigate to fully prefetched route
- const link = await browser.elementByCss('#ppr-enabled-prefetch-true + a')
- await act(
- async () => {
- await link.click()
-
- // We should be able to fully load the page content, including the
- // dynamic data, before the server responds.
- await browser.elementById('page-content')
- },
- // Assert that no network requests are initiated within this block.
- 'no-requests'
- )
- }
- )
-
- it(
- 'when prefetching with prefetch="unstable_forceStale", refetches cache entries that only ' +
- 'contain partial data',
- async () => {
- let act
- const browser = await next.browser('/mixed-fetch-strategies', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Prefetch a link with PPR
- await act(
- async () => {
- const checkbox = await browser.elementById('ppr-enabled')
- await checkbox.click()
- },
- { includes: 'Loading (PPR shell of shared-layout)...' }
- )
-
- // Prefetch the same link again, this time with prefetch="unstable_forceStale" to include
- // the dynamic data
- await act(
- async () => {
- const checkbox = await browser.elementById(
- 'ppr-enabled-prefetch-true'
- )
- await checkbox.click()
- },
- {
- includes: 'Dynamic content in shared layout',
- }
- )
-
- // Navigate to the PPR-enabled route
- const link = await browser.elementByCss('#ppr-enabled-prefetch-true + a')
- await act(
- async () => {
- await link.click()
-
- // If we prefetched all the segments correctly, we should be able to
- // fully load the page content, including the dynamic data, before the
- // server responds.
- //
- // If this fails, it likely means that the partial cache entry that
- // resulted from prefetching the normal link ()
- // was not properly re-fetched when the full link () was prefetched.
- await browser.elementById('page-content')
- },
- // Assert that no network requests are initiated within this block.
- 'no-requests'
- )
- }
- )
-
- it(
- 'when prefetching with prefetch="unstable_forceStale", refetches partial cache entries ' +
- "even if there's already a pending PPR request",
- async () => {
- // This test is hard to describe succinctly because it involves a fairly
- // complex race condition between a non-PPR prefetch, a PPR prefetch, and
- // a "full" prefetch. Despite the complexity of the scenario, it's worth
- // testing because could easily happen in real world conditions.
-
- let act
- const browser = await next.browser('/mixed-fetch-strategies', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- // Initiate a prefetch for the PPR-disabled route first. This will not
- // include the /shared-layout/ segment, because it's inside the
- // loading boundary.
- await act(
- async () => {
- const checkbox = await browser.elementById('ppr-disabled')
- await checkbox.click()
- },
- { includes: 'Loading (has-loading-boundary/loading.tsx)...' }
- )
-
- // Then initiate a prefetch for the PPR-enabled route.
- await act(async () => {
- // Create an inner act scope so we initate a prefetch but block it
- // from responding.
- await act(
- async () => {
- const checkbox = await browser.elementById('ppr-enabled')
- await checkbox.click()
- },
- {
- // This prefetch should include the /shared-layout/ segment despite
- // the presence of the loading boundary, and despite the earlier
- // non-PPR attempt.
- includes: 'Loading (PPR shell of shared-layout)...',
- // We're going to block it from responding, so we can test what
- // happens if another prefetch is initiated in the meantime.
- block: true,
- }
- )
-
- // Before the previous prefetch finishes, prefetch the same link again,
- // this time with prefetch="unstable_forceStale" to include the dynamic data.
- await act(
- async () => {
- const checkbox = await browser.elementById(
- 'ppr-enabled-prefetch-true'
- )
- await checkbox.click()
- },
- // This prefetch should load the dynamic data in the shared layout
- {
- includes: 'Dynamic content in shared layout',
- }
- )
- })
-
- // Navigate to the PPR-enabled route.
- await act(
- async () => {
- const link = await browser.elementByCss(
- '#ppr-enabled-prefetch-true + a'
- )
- await link.click()
-
- // If we prefetched all the segments correctly, we should be able to
- // fully load the page content, including the dynamic data, before the
- // server responds.
- //
- // If this fails, it likely means that the pending cache entry that
- // resulted from prefetching the normal link ()
- // was not properly re-fetched when the full link () was prefetched.
- await browser.elementById('page-content')
- },
- // Assert that no network requests are initiated within this block.
- 'no-requests'
- )
- }
- )
-
- it('fully prefetch a page with a dynamic title', async () => {
- let act
- const browser = await next.browser('/', {
- beforePageLoad(p) {
- act = createRouterAct(p)
- },
- })
-
- await act(
- async () => {
- const checkbox = await browser.elementByCss(
- 'input[data-link-accordion="/ppr-disabled-dynamic-head?foo=yay"]'
- )
- await checkbox.click()
- },
- // Because the link is prefetched with prefetch=true, we should be able to
- // prefetch the title, even though it's dynamic.
- {
- includes: 'Dynamic Title: yay',
- // TODO: Due to a race condition, the metadata is sometimes fetched twice
- // instead of once (though not more than that). The planned fix is to
- // cache metadata separate from the route tree. Then we can remove
- // this option.
- allowMultipleResponses: true,
- }
- )
-
- // When we navigate to the page, it should not make any additional
- // network requests, because both the segment data and the head were
- // fully prefetched.
- await act(async () => {
- const link = await browser.elementByCss(
- 'a[href="/ppr-disabled-dynamic-head?foo=yay"]'
- )
- await link.click()
- const pageContent = await browser.elementById('page-content')
- expect(await pageContent.text()).toBe('Page content')
- const title = await browser.eval(() => document.title)
- expect(title).toBe('Dynamic Title: yay')
- }, 'no-requests')
- })
-})
diff --git a/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts b/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts
index 781816be8bbd7..c0b5d75f4ab4a 100644
--- a/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts
+++ b/test/e2e/app-dir/static-shell-debugging/static-shell-debugging.test.ts
@@ -1,7 +1,8 @@
import { nextTestSetup } from 'e2e-utils'
-describe('static-shell-debugging', () => {
- const ppr = Boolean(process.env.__NEXT_EXPERIMENTAL_PPR)
+// TODO(NAR-423): Migrate to Cache Components.
+describe.skip('static-shell-debugging', () => {
+ const ppr = Boolean(process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS)
const context = {
ppr,
debugging: ppr,
diff --git a/test/e2e/app-dir/sub-shell-generation-middleware/sub-shell-generation-middleware.test.ts b/test/e2e/app-dir/sub-shell-generation-middleware/sub-shell-generation-middleware.test.ts
index 7180f9e73a5c3..0009d7f2ce823 100644
--- a/test/e2e/app-dir/sub-shell-generation-middleware/sub-shell-generation-middleware.test.ts
+++ b/test/e2e/app-dir/sub-shell-generation-middleware/sub-shell-generation-middleware.test.ts
@@ -13,10 +13,7 @@ describe('middleware-static-rewrite', () => {
return
}
- if (
- process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' ||
- process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
- ) {
+ if (process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true') {
// Here we're validating that the correct fallback shell was used for
// rendering.
it('should use the correct fallback route', async () => {
diff --git a/test/e2e/app-dir/use-cache-output-export/use-cache-output-export.test.ts b/test/e2e/app-dir/use-cache-output-export/use-cache-output-export.test.ts
index f5e0fa2cbfdae..dc0b932c01962 100644
--- a/test/e2e/app-dir/use-cache-output-export/use-cache-output-export.test.ts
+++ b/test/e2e/app-dir/use-cache-output-export/use-cache-output-export.test.ts
@@ -10,7 +10,7 @@ describe('use-cache-output-export', () => {
skipStart: process.env.NEXT_TEST_MODE !== 'dev',
})
- if (process.env.__NEXT_EXPERIMENTAL_PPR === 'true') {
+ if (process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true') {
return it.skip('for PPR', () => {
// PPR is not compatible with `output: 'export'`.
})
diff --git a/test/e2e/app-dir/use-cache-private/use-cache-private.test.ts b/test/e2e/app-dir/use-cache-private/use-cache-private.test.ts
index cf0e4a6378b58..bc1fec7ce7328 100644
--- a/test/e2e/app-dir/use-cache-private/use-cache-private.test.ts
+++ b/test/e2e/app-dir/use-cache-private/use-cache-private.test.ts
@@ -1,8 +1,6 @@
import { nextTestSetup } from 'e2e-utils'
-const pprEnabled =
- process.env.__NEXT_EXPERIMENTAL_PPR === 'true' ||
- process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true'
+const pprEnabled = process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true'
describe('use-cache-private', () => {
const { next, isNextDev } = nextTestSetup({
diff --git a/test/e2e/app-dir/use-cache-with-server-function-props/next.config.js b/test/e2e/app-dir/use-cache-with-server-function-props/next.config.js
index bea0706290af6..e9480643df622 100644
--- a/test/e2e/app-dir/use-cache-with-server-function-props/next.config.js
+++ b/test/e2e/app-dir/use-cache-with-server-function-props/next.config.js
@@ -3,7 +3,7 @@
*/
const nextConfig = {
experimental: {
- ppr: true,
+ cacheComponents: true,
useCache: true,
},
}
diff --git a/test/e2e/app-dir/use-cache/use-cache.test.ts b/test/e2e/app-dir/use-cache/use-cache.test.ts
index bfb730e6c050f..bf456aebceb97 100644
--- a/test/e2e/app-dir/use-cache/use-cache.test.ts
+++ b/test/e2e/app-dir/use-cache/use-cache.test.ts
@@ -16,8 +16,6 @@ import { PrerenderManifest } from 'next/dist/build'
const GENERIC_RSC_ERROR =
'An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.'
-const withPPR = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
-
const withCacheComponents =
process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true'
@@ -451,7 +449,7 @@ describe('use-cache', () => {
let prerenderedRoutes = Object.entries(prerenderManifest.routes)
- if (withPPR || withCacheComponents) {
+ if (withCacheComponents) {
// For the purpose of this test we don't consider an incomplete shell.
prerenderedRoutes = prerenderedRoutes.filter(([pathname, route]) => {
const filename = pathname.replace(/^\//, '').replace(/^$/, 'index')
@@ -508,7 +506,7 @@ describe('use-cache', () => {
})
it('should match the expected revalidate and expire configs on the prerender manifest', async () => {
- const { version, routes, dynamicRoutes } = JSON.parse(
+ const { version, routes } = JSON.parse(
await next.readFile('.next/prerender-manifest.json')
) as PrerenderManifest
@@ -525,14 +523,6 @@ describe('use-cache', () => {
expect(routes['/cache-life-with-dynamic'].initialExpireSeconds).toBe(
300
)
- } else if (withPPR) {
- // We don't exclude dynamic caches for the legacy PPR prerendering.
- expect(
- routes['/cache-life-with-dynamic'].initialRevalidateSeconds
- ).toBe(99)
- expect(routes['/cache-life-with-dynamic'].initialExpireSeconds).toBe(
- 299
- )
}
// default expireTime
@@ -541,12 +531,6 @@ describe('use-cache', () => {
// The revalidate config from the fetch call should lower the revalidate
// config for the page.
expect(routes['/cache-tag'].initialRevalidateSeconds).toBe(42)
-
- if (withPPR) {
- // cache life profile "weeks"
- expect(dynamicRoutes['/[id]'].fallbackRevalidate).toBe(604800)
- expect(dynamicRoutes['/[id]'].fallbackExpire).toBe(2592000)
- }
})
it('should match the expected stale config in the page header', async () => {
@@ -562,14 +546,6 @@ describe('use-cache', () => {
expect(cacheLifeWithDynamicMeta.headers['x-nextjs-stale-time']).toBe(
'19'
)
- } else if (withPPR) {
- const cacheLifeWithDynamicMeta = JSON.parse(
- await next.readFile('.next/server/app/cache-life-with-dynamic.meta')
- )
- // We don't exclude dynamic caches for the legacy PPR prerendering.
- expect(cacheLifeWithDynamicMeta.headers['x-nextjs-stale-time']).toBe(
- '18'
- )
}
})
@@ -1020,7 +996,7 @@ describe('use-cache', () => {
})
}
- if (isNextStart && withPPR) {
+ if (isNextStart && withCacheComponents) {
it('should exclude inner caches and omitted caches from the resume data cache (RDC)', async () => {
await next.fetch('/rdc')
diff --git a/test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts b/test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts
index 5cf2ee50f3b22..535553e1e2945 100644
--- a/test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts
+++ b/test/e2e/opentelemetry/instrumentation/opentelemetry.test.ts
@@ -63,976 +63,968 @@ describe('opentelemetry', () => {
},
},
]) {
- ;(process.env.__NEXT_EXPERIMENTAL_PPR ? describe.skip : describe)(
- env.name,
- () => {
- describe('app router', () => {
- it('should handle RSC with fetch', async () => {
- await next.fetch('/app/param/rsc-fetch', env.fetchInit)
+ ;(process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS
+ ? describe.skip
+ : describe)(env.name, () => {
+ describe('app router', () => {
+ it('should handle RSC with fetch', async () => {
+ await next.fetch('/app/param/rsc-fetch', env.fetchInit)
- await expectTrace(getCollector(), [
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /app/[param]/rsc-fetch',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/app/[param]/rsc-fetch',
+ 'http.status_code': 200,
+ 'http.target': '/app/param/rsc-fetch',
+ 'next.route': '/app/[param]/rsc-fetch',
+ 'next.rsc': false,
+ 'next.span_name': 'GET /app/[param]/rsc-fetch',
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: 'render route (app) /app/[param]/rsc-fetch',
+ attributes: {
+ 'next.route': '/app/[param]/rsc-fetch',
+ 'next.span_name':
+ 'render route (app) /app/[param]/rsc-fetch',
+ 'next.span_type': 'AppRender.getBodyResult',
+ },
+ kind: 0,
+ status: { code: 0 },
+ spans: [
+ {
+ name: 'build component tree',
+ attributes: {
+ 'next.span_name': 'build component tree',
+ 'next.span_type': 'NextNodeServer.createComponentTree',
+ },
+ kind: 0,
+ status: { code: 0 },
+ spans: [
+ {
+ name: 'resolve segment modules',
+ attributes: {
+ 'next.segment': '__PAGE__',
+ 'next.span_name': 'resolve segment modules',
+ 'next.span_type':
+ 'NextNodeServer.getLayoutOrPageModule',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve segment modules',
+ attributes: {
+ 'next.segment': '[param]',
+ 'next.span_name': 'resolve segment modules',
+ 'next.span_type':
+ 'NextNodeServer.getLayoutOrPageModule',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ {
+ name: 'fetch GET https://example.vercel.sh/',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.url': 'https://example.vercel.sh/',
+ 'net.peer.name': 'example.vercel.sh',
+ 'next.span_name':
+ 'fetch GET https://example.vercel.sh/',
+ 'next.span_type': 'AppRender.fetch',
+ },
+ kind: 2,
+ status: { code: 0 },
+ },
+ {
+ name: 'generateMetadata /app/[param]/layout',
+ attributes: {
+ 'next.page': '/app/[param]/layout',
+ 'next.span_name':
+ 'generateMetadata /app/[param]/layout',
+ 'next.span_type': 'ResolveMetadata.generateMetadata',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'generateMetadata /app/[param]/rsc-fetch/page',
+ attributes: {
+ 'next.page': '/app/[param]/rsc-fetch/page',
+ 'next.span_name':
+ 'generateMetadata /app/[param]/rsc-fetch/page',
+ 'next.span_type': 'ResolveMetadata.generateMetadata',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ attributes: {
+ 'next.clientComponentLoadCount': isNextDev ? 7 : 6,
+ 'next.span_type':
+ 'NextNodeServer.clientComponentLoading',
+ },
+ kind: 0,
+ name: 'NextNodeServer.clientComponentLoading',
+ status: {
+ code: 0,
+ },
+ },
+ {
+ name: 'start response',
+ attributes: {
+ 'next.span_name': 'start response',
+ 'next.span_type': 'NextNodeServer.startResponse',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/app/[param]/rsc-fetch',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ ])
+ })
+
+ it('should propagate custom context without span', async () => {
+ await next.fetch('/app/param/rsc-fetch', {
+ ...env.fetchInit,
+ headers: { ...env.fetchInit?.headers, 'x-custom': 'custom1' },
+ })
+
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /app/[param]/rsc-fetch',
+ attributes: {
+ custom: 'custom1',
+ },
+ },
+ ])
+ })
+
+ it('should handle RSC with fetch on edge', async () => {
+ await next.fetch('/app/param/rsc-fetch/edge', env.fetchInit)
+
+ await expectTrace(
+ getCollector(),
+ [
{
- name: 'GET /app/[param]/rsc-fetch',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ runtime: 'edge',
+ name: 'GET /app/[param]/rsc-fetch/edge',
+ kind: 1,
attributes: {
+ 'next.span_name': 'GET /app/[param]/rsc-fetch/edge',
+ 'next.span_type': 'BaseServer.handleRequest',
'http.method': 'GET',
- 'http.route': '/app/[param]/rsc-fetch',
+ 'http.target': '/app/param/rsc-fetch/edge?param=param',
'http.status_code': 200,
- 'http.target': '/app/param/rsc-fetch',
- 'next.route': '/app/[param]/rsc-fetch',
- 'next.rsc': false,
- 'next.span_name': 'GET /app/[param]/rsc-fetch',
- 'next.span_type': 'BaseServer.handleRequest',
+ 'next.route': '/app/[param]/rsc-fetch/edge',
+ 'http.route': '/app/[param]/rsc-fetch/edge',
},
- kind: 1,
status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
spans: [
{
- name: 'render route (app) /app/[param]/rsc-fetch',
+ name: 'render route (app) /app/[param]/rsc-fetch/edge',
+ kind: 0,
attributes: {
- 'next.route': '/app/[param]/rsc-fetch',
'next.span_name':
- 'render route (app) /app/[param]/rsc-fetch',
+ 'render route (app) /app/[param]/rsc-fetch/edge',
'next.span_type': 'AppRender.getBodyResult',
+ 'next.route': '/app/[param]/rsc-fetch/edge',
},
- kind: 0,
status: { code: 0 },
spans: [
{
name: 'build component tree',
+ kind: 0,
attributes: {
'next.span_name': 'build component tree',
'next.span_type':
'NextNodeServer.createComponentTree',
},
- kind: 0,
status: { code: 0 },
spans: [
{
name: 'resolve segment modules',
+ kind: 0,
attributes: {
- 'next.segment': '__PAGE__',
'next.span_name': 'resolve segment modules',
'next.span_type':
'NextNodeServer.getLayoutOrPageModule',
+ 'next.segment': '__PAGE__',
},
- kind: 0,
status: { code: 0 },
},
{
name: 'resolve segment modules',
+ kind: 0,
attributes: {
- 'next.segment': '[param]',
'next.span_name': 'resolve segment modules',
'next.span_type':
'NextNodeServer.getLayoutOrPageModule',
+ 'next.segment': '[param]',
},
- kind: 0,
status: { code: 0 },
},
],
},
{
name: 'fetch GET https://example.vercel.sh/',
+ kind: 2,
attributes: {
- 'http.method': 'GET',
- 'http.url': 'https://example.vercel.sh/',
- 'net.peer.name': 'example.vercel.sh',
'next.span_name':
'fetch GET https://example.vercel.sh/',
'next.span_type': 'AppRender.fetch',
+ 'http.url': 'https://example.vercel.sh/',
+ 'http.method': 'GET',
+ 'net.peer.name': 'example.vercel.sh',
},
- kind: 2,
status: { code: 0 },
},
{
name: 'generateMetadata /app/[param]/layout',
+ kind: 0,
attributes: {
- 'next.page': '/app/[param]/layout',
'next.span_name':
'generateMetadata /app/[param]/layout',
'next.span_type': 'ResolveMetadata.generateMetadata',
+ 'next.page': '/app/[param]/layout',
},
- kind: 0,
status: { code: 0 },
},
{
- name: 'generateMetadata /app/[param]/rsc-fetch/page',
+ name: 'generateMetadata /app/[param]/rsc-fetch/edge/page',
+ kind: 0,
attributes: {
- 'next.page': '/app/[param]/rsc-fetch/page',
'next.span_name':
- 'generateMetadata /app/[param]/rsc-fetch/page',
+ 'generateMetadata /app/[param]/rsc-fetch/edge/page',
'next.span_type': 'ResolveMetadata.generateMetadata',
+ 'next.page': '/app/[param]/rsc-fetch/edge/page',
},
- kind: 0,
- status: { code: 0 },
- },
- {
- attributes: {
- 'next.clientComponentLoadCount': isNextDev ? 7 : 6,
- 'next.span_type':
- 'NextNodeServer.clientComponentLoading',
- },
- kind: 0,
- name: 'NextNodeServer.clientComponentLoading',
- status: {
- code: 0,
- },
- },
- {
- name: 'start response',
- attributes: {
- 'next.span_name': 'start response',
- 'next.span_type': 'NextNodeServer.startResponse',
- },
- kind: 0,
status: { code: 0 },
},
],
},
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/app/[param]/rsc-fetch',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
- },
],
},
- ])
+ ],
+ true
+ )
+ })
+
+ it('should handle RSC with fetch in RSC mode', async () => {
+ await next.fetch(`/app/param/rsc-fetch?${NEXT_RSC_UNION_QUERY}`, {
+ ...env.fetchInit,
+ headers: {
+ ...env.fetchInit?.headers,
+ Rsc: '1',
+ },
})
- it('should propagate custom context without span', async () => {
- await next.fetch('/app/param/rsc-fetch', {
- ...env.fetchInit,
- headers: { ...env.fetchInit?.headers, 'x-custom': 'custom1' },
- })
+ await expectTrace(getCollector(), [
+ {
+ runtime: 'nodejs',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'RSC GET /app/[param]/rsc-fetch',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/app/[param]/rsc-fetch',
+ 'http.status_code': 200,
+ 'http.target': `/app/param/rsc-fetch?${NEXT_RSC_UNION_QUERY}`,
+ 'next.route': '/app/[param]/rsc-fetch',
+ 'next.rsc': true,
+ 'next.span_name': 'RSC GET /app/[param]/rsc-fetch',
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ kind: 1,
+ status: { code: 0 },
+ },
+ ])
+ })
+
+ it('should handle route handlers in app router', async () => {
+ await next.fetch('/api/app/param/data', env.fetchInit)
+
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /api/app/[param]/data',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/api/app/[param]/data',
+ 'http.status_code': 200,
+ 'http.target': '/api/app/param/data',
+ 'next.route': '/api/app/[param]/data',
+ 'next.span_name': 'GET /api/app/[param]/data',
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: 'executing api route (app) /api/app/[param]/data',
+ attributes: {
+ 'next.route': '/api/app/[param]/data',
+ 'next.span_name':
+ 'executing api route (app) /api/app/[param]/data',
+ 'next.span_type': 'AppRouteRouteHandlers.runHandler',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/api/app/[param]/data',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'start response',
+ attributes: {
+ 'next.span_name': 'start response',
+ 'next.span_type': 'NextNodeServer.startResponse',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ ])
+ })
+
+ it('should handle route handlers in app router on edge', async () => {
+ await next.fetch('/api/app/param/data/edge', env.fetchInit)
- await expectTrace(getCollector(), [
+ await expectTrace(
+ getCollector(),
+ [
{
- name: 'GET /app/[param]/rsc-fetch',
+ runtime: 'edge',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'executing api route (app) /api/app/[param]/data/edge',
attributes: {
- custom: 'custom1',
+ 'next.route': '/api/app/[param]/data/edge',
+ 'next.span_name':
+ 'executing api route (app) /api/app/[param]/data/edge',
+ 'next.span_type': 'AppRouteRouteHandlers.runHandler',
},
+ kind: 0,
+ status: { code: 0 },
},
- ])
- })
+ ],
+ true
+ )
+ })
+
+ it('should trace middleware', async () => {
+ await next.fetch('/behind-middleware', env.fetchInit)
+
+ await expectTrace(getCollector(), [
+ {
+ runtime: 'edge',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'middleware GET',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.target': '/behind-middleware',
+ 'next.span_name': 'middleware GET',
+ 'next.span_type': 'Middleware.execute',
+ },
+ status: { code: 0 },
+ spans: [],
+ },
+
+ {
+ runtime: 'nodejs',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'GET /behind-middleware',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/behind-middleware',
+ 'http.status_code': 200,
+ 'http.target': '/behind-middleware',
+ 'next.route': '/behind-middleware',
+ 'next.span_name': 'GET /behind-middleware',
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ },
+ ])
+ })
- it('should handle RSC with fetch on edge', async () => {
- await next.fetch('/app/param/rsc-fetch/edge', env.fetchInit)
+ it('should handle error in RSC', async () => {
+ await next.fetch(
+ '/app/param/rsc-fetch/error?status=error',
+ env.fetchInit
+ )
- await expectTrace(
- getCollector(),
- [
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /app/[param]/rsc-fetch/error',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/app/[param]/rsc-fetch/error',
+ 'http.status_code': 500,
+ 'http.target': '/app/param/rsc-fetch/error?status=error',
+ 'next.route': '/app/[param]/rsc-fetch/error',
+ 'next.rsc': false,
+ 'next.span_name': 'GET /app/[param]/rsc-fetch/error',
+ 'next.span_type': 'BaseServer.handleRequest',
+ 'error.type': '500',
+ },
+ kind: 1,
+ status: { code: 2 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
{
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- runtime: 'edge',
- name: 'GET /app/[param]/rsc-fetch/edge',
- kind: 1,
+ name: 'render route (app) /app/[param]/rsc-fetch/error',
attributes: {
- 'next.span_name': 'GET /app/[param]/rsc-fetch/edge',
- 'next.span_type': 'BaseServer.handleRequest',
- 'http.method': 'GET',
- 'http.target': '/app/param/rsc-fetch/edge?param=param',
- 'http.status_code': 200,
- 'next.route': '/app/[param]/rsc-fetch/edge',
- 'http.route': '/app/[param]/rsc-fetch/edge',
+ 'next.route': '/app/[param]/rsc-fetch/error',
+ 'next.span_name':
+ 'render route (app) /app/[param]/rsc-fetch/error',
+ 'next.span_type': 'AppRender.getBodyResult',
},
- status: { code: 0 },
+ kind: 0,
+ status: { code: 2 },
spans: [
{
- name: 'render route (app) /app/[param]/rsc-fetch/edge',
- kind: 0,
+ name: 'build component tree',
attributes: {
- 'next.span_name':
- 'render route (app) /app/[param]/rsc-fetch/edge',
- 'next.span_type': 'AppRender.getBodyResult',
- 'next.route': '/app/[param]/rsc-fetch/edge',
+ 'next.span_name': 'build component tree',
+ 'next.span_type': 'NextNodeServer.createComponentTree',
},
+ kind: 0,
status: { code: 0 },
spans: [
{
- name: 'build component tree',
- kind: 0,
+ name: 'resolve segment modules',
attributes: {
- 'next.span_name': 'build component tree',
+ 'next.segment': '__PAGE__',
+ 'next.span_name': 'resolve segment modules',
'next.span_type':
- 'NextNodeServer.createComponentTree',
- },
- status: { code: 0 },
- spans: [
- {
- name: 'resolve segment modules',
- kind: 0,
- attributes: {
- 'next.span_name': 'resolve segment modules',
- 'next.span_type':
- 'NextNodeServer.getLayoutOrPageModule',
- 'next.segment': '__PAGE__',
- },
- status: { code: 0 },
- },
- {
- name: 'resolve segment modules',
- kind: 0,
- attributes: {
- 'next.span_name': 'resolve segment modules',
- 'next.span_type':
- 'NextNodeServer.getLayoutOrPageModule',
- 'next.segment': '[param]',
- },
- status: { code: 0 },
- },
- ],
- },
- {
- name: 'fetch GET https://example.vercel.sh/',
- kind: 2,
- attributes: {
- 'next.span_name':
- 'fetch GET https://example.vercel.sh/',
- 'next.span_type': 'AppRender.fetch',
- 'http.url': 'https://example.vercel.sh/',
- 'http.method': 'GET',
- 'net.peer.name': 'example.vercel.sh',
+ 'NextNodeServer.getLayoutOrPageModule',
},
- status: { code: 0 },
- },
- {
- name: 'generateMetadata /app/[param]/layout',
kind: 0,
- attributes: {
- 'next.span_name':
- 'generateMetadata /app/[param]/layout',
- 'next.span_type':
- 'ResolveMetadata.generateMetadata',
- 'next.page': '/app/[param]/layout',
- },
status: { code: 0 },
},
{
- name: 'generateMetadata /app/[param]/rsc-fetch/edge/page',
- kind: 0,
+ name: 'resolve segment modules',
attributes: {
- 'next.span_name':
- 'generateMetadata /app/[param]/rsc-fetch/edge/page',
+ 'next.segment': '[param]',
+ 'next.span_name': 'resolve segment modules',
'next.span_type':
- 'ResolveMetadata.generateMetadata',
- 'next.page': '/app/[param]/rsc-fetch/edge/page',
+ 'NextNodeServer.getLayoutOrPageModule',
},
+ kind: 0,
status: { code: 0 },
},
],
},
- ],
- },
- ],
- true
- )
- })
-
- it('should handle RSC with fetch in RSC mode', async () => {
- await next.fetch(`/app/param/rsc-fetch?${NEXT_RSC_UNION_QUERY}`, {
- ...env.fetchInit,
- headers: {
- ...env.fetchInit?.headers,
- Rsc: '1',
- },
- })
-
- await expectTrace(getCollector(), [
- {
- runtime: 'nodejs',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'RSC GET /app/[param]/rsc-fetch',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/app/[param]/rsc-fetch',
- 'http.status_code': 200,
- 'http.target': `/app/param/rsc-fetch?${NEXT_RSC_UNION_QUERY}`,
- 'next.route': '/app/[param]/rsc-fetch',
- 'next.rsc': true,
- 'next.span_name': 'RSC GET /app/[param]/rsc-fetch',
- 'next.span_type': 'BaseServer.handleRequest',
- },
- kind: 1,
- status: { code: 0 },
- },
- ])
- })
-
- it('should handle route handlers in app router', async () => {
- await next.fetch('/api/app/param/data', env.fetchInit)
-
- await expectTrace(getCollector(), [
- {
- name: 'GET /api/app/[param]/data',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/api/app/[param]/data',
- 'http.status_code': 200,
- 'http.target': '/api/app/param/data',
- 'next.route': '/api/app/[param]/data',
- 'next.span_name': 'GET /api/app/[param]/data',
- 'next.span_type': 'BaseServer.handleRequest',
- },
- kind: 1,
- status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: 'executing api route (app) /api/app/[param]/data',
- attributes: {
- 'next.route': '/api/app/[param]/data',
- 'next.span_name':
- 'executing api route (app) /api/app/[param]/data',
- 'next.span_type': 'AppRouteRouteHandlers.runHandler',
+ {
+ name: 'generateMetadata /app/[param]/layout',
+ attributes: {
+ 'next.page': '/app/[param]/layout',
+ 'next.span_name':
+ 'generateMetadata /app/[param]/layout',
+ 'next.span_type': 'ResolveMetadata.generateMetadata',
+ },
+ kind: 0,
+ status: { code: 0 },
},
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/api/app/[param]/data',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
+ {
+ name: 'generateMetadata /app/[param]/layout',
+ attributes: {
+ 'next.page': '/app/[param]/layout',
+ 'next.span_name':
+ 'generateMetadata /app/[param]/layout',
+ 'next.span_type': 'ResolveMetadata.generateMetadata',
+ },
+ kind: 0,
+ status: { code: 0 },
},
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'start response',
- attributes: {
- 'next.span_name': 'start response',
- 'next.span_type': 'NextNodeServer.startResponse',
+ {
+ attributes: {
+ 'next.clientComponentLoadCount': isNextDev ? 10 : 8,
+ 'next.span_type':
+ 'NextNodeServer.clientComponentLoading',
+ },
+ kind: 0,
+ name: 'NextNodeServer.clientComponentLoading',
+ status: {
+ code: 0,
+ },
},
- kind: 0,
- status: { code: 0 },
- },
- ],
- },
- ])
- })
-
- it('should handle route handlers in app router on edge', async () => {
- await next.fetch('/api/app/param/data/edge', env.fetchInit)
-
- await expectTrace(
- getCollector(),
- [
+ {
+ name: 'start response',
+ attributes: {
+ 'next.span_name': 'start response',
+ 'next.span_type': 'NextNodeServer.startResponse',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
{
- runtime: 'edge',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'executing api route (app) /api/app/[param]/data/edge',
+ name: 'resolve page components',
attributes: {
- 'next.route': '/api/app/[param]/data/edge',
- 'next.span_name':
- 'executing api route (app) /api/app/[param]/data/edge',
- 'next.span_type': 'AppRouteRouteHandlers.runHandler',
+ 'next.route': '/app/[param]/rsc-fetch/error',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
},
kind: 0,
status: { code: 0 },
},
],
- true
- )
- })
-
- it('should trace middleware', async () => {
- await next.fetch('/behind-middleware', env.fetchInit)
+ },
+ ])
+ })
+ })
- await expectTrace(getCollector(), [
- {
- runtime: 'edge',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'middleware GET',
- attributes: {
- 'http.method': 'GET',
- 'http.target': '/behind-middleware',
- 'next.span_name': 'middleware GET',
- 'next.span_type': 'Middleware.execute',
- },
- status: { code: 0 },
- spans: [],
- },
+ describe('pages', () => {
+ it('should handle getServerSideProps', async () => {
+ await next.fetch('/pages/param/getServerSideProps', env.fetchInit)
- {
- runtime: 'nodejs',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'GET /behind-middleware',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/behind-middleware',
- 'http.status_code': 200,
- 'http.target': '/behind-middleware',
- 'next.route': '/behind-middleware',
- 'next.span_name': 'GET /behind-middleware',
- 'next.span_type': 'BaseServer.handleRequest',
- },
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /pages/[param]/getServerSideProps',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/pages/[param]/getServerSideProps',
+ 'http.status_code': 200,
+ 'http.target': '/pages/param/getServerSideProps',
+ 'next.route': '/pages/[param]/getServerSideProps',
+ 'next.span_name': 'GET /pages/[param]/getServerSideProps',
+ 'next.span_type': 'BaseServer.handleRequest',
},
- ])
- })
-
- it('should handle error in RSC', async () => {
- await next.fetch(
- '/app/param/rsc-fetch/error?status=error',
- env.fetchInit
- )
-
- await expectTrace(getCollector(), [
- {
- name: 'GET /app/[param]/rsc-fetch/error',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/app/[param]/rsc-fetch/error',
- 'http.status_code': 500,
- 'http.target': '/app/param/rsc-fetch/error?status=error',
- 'next.route': '/app/[param]/rsc-fetch/error',
- 'next.rsc': false,
- 'next.span_name': 'GET /app/[param]/rsc-fetch/error',
- 'next.span_type': 'BaseServer.handleRequest',
- 'error.type': '500',
- },
- kind: 1,
- status: { code: 2 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: 'render route (app) /app/[param]/rsc-fetch/error',
- attributes: {
- 'next.route': '/app/[param]/rsc-fetch/error',
- 'next.span_name':
- 'render route (app) /app/[param]/rsc-fetch/error',
- 'next.span_type': 'AppRender.getBodyResult',
- },
- kind: 0,
- status: { code: 2 },
- spans: [
- {
- name: 'build component tree',
- attributes: {
- 'next.span_name': 'build component tree',
- 'next.span_type':
- 'NextNodeServer.createComponentTree',
- },
- kind: 0,
- status: { code: 0 },
- spans: [
- {
- name: 'resolve segment modules',
- attributes: {
- 'next.segment': '__PAGE__',
- 'next.span_name': 'resolve segment modules',
- 'next.span_type':
- 'NextNodeServer.getLayoutOrPageModule',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'resolve segment modules',
- attributes: {
- 'next.segment': '[param]',
- 'next.span_name': 'resolve segment modules',
- 'next.span_type':
- 'NextNodeServer.getLayoutOrPageModule',
- },
- kind: 0,
- status: { code: 0 },
- },
- ],
- },
- {
- name: 'generateMetadata /app/[param]/layout',
- attributes: {
- 'next.page': '/app/[param]/layout',
- 'next.span_name':
- 'generateMetadata /app/[param]/layout',
- 'next.span_type': 'ResolveMetadata.generateMetadata',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'generateMetadata /app/[param]/layout',
- attributes: {
- 'next.page': '/app/[param]/layout',
- 'next.span_name':
- 'generateMetadata /app/[param]/layout',
- 'next.span_type': 'ResolveMetadata.generateMetadata',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- attributes: {
- 'next.clientComponentLoadCount': isNextDev ? 10 : 8,
- 'next.span_type':
- 'NextNodeServer.clientComponentLoading',
- },
- kind: 0,
- name: 'NextNodeServer.clientComponentLoading',
- status: {
- code: 0,
- },
- },
- {
- name: 'start response',
- attributes: {
- 'next.span_name': 'start response',
- 'next.span_type': 'NextNodeServer.startResponse',
- },
- kind: 0,
- status: { code: 0 },
- },
- ],
- },
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/app/[param]/rsc-fetch/error',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: 'getServerSideProps /pages/[param]/getServerSideProps',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSideProps',
+ 'next.span_name':
+ 'getServerSideProps /pages/[param]/getServerSideProps',
+ 'next.span_type': 'Render.getServerSideProps',
},
- ],
- },
- ])
- })
- })
-
- describe('pages', () => {
- it('should handle getServerSideProps', async () => {
- await next.fetch('/pages/param/getServerSideProps', env.fetchInit)
-
- await expectTrace(getCollector(), [
- {
- name: 'GET /pages/[param]/getServerSideProps',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/pages/[param]/getServerSideProps',
- 'http.status_code': 200,
- 'http.target': '/pages/param/getServerSideProps',
- 'next.route': '/pages/[param]/getServerSideProps',
- 'next.span_name': 'GET /pages/[param]/getServerSideProps',
- 'next.span_type': 'BaseServer.handleRequest',
+ kind: 0,
+ status: { code: 0 },
},
- kind: 1,
- status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: 'getServerSideProps /pages/[param]/getServerSideProps',
- attributes: {
- 'next.route': '/pages/[param]/getServerSideProps',
- 'next.span_name':
- 'getServerSideProps /pages/[param]/getServerSideProps',
- 'next.span_type': 'Render.getServerSideProps',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'render route (pages) /pages/[param]/getServerSideProps',
- attributes: {
- 'next.route': '/pages/[param]/getServerSideProps',
- 'next.span_name':
- 'render route (pages) /pages/[param]/getServerSideProps',
- 'next.span_type': 'Render.renderDocument',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/pages/[param]/getServerSideProps',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
+ {
+ name: 'render route (pages) /pages/[param]/getServerSideProps',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSideProps',
+ 'next.span_name':
+ 'render route (pages) /pages/[param]/getServerSideProps',
+ 'next.span_type': 'Render.renderDocument',
},
- ],
- },
- ])
- })
-
- it("should handle getStaticProps when fallback: 'blocking'", async () => {
- const v = env.span.rootParentId ? '2' : ''
- await next.fetch(`/pages/param/getStaticProps${v}`, env.fetchInit)
-
- await expectTrace(getCollector(), [
- {
- name: `GET /pages/[param]/getStaticProps${v}`,
- attributes: {
- 'http.method': 'GET',
- 'http.route': `/pages/[param]/getStaticProps${v}`,
- 'http.status_code': 200,
- 'http.target': `/pages/param/getStaticProps${v}`,
- 'next.route': `/pages/[param]/getStaticProps${v}`,
- 'next.span_name': `GET /pages/[param]/getStaticProps${v}`,
- 'next.span_type': 'BaseServer.handleRequest',
+ kind: 0,
+ status: { code: 0 },
},
- kind: 1,
- status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: `getStaticProps /pages/[param]/getStaticProps${v}`,
- attributes: {
- 'next.route': `/pages/[param]/getStaticProps${v}`,
- 'next.span_name': `getStaticProps /pages/[param]/getStaticProps${v}`,
- 'next.span_type': 'Render.getStaticProps',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: `render route (pages) /pages/[param]/getStaticProps${v}`,
- attributes: {
- 'next.route': `/pages/[param]/getStaticProps${v}`,
- 'next.span_name': `render route (pages) /pages/[param]/getStaticProps${v}`,
- 'next.span_type': 'Render.renderDocument',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': `/pages/[param]/getStaticProps${v}`,
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
- },
- ],
- },
- ])
- })
-
- it('should handle getServerSideProps on edge', async () => {
- await next.fetch(
- '/pages/param/edge/getServerSideProps',
- env.fetchInit
- )
-
- await expectTrace(
- getCollector(),
- [
{
- runtime: 'edge',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'GET /pages/[param]/edge/getServerSideProps',
- kind: 1,
+ name: 'resolve page components',
attributes: {
- 'next.span_name':
- 'GET /pages/[param]/edge/getServerSideProps',
- 'next.span_type': 'BaseServer.handleRequest',
- 'http.method': 'GET',
- 'http.target':
- '/pages/param/edge/getServerSideProps?param=param',
- 'http.status_code': 200,
- 'next.route': '/pages/[param]/edge/getServerSideProps',
- 'http.route': '/pages/[param]/edge/getServerSideProps',
+ 'next.route': '/pages/[param]/getServerSideProps',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
},
+ kind: 0,
status: { code: 0 },
- spans: [
- {
- name: 'getServerSideProps /pages/[param]/edge/getServerSideProps',
- kind: 0,
- attributes: {
- 'next.span_name':
- 'getServerSideProps /pages/[param]/edge/getServerSideProps',
- 'next.span_type': 'Render.getServerSideProps',
- 'next.route': '/pages/[param]/edge/getServerSideProps',
- },
- status: { code: 0 },
- },
- {
- name: 'render route (pages) /pages/[param]/edge/getServerSideProps',
- kind: 0,
- attributes: {
- 'next.span_name':
- 'render route (pages) /pages/[param]/edge/getServerSideProps',
- 'next.span_type': 'Render.renderDocument',
- 'next.route': '/pages/[param]/edge/getServerSideProps',
- },
- status: { code: 0 },
- },
- ],
},
],
- true
- )
- })
+ },
+ ])
+ })
- it('should handle getServerSideProps exceptions', async () => {
- await next.fetch(
- '/pages/param/getServerSidePropsError',
- env.fetchInit
- )
+ it("should handle getStaticProps when fallback: 'blocking'", async () => {
+ const v = env.span.rootParentId ? '2' : ''
+ await next.fetch(`/pages/param/getStaticProps${v}`, env.fetchInit)
- await expectTrace(getCollector(), [
- {
- name: 'GET /pages/[param]/getServerSidePropsError',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/pages/[param]/getServerSidePropsError',
- 'http.status_code': 500,
- 'http.target': '/pages/param/getServerSidePropsError',
- 'next.route': '/pages/[param]/getServerSidePropsError',
- 'next.span_name':
- 'GET /pages/[param]/getServerSidePropsError',
- 'next.span_type': 'BaseServer.handleRequest',
- 'error.type': '500',
- },
- kind: 1,
- status: { code: 2 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: 'getServerSideProps /pages/[param]/getServerSidePropsError',
- attributes: {
- 'next.route': '/pages/[param]/getServerSidePropsError',
- 'next.span_name':
- 'getServerSideProps /pages/[param]/getServerSidePropsError',
- 'next.span_type': 'Render.getServerSideProps',
- 'error.type': 'Error',
- },
- kind: 0,
- status: {
- code: 2,
- message: 'ServerSideProps error',
- },
- events: [
- {
- name: 'exception',
- attributes: {
- 'exception.type': 'Error',
- 'exception.message': 'ServerSideProps error',
- },
- },
- ],
- },
- {
- name: 'render route (pages) /_error',
- attributes: {
- 'next.route': '/_error',
- 'next.span_name': 'render route (pages) /_error',
- 'next.span_type': 'Render.renderDocument',
- },
- kind: 0,
- status: { code: 0 },
+ await expectTrace(getCollector(), [
+ {
+ name: `GET /pages/[param]/getStaticProps${v}`,
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': `/pages/[param]/getStaticProps${v}`,
+ 'http.status_code': 200,
+ 'http.target': `/pages/param/getStaticProps${v}`,
+ 'next.route': `/pages/[param]/getStaticProps${v}`,
+ 'next.span_name': `GET /pages/[param]/getStaticProps${v}`,
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: `getStaticProps /pages/[param]/getStaticProps${v}`,
+ attributes: {
+ 'next.route': `/pages/[param]/getStaticProps${v}`,
+ 'next.span_name': `getStaticProps /pages/[param]/getStaticProps${v}`,
+ 'next.span_type': 'Render.getStaticProps',
},
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/_error',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: `render route (pages) /pages/[param]/getStaticProps${v}`,
+ attributes: {
+ 'next.route': `/pages/[param]/getStaticProps${v}`,
+ 'next.span_name': `render route (pages) /pages/[param]/getStaticProps${v}`,
+ 'next.span_type': 'Render.renderDocument',
},
- ...(isNextDev
- ? []
- : [
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/500',
- 'next.span_name': 'resolve page components',
- 'next.span_type':
- 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
- },
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/500',
- 'next.span_name': 'resolve page components',
- 'next.span_type':
- 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
- },
- ]),
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/pages/[param]/getServerSidePropsError',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
- status: { code: 0 },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': `/pages/[param]/getStaticProps${v}`,
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
},
- ],
- },
- ])
- })
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ ])
+ })
- it('should handle getServerSideProps returning notFound', async () => {
- await next.fetch(
- '/pages/param/getServerSidePropsNotFound',
- env.fetchInit
- )
+ it('should handle getServerSideProps on edge', async () => {
+ await next.fetch(
+ '/pages/param/edge/getServerSideProps',
+ env.fetchInit
+ )
- await expectTrace(getCollector(), [
+ await expectTrace(
+ getCollector(),
+ [
{
- name: 'GET /pages/[param]/getServerSidePropsNotFound',
+ runtime: 'edge',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'GET /pages/[param]/edge/getServerSideProps',
+ kind: 1,
attributes: {
- 'http.method': 'GET',
- 'http.route': '/pages/[param]/getServerSidePropsNotFound',
- 'http.status_code': 404,
- 'http.target': '/pages/param/getServerSidePropsNotFound',
- 'next.route': '/pages/[param]/getServerSidePropsNotFound',
'next.span_name':
- 'GET /pages/[param]/getServerSidePropsNotFound',
+ 'GET /pages/[param]/edge/getServerSideProps',
'next.span_type': 'BaseServer.handleRequest',
+ 'http.method': 'GET',
+ 'http.target':
+ '/pages/param/edge/getServerSideProps?param=param',
+ 'http.status_code': 200,
+ 'next.route': '/pages/[param]/edge/getServerSideProps',
+ 'http.route': '/pages/[param]/edge/getServerSideProps',
},
- kind: 1,
status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
spans: [
{
- name: 'getServerSideProps /pages/[param]/getServerSidePropsNotFound',
+ name: 'getServerSideProps /pages/[param]/edge/getServerSideProps',
+ kind: 0,
attributes: {
- 'next.route': '/pages/[param]/getServerSidePropsNotFound',
'next.span_name':
- 'getServerSideProps /pages/[param]/getServerSidePropsNotFound',
+ 'getServerSideProps /pages/[param]/edge/getServerSideProps',
'next.span_type': 'Render.getServerSideProps',
+ 'next.route': '/pages/[param]/edge/getServerSideProps',
},
- kind: 0,
- status: {
- code: 0,
- },
- },
- ...(isNextDev
- ? [
- {
- name: 'render route (app) /_not-found',
- attributes: {
- 'next.route': '/_not-found',
- 'next.span_name': 'render route (app) /_not-found',
- 'next.span_type': 'AppRender.getBodyResult',
- },
- kind: 0,
- status: { code: 0 },
- },
- ]
- : []),
- {
- name: 'resolve page components',
- attributes: {
- 'next.route': '/_not-found',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
- },
- kind: 0,
status: { code: 0 },
},
{
- name: 'resolve page components',
+ name: 'render route (pages) /pages/[param]/edge/getServerSideProps',
+ kind: 0,
attributes: {
- 'next.route': '/pages/[param]/getServerSidePropsNotFound',
- 'next.span_name': 'resolve page components',
- 'next.span_type': 'NextNodeServer.findPageComponents',
+ 'next.span_name':
+ 'render route (pages) /pages/[param]/edge/getServerSideProps',
+ 'next.span_type': 'Render.renderDocument',
+ 'next.route': '/pages/[param]/edge/getServerSideProps',
},
- kind: 0,
status: { code: 0 },
},
],
},
- ])
- })
+ ],
+ true
+ )
+ })
- it('should handle api routes in pages', async () => {
- await next.fetch('/api/pages/param/basic', env.fetchInit)
+ it('should handle getServerSideProps exceptions', async () => {
+ await next.fetch(
+ '/pages/param/getServerSidePropsError',
+ env.fetchInit
+ )
- await expectTrace(getCollector(), [
- {
- name: 'GET /api/pages/[param]/basic',
- attributes: {
- 'http.method': 'GET',
- 'http.route': '/api/pages/[param]/basic',
- 'http.status_code': 200,
- 'http.target': '/api/pages/param/basic',
- 'next.route': '/api/pages/[param]/basic',
- 'next.span_name': 'GET /api/pages/[param]/basic',
- 'next.span_type': 'BaseServer.handleRequest',
- },
- kind: 1,
- status: { code: 0 },
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- spans: [
- {
- name: 'executing api route (pages) /api/pages/[param]/basic',
- attributes: {
- 'next.span_name':
- 'executing api route (pages) /api/pages/[param]/basic',
- 'next.span_type': 'Node.runHandler',
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /pages/[param]/getServerSidePropsError',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/pages/[param]/getServerSidePropsError',
+ 'http.status_code': 500,
+ 'http.target': '/pages/param/getServerSidePropsError',
+ 'next.route': '/pages/[param]/getServerSidePropsError',
+ 'next.span_name': 'GET /pages/[param]/getServerSidePropsError',
+ 'next.span_type': 'BaseServer.handleRequest',
+ 'error.type': '500',
+ },
+ kind: 1,
+ status: { code: 2 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: 'getServerSideProps /pages/[param]/getServerSidePropsError',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSidePropsError',
+ 'next.span_name':
+ 'getServerSideProps /pages/[param]/getServerSidePropsError',
+ 'next.span_type': 'Render.getServerSideProps',
+ 'error.type': 'Error',
+ },
+ kind: 0,
+ status: {
+ code: 2,
+ message: 'ServerSideProps error',
+ },
+ events: [
+ {
+ name: 'exception',
+ attributes: {
+ 'exception.type': 'Error',
+ 'exception.message': 'ServerSideProps error',
+ },
},
- kind: 0,
- status: { code: 0 },
+ ],
+ },
+ {
+ name: 'render route (pages) /_error',
+ attributes: {
+ 'next.route': '/_error',
+ 'next.span_name': 'render route (pages) /_error',
+ 'next.span_type': 'Render.renderDocument',
},
- ],
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/_error',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ...(isNextDev
+ ? []
+ : [
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/500',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/500',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ]),
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSidePropsError',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ ])
+ })
+
+ it('should handle getServerSideProps returning notFound', async () => {
+ await next.fetch(
+ '/pages/param/getServerSidePropsNotFound',
+ env.fetchInit
+ )
+
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /pages/[param]/getServerSidePropsNotFound',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/pages/[param]/getServerSidePropsNotFound',
+ 'http.status_code': 404,
+ 'http.target': '/pages/param/getServerSidePropsNotFound',
+ 'next.route': '/pages/[param]/getServerSidePropsNotFound',
+ 'next.span_name':
+ 'GET /pages/[param]/getServerSidePropsNotFound',
+ 'next.span_type': 'BaseServer.handleRequest',
},
- ])
- })
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
+ {
+ name: 'getServerSideProps /pages/[param]/getServerSidePropsNotFound',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSidePropsNotFound',
+ 'next.span_name':
+ 'getServerSideProps /pages/[param]/getServerSidePropsNotFound',
+ 'next.span_type': 'Render.getServerSideProps',
+ },
+ kind: 0,
+ status: {
+ code: 0,
+ },
+ },
+ ...(isNextDev
+ ? [
+ {
+ name: 'render route (app) /_not-found',
+ attributes: {
+ 'next.route': '/_not-found',
+ 'next.span_name': 'render route (app) /_not-found',
+ 'next.span_type': 'AppRender.getBodyResult',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ]
+ : []),
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/_not-found',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ {
+ name: 'resolve page components',
+ attributes: {
+ 'next.route': '/pages/[param]/getServerSidePropsNotFound',
+ 'next.span_name': 'resolve page components',
+ 'next.span_type': 'NextNodeServer.findPageComponents',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ },
+ ])
+ })
- it('should handle api routes in pages on edge', async () => {
- await next.fetch('/api/pages/param/edge', env.fetchInit)
+ it('should handle api routes in pages', async () => {
+ await next.fetch('/api/pages/param/basic', env.fetchInit)
- await expectTrace(
- getCollector(),
- [
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /api/pages/[param]/basic',
+ attributes: {
+ 'http.method': 'GET',
+ 'http.route': '/api/pages/[param]/basic',
+ 'http.status_code': 200,
+ 'http.target': '/api/pages/param/basic',
+ 'next.route': '/api/pages/[param]/basic',
+ 'next.span_name': 'GET /api/pages/[param]/basic',
+ 'next.span_type': 'BaseServer.handleRequest',
+ },
+ kind: 1,
+ status: { code: 0 },
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ spans: [
{
- runtime: 'edge',
- traceId: env.span.traceId,
- parentId: env.span.rootParentId,
- name: 'executing api route (pages) /api/pages/[param]/edge',
+ name: 'executing api route (pages) /api/pages/[param]/basic',
attributes: {
'next.span_name':
- 'executing api route (pages) /api/pages/[param]/edge',
+ 'executing api route (pages) /api/pages/[param]/basic',
'next.span_type': 'Node.runHandler',
},
kind: 0,
status: { code: 0 },
},
],
- true
- )
- })
+ },
+ ])
})
- }
- )
+
+ it('should handle api routes in pages on edge', async () => {
+ await next.fetch('/api/pages/param/edge', env.fetchInit)
+
+ await expectTrace(
+ getCollector(),
+ [
+ {
+ runtime: 'edge',
+ traceId: env.span.traceId,
+ parentId: env.span.rootParentId,
+ name: 'executing api route (pages) /api/pages/[param]/edge',
+ attributes: {
+ 'next.span_name':
+ 'executing api route (pages) /api/pages/[param]/edge',
+ 'next.span_type': 'Node.runHandler',
+ },
+ kind: 0,
+ status: { code: 0 },
+ },
+ ],
+ true
+ )
+ })
+ })
+ })
}
})
@@ -1065,57 +1057,56 @@ describe('opentelemetry with disabled fetch tracing', () => {
await collector.shutdown()
await new Promise((r) => setTimeout(r, 1000))
})
- ;(process.env.__NEXT_EXPERIMENTAL_PPR ? describe.skip : describe)(
- 'root context',
- () => {
- describe('app router with disabled fetch', () => {
- it('should handle RSC with disabled fetch', async () => {
- await next.fetch('/app/param/rsc-fetch')
+ ;(process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS
+ ? describe.skip
+ : describe)('root context', () => {
+ describe('app router with disabled fetch', () => {
+ it('should handle RSC with disabled fetch', async () => {
+ await next.fetch('/app/param/rsc-fetch')
- await expectTrace(getCollector(), [
- {
- name: 'GET /app/[param]/rsc-fetch',
- traceId: '[trace-id]',
- parentId: undefined,
- spans: [
- {
- name: 'render route (app) /app/[param]/rsc-fetch',
- spans: [
- {
- name: 'build component tree',
- spans: [
- {
- name: 'resolve segment modules',
- },
- {
- name: 'resolve segment modules',
- },
- ],
- },
- {
- name: 'generateMetadata /app/[param]/layout',
- },
- {
- name: 'generateMetadata /app/[param]/rsc-fetch/page',
- },
- {
- name: 'NextNodeServer.clientComponentLoading',
- },
- {
- name: 'start response',
- },
- ],
- },
- {
- name: 'resolve page components',
- },
- ],
- },
- ])
- })
+ await expectTrace(getCollector(), [
+ {
+ name: 'GET /app/[param]/rsc-fetch',
+ traceId: '[trace-id]',
+ parentId: undefined,
+ spans: [
+ {
+ name: 'render route (app) /app/[param]/rsc-fetch',
+ spans: [
+ {
+ name: 'build component tree',
+ spans: [
+ {
+ name: 'resolve segment modules',
+ },
+ {
+ name: 'resolve segment modules',
+ },
+ ],
+ },
+ {
+ name: 'generateMetadata /app/[param]/layout',
+ },
+ {
+ name: 'generateMetadata /app/[param]/rsc-fetch/page',
+ },
+ {
+ name: 'NextNodeServer.clientComponentLoading',
+ },
+ {
+ name: 'start response',
+ },
+ ],
+ },
+ {
+ name: 'resolve page components',
+ },
+ ],
+ },
+ ])
})
- }
- )
+ })
+ })
})
type HierSavedSpan = SavedSpan & { spans?: HierSavedSpan[] }
diff --git a/test/integration/config-experimental-warning/test/index.test.js b/test/integration/config-experimental-warning/test/index.test.js
index fb7e3f2ee7e68..7e0b222098468 100644
--- a/test/integration/config-experimental-warning/test/index.test.js
+++ b/test/integration/config-experimental-warning/test/index.test.js
@@ -143,7 +143,8 @@ describe('Config Experimental Warning', () => {
expect(stdout).toMatch(' · cpus: 2')
})
- it('should show the configured value for string features', async () => {
+ // TODO: the incremental option has been removed, update to another string feature
+ it.skip('should show the configured value for string features', async () => {
configFile.write(`
module.exports = {
experimental: {
diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts
index a675b495a9aff..6e0056eaff440 100644
--- a/test/lib/next-modes/base.ts
+++ b/test/lib/next-modes/base.ts
@@ -403,9 +403,6 @@ export class NextInstance {
}
// alias experimental feature flags for deployment compatibility
- if (process.env.NEXT_PRIVATE_EXPERIMENTAL_PPR) {
- process.env.__NEXT_EXPERIMENTAL_PPR = process.env.NEXT_PRIVATE_EXPERIMENTAL_PPR
- }
if (process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHE_COMPONENTS) {
process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS = process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHE_COMPONENTS
}
diff --git a/test/lib/next-modes/next-deploy.ts b/test/lib/next-modes/next-deploy.ts
index 374bf46cbdcf7..4a4b6a5f14957 100644
--- a/test/lib/next-modes/next-deploy.ts
+++ b/test/lib/next-modes/next-deploy.ts
@@ -99,11 +99,6 @@ export class NextDeployInstance extends NextInstance {
)
// Add experimental feature flags
- if (process.env.__NEXT_EXPERIMENTAL_PPR) {
- additionalEnv.push(
- `NEXT_PRIVATE_EXPERIMENTAL_PPR=${process.env.__NEXT_EXPERIMENTAL_PPR}`
- )
- }
if (process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS) {
additionalEnv.push(
diff --git a/test/production/adapter-config/adapter-config-cache-components.test.ts b/test/production/adapter-config/adapter-config-cache-components.test.ts
new file mode 100644
index 0000000000000..34192952de9f8
--- /dev/null
+++ b/test/production/adapter-config/adapter-config-cache-components.test.ts
@@ -0,0 +1,6 @@
+process.env.TEST_CACHE_COMPONENTS = '1'
+
+// TODO(NAR-423): Migrate to Cache Components.
+describe.skip('adapter-config-cache-components', () => {
+ require('./adapter-config.test')
+})
diff --git a/test/production/adapter-config/adapter-config-ppr.test.ts b/test/production/adapter-config/adapter-config-ppr.test.ts
deleted file mode 100644
index 80272d1fbc909..0000000000000
--- a/test/production/adapter-config/adapter-config-ppr.test.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-process.env.TEST_PPR = '1'
-require('./adapter-config.test')
diff --git a/test/production/adapter-config/next.config.mjs b/test/production/adapter-config/next.config.mjs
index c5a54b98f7ac3..8f1d8dee84a43 100644
--- a/test/production/adapter-config/next.config.mjs
+++ b/test/production/adapter-config/next.config.mjs
@@ -5,7 +5,7 @@ const require = Module.createRequire(import.meta.url)
const nextConfig = {
experimental: {
adapterPath: require.resolve('./my-adapter.mjs'),
- ppr: Boolean(process.env.TEST_PPR),
+ cacheComponents: process.env.TEST_CACHE_COMPONENTS === '1',
},
output: process.env.TEST_EXPORT ? 'export' : undefined,
}
diff --git a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts
index b044721605e92..eb081b1b8dcba 100644
--- a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts
+++ b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts
@@ -26,9 +26,8 @@ describe('build-output-prerender', () => {
"▲ Next.js x.y.z (Turbopack)
- Experiments (use with caution):
✓ cacheComponents
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"
`)
@@ -37,9 +36,8 @@ describe('build-output-prerender', () => {
"▲ Next.js x.y.z (webpack)
- Experiments (use with caution):
✓ cacheComponents
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"
`)
@@ -73,8 +71,7 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)"
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)"
`)
} else if (isRspack) {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
@@ -82,8 +79,7 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)"
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)"
`)
} else {
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
@@ -91,8 +87,7 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)"
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)"
`)
}
}
@@ -147,9 +142,8 @@ describe('build-output-prerender', () => {
▲ Next.js x.y.z (Turbopack)
- Experiments (use with caution):
✓ cacheComponents
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)
@@ -162,9 +156,8 @@ describe('build-output-prerender', () => {
▲ Next.js x.y.z (webpack)
- Experiments (use with caution):
✓ cacheComponents
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)
@@ -210,9 +203,8 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)
⨯ turbopackMinify (disabled by \`--debug-prerender\`)"
`)
@@ -223,9 +215,8 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)
⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
`)
@@ -236,9 +227,8 @@ describe('build-output-prerender', () => {
- Experiments (use with caution):
✓ cacheComponents
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`experimental.cacheComponents\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
- ✓ rdcForNavigations (enabled by \`experimental.ppr\`)
+ ✓ rdcForNavigations (enabled by \`experimental.cacheComponents\`)
⨯ serverMinification (disabled by \`--debug-prerender\`)
✓ serverSourceMaps (enabled by \`--debug-prerender\`)"
`)
@@ -293,9 +283,8 @@ describe('build-output-prerender', () => {
"▲ Next.js x.y.z (Turbopack)
- Experiments (use with caution):
✓ cacheComponents (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"
`)
@@ -304,9 +293,8 @@ describe('build-output-prerender', () => {
"▲ Next.js x.y.z (webpack)
- Experiments (use with caution):
✓ cacheComponents (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`experimental.cacheComponents\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)"
`)
@@ -364,9 +352,8 @@ describe('build-output-prerender', () => {
▲ Next.js x.y.z (Turbopack)
- Experiments (use with caution):
✓ cacheComponents (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)
@@ -379,9 +366,8 @@ describe('build-output-prerender', () => {
▲ Next.js x.y.z (webpack)
- Experiments (use with caution):
✓ cacheComponents (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
- ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_PPR\`)
+ ✓ clientParamParsing (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)
- ✓ ppr (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
✓ rdcForNavigations (enabled by \`__NEXT_EXPERIMENTAL_CACHE_COMPONENTS\`)
✓ reactDebugChannel (enabled by \`__NEXT_EXPERIMENTAL_DEBUG_CHANNEL\`)
diff --git a/test/production/app-dir/build-output-tree-view/build-output-tree-view.test.ts b/test/production/app-dir/build-output-tree-view/build-output-tree-view.test.ts
index 5524a14c072ee..ece5aefffe43f 100644
--- a/test/production/app-dir/build-output-tree-view/build-output-tree-view.test.ts
+++ b/test/production/app-dir/build-output-tree-view/build-output-tree-view.test.ts
@@ -2,7 +2,8 @@ import { nextTestSetup } from 'e2e-utils'
import path from 'path'
describe('build-output-tree-view', () => {
- describe('with mixed static and dynamic pages and app router routes', () => {
+ // TODO(NAR-423): Migrate to Cache Components.
+ describe.skip('with mixed static and dynamic pages and app router routes', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, 'fixtures/mixed'),
skipStart: true,
diff --git a/test/production/app-dir/build-output-tree-view/fixtures/mixed/next.config.js b/test/production/app-dir/build-output-tree-view/fixtures/mixed/next.config.js
index 88b3464206ba2..735e19c3f3d57 100644
--- a/test/production/app-dir/build-output-tree-view/fixtures/mixed/next.config.js
+++ b/test/production/app-dir/build-output-tree-view/fixtures/mixed/next.config.js
@@ -4,7 +4,7 @@
const nextConfig = {
experimental: {
useCache: true,
- ppr: true,
+ cacheComponents: true,
},
}
diff --git a/test/production/app-dir/empty-generate-static-params/empty-generate-static-params.test.ts b/test/production/app-dir/empty-generate-static-params/empty-generate-static-params.test.ts
index 09920a5229a06..7e7b03b23ddc3 100644
--- a/test/production/app-dir/empty-generate-static-params/empty-generate-static-params.test.ts
+++ b/test/production/app-dir/empty-generate-static-params/empty-generate-static-params.test.ts
@@ -10,7 +10,8 @@ describe('empty-generate-static-params', () => {
if (skipped) return
it('should mark the page with empty generateStaticParams as SSG in build output', async () => {
- const isPPREnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
+ const isPPREnabled =
+ process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true'
expect(next.cliOutput).toContain(`${isPPREnabled ? '◐' : '●'} /[slug]`)
})
@@ -19,7 +20,8 @@ describe('empty-generate-static-params', () => {
expect(firstResponse.status).toBe(200)
// With PPR enabled, the initial request doesn't send back a cache header
- const isPPREnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
+ const isPPREnabled =
+ process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true'
expect(firstResponse.headers.get('x-nextjs-cache')).toBe(
isPPREnabled ? null : 'MISS'
diff --git a/test/production/app-dir/metadata-streaming-config/metadata-streaming-config-customized.test.ts b/test/production/app-dir/metadata-streaming-config/metadata-streaming-config-customized.test.ts
index 826a95b122eb2..c040b585ea5ab 100644
--- a/test/production/app-dir/metadata-streaming-config/metadata-streaming-config-customized.test.ts
+++ b/test/production/app-dir/metadata-streaming-config/metadata-streaming-config-customized.test.ts
@@ -1,6 +1,7 @@
import { nextTestSetup } from 'e2e-utils'
-describe('app-dir - metadata-streaming-config-customized', () => {
+// TODO: the incremental option has been removed, update to use cacheComponents
+describe.skip('app-dir - metadata-streaming-config-customized', () => {
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
diff --git a/test/production/app-dir/metadata-streaming-config/metadata-streaming-config.test.ts b/test/production/app-dir/metadata-streaming-config/metadata-streaming-config.test.ts
index 1601c422b1ee1..176e9d8e22f3c 100644
--- a/test/production/app-dir/metadata-streaming-config/metadata-streaming-config.test.ts
+++ b/test/production/app-dir/metadata-streaming-config/metadata-streaming-config.test.ts
@@ -1,6 +1,7 @@
import { nextTestSetup } from 'e2e-utils'
-describe('app-dir - metadata-streaming-config', () => {
+// TODO: the incremental option has been removed, update to use cacheComponents
+describe.skip('app-dir - metadata-streaming-config', () => {
const { next } = nextTestSetup({
files: __dirname,
})
diff --git a/test/production/app-dir/parallel-routes-static/index.test.ts b/test/production/app-dir/parallel-routes-static/index.test.ts
index c745ce3353ef2..68ea77d599df3 100644
--- a/test/production/app-dir/parallel-routes-static/index.test.ts
+++ b/test/production/app-dir/parallel-routes-static/index.test.ts
@@ -6,7 +6,7 @@ describe('app-dir parallel-routes-static', () => {
})
it('should static generate parallel routes', async () => {
- const rscExtension = process.env.__NEXT_EXPERIMENTAL_PPR
+ const rscExtension = process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS
? '.prefetch.rsc'
: '.rsc'
expect(await next.hasFile('.next/server/app/nested/foo.html')).toBe(true)
diff --git a/test/production/app-dir/ppr-use-server-inserted-html/next.config.js b/test/production/app-dir/ppr-use-server-inserted-html/next.config.js
index 016ac8833b57f..30a826fdacc56 100644
--- a/test/production/app-dir/ppr-use-server-inserted-html/next.config.js
+++ b/test/production/app-dir/ppr-use-server-inserted-html/next.config.js
@@ -3,7 +3,7 @@
*/
const nextConfig = {
experimental: {
- ppr: true,
+ cacheComponents: true,
},
}
diff --git a/test/production/app-dir/subresource-integrity/subresource-integrity.test.ts b/test/production/app-dir/subresource-integrity/subresource-integrity.test.ts
index 9d8e69723625b..e2d11397c4755 100644
--- a/test/production/app-dir/subresource-integrity/subresource-integrity.test.ts
+++ b/test/production/app-dir/subresource-integrity/subresource-integrity.test.ts
@@ -226,7 +226,10 @@ import cheerio from 'cheerio'
`script-src 'nonce-">"'`
)
- if (runtime === 'node' && process.env.__NEXT_EXPERIMENTAL_PPR) {
+ if (
+ runtime === 'node' &&
+ process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS
+ ) {
expect(res.status).toBe(200)
} else {
expect(res.status).toBe(500)
diff --git a/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts b/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts
index 20425f2585ef7..b17724be7c481 100644
--- a/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts
+++ b/test/production/standalone-mode/required-server-files/required-server-files-ppr.test.ts
@@ -13,7 +13,8 @@ import {
} from 'next-test-utils'
import { ChildProcess } from 'node:child_process'
-describe('required server files app router', () => {
+// TODO(NAR-423): Migrate to Cache Components.
+describe.skip('required server files app router', () => {
let next: NextInstance
let server: ChildProcess
let appPort: number | string
@@ -55,7 +56,7 @@ describe('required server files app router', () => {
nextConfig: {
cacheHandler: './cache-handler.js',
experimental: {
- ppr: true,
+ cacheComponents: true,
clientSegmentCache: true,
clientParamParsing: true,
},