Unverified Commit d698d658 authored by Josh Story's avatar Josh Story Committed by GitHub

Remove partialFallbacks config flag (#93859)

Flag is already defaulted true. Removes option to disable
parent 4e75a9c3
...@@ -1543,10 +1543,7 @@ export async function handleBuildComplete({ ...@@ -1543,10 +1543,7 @@ export async function handleBuildComplete({
(item) => item.page === dynamicRoute (item) => item.page === dynamicRoute
)?.routeKeys || {} )?.routeKeys || {}
const allowQuery = Object.values(routeKeys) const allowQuery = Object.values(routeKeys)
const partialFallbacksEnabled =
config.experimental.partialFallbacks === true
const partialFallback = const partialFallback =
partialFallbacksEnabled &&
isAppPage && isAppPage &&
remainingPrerenderableParams !== undefined && remainingPrerenderableParams !== undefined &&
remainingPrerenderableParams.length > 0 && remainingPrerenderableParams.length > 0 &&
...@@ -1573,7 +1570,7 @@ export async function handleBuildComplete({ ...@@ -1573,7 +1570,7 @@ export async function handleBuildComplete({
// RSC shell. // RSC shell.
else if (meta.postponed) { else if (meta.postponed) {
// If there's postponed fallback content, we usually collapse to a shared shell (`[]`). // If there's postponed fallback content, we usually collapse to a shared shell (`[]`).
// For opt-in partial fallbacks in cache components, keep only the // For partial fallbacks in cache components, keep only the
// params that can still complete this shell. // params that can still complete this shell.
const remainingPrerenderableQueryKeys = new Set( const remainingPrerenderableQueryKeys = new Set(
(remainingPrerenderableParams ?? []).map( (remainingPrerenderableParams ?? []).map(
......
...@@ -2109,8 +2109,6 @@ export default async function build( ...@@ -2109,8 +2109,6 @@ export default async function build(
defaultLocale: config.i18n?.defaultLocale, defaultLocale: config.i18n?.defaultLocale,
nextConfigOutput: config.output, nextConfigOutput: config.output,
pprConfig: config.experimental.ppr, pprConfig: config.experimental.ppr,
partialFallbacksEnabled:
config.experimental.partialFallbacks === true,
cacheLifeProfiles: config.cacheLife, cacheLifeProfiles: config.cacheLife,
buildId, buildId,
deploymentId: config.deploymentId, deploymentId: config.deploymentId,
...@@ -2344,8 +2342,6 @@ export default async function build( ...@@ -2344,8 +2342,6 @@ export default async function build(
cacheMaxMemorySize: config.cacheMaxMemorySize, cacheMaxMemorySize: config.cacheMaxMemorySize,
nextConfigOutput: config.output, nextConfigOutput: config.output,
pprConfig: config.experimental.ppr, pprConfig: config.experimental.ppr,
partialFallbacksEnabled:
config.experimental.partialFallbacks === true,
cacheLifeProfiles: config.cacheLife, cacheLifeProfiles: config.cacheLife,
buildId, buildId,
deploymentId: config.deploymentId, deploymentId: config.deploymentId,
......
...@@ -44,7 +44,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -44,7 +44,7 @@ describe('assignStaticShellMetadata', () => {
}, },
] ]
assignStaticShellMetadata(prerenderedRoutes, [], true) assignStaticShellMetadata(prerenderedRoutes, [])
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(true) expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(true)
}) })
...@@ -76,7 +76,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -76,7 +76,7 @@ describe('assignStaticShellMetadata', () => {
}, },
] ]
assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('id'), true) assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('id'))
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false)
expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(true) expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(true)
...@@ -150,11 +150,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -150,11 +150,7 @@ describe('assignStaticShellMetadata', () => {
}, },
] ]
assignStaticShellMetadata( assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('id', 'name'))
prerenderedRoutes,
pathnameSegments('id', 'name'),
true
)
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false)
expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(false) expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(false)
...@@ -210,8 +206,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -210,8 +206,7 @@ describe('assignStaticShellMetadata', () => {
assignStaticShellMetadata( assignStaticShellMetadata(
prerenderedRoutes, prerenderedRoutes,
pathnameSegments('id', ['name', true], 'extra'), pathnameSegments('id', ['name', true], 'extra')
true
) )
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false)
...@@ -234,45 +229,10 @@ describe('assignStaticShellMetadata', () => { ...@@ -234,45 +229,10 @@ describe('assignStaticShellMetadata', () => {
it('should handle empty input', () => { it('should handle empty input', () => {
const prerenderedRoutes: PrerenderedRoute[] = [] const prerenderedRoutes: PrerenderedRoute[] = []
assignStaticShellMetadata(prerenderedRoutes, [], true) assignStaticShellMetadata(prerenderedRoutes, [])
expect(prerenderedRoutes).toEqual([]) expect(prerenderedRoutes).toEqual([])
}) })
it('should skip remaining prerenderable params when partial fallbacks are disabled', () => {
const prerenderedRoutes: PrerenderedRoute[] = [
{
params: {},
pathname: '/[id]',
encodedPathname: '/[id]',
fallbackRouteParams: [
{
paramName: 'id',
paramType: 'dynamic',
},
],
fallbackMode: FallbackMode.NOT_FOUND,
fallbackRootParams: [],
throwOnEmptyStaticShell: true,
},
{
params: { id: '1' },
pathname: '/1',
encodedPathname: '/1',
fallbackRouteParams: [],
fallbackMode: FallbackMode.NOT_FOUND,
fallbackRootParams: [],
throwOnEmptyStaticShell: true,
},
]
assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('id'), false)
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false)
expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(true)
expect(prerenderedRoutes[0].remainingPrerenderableParams).toBeUndefined()
expect(prerenderedRoutes[1].remainingPrerenderableParams).toBeUndefined()
})
it('should handle blog/[slug] not throwing when concrete routes exist (from docs example)', () => { it('should handle blog/[slug] not throwing when concrete routes exist (from docs example)', () => {
const prerenderedRoutes: PrerenderedRoute[] = [ const prerenderedRoutes: PrerenderedRoute[] = [
{ {
...@@ -309,7 +269,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -309,7 +269,7 @@ describe('assignStaticShellMetadata', () => {
}, },
] ]
assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('slug'), true) assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('slug'))
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) // Should not throw - has concrete children expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) // Should not throw - has concrete children
expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(true) // Should throw - concrete route expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(true) // Should throw - concrete route
...@@ -361,11 +321,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -361,11 +321,7 @@ describe('assignStaticShellMetadata', () => {
}, },
] ]
assignStaticShellMetadata( assignStaticShellMetadata(prerenderedRoutes, pathnameSegments('id', 'slug'))
prerenderedRoutes,
pathnameSegments('id', 'slug'),
true
)
expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) // Should not throw - has children expect(prerenderedRoutes[0].throwOnEmptyStaticShell).toBe(false) // Should not throw - has children
expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(false) // Should not throw - has children expect(prerenderedRoutes[1].throwOnEmptyStaticShell).toBe(false) // Should not throw - has children
...@@ -445,8 +401,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -445,8 +401,7 @@ describe('assignStaticShellMetadata', () => {
assignStaticShellMetadata( assignStaticShellMetadata(
prerenderedRoutes, prerenderedRoutes,
pathnameSegments('category', 'subcategory', 'item'), pathnameSegments('category', 'subcategory', 'item')
true
) )
// All except the last one should not throw on empty static shell // All except the last one should not throw on empty static shell
...@@ -485,8 +440,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -485,8 +440,7 @@ describe('assignStaticShellMetadata', () => {
assignStaticShellMetadata( assignStaticShellMetadata(
prerenderedRoutes, prerenderedRoutes,
pathnameSegments('locale', 'segments'), pathnameSegments('locale', 'segments')
true
) )
// The route with more fallback params should not throw on empty static shell // The route with more fallback params should not throw on empty static shell
...@@ -532,8 +486,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -532,8 +486,7 @@ describe('assignStaticShellMetadata', () => {
assignStaticShellMetadata( assignStaticShellMetadata(
prerenderedRoutes, prerenderedRoutes,
pathnameSegments(['one', true], 'two'), pathnameSegments(['one', true], 'two')
true
) )
expect(prerenderedRoutes[0].remainingPrerenderableParams).toEqual([ expect(prerenderedRoutes[0].remainingPrerenderableParams).toEqual([
...@@ -591,8 +544,7 @@ describe('assignStaticShellMetadata', () => { ...@@ -591,8 +544,7 @@ describe('assignStaticShellMetadata', () => {
assignStaticShellMetadata( assignStaticShellMetadata(
prerenderedRoutes, prerenderedRoutes,
pathnameSegments(['one', true], 'two', ['three', true]), pathnameSegments(['one', true], 'two', ['three', true])
true
) )
expect(prerenderedRoutes[0].remainingPrerenderableParams).toEqual([ expect(prerenderedRoutes[0].remainingPrerenderableParams).toEqual([
......
...@@ -433,8 +433,7 @@ export function assignStaticShellMetadata( ...@@ -433,8 +433,7 @@ export function assignStaticShellMetadata(
pathnameSegments: ReadonlyArray<{ pathnameSegments: ReadonlyArray<{
readonly paramName: string readonly paramName: string
readonly hasGenerateStaticParams: boolean readonly hasGenerateStaticParams: boolean
}>, }>
computeRemainingPrerenderableParams: boolean
): void { ): void {
// If there are no routes to process, exit early. // If there are no routes to process, exit early.
if (prerenderedRoutes.length === 0) { if (prerenderedRoutes.length === 0) {
...@@ -554,11 +553,7 @@ export function assignStaticShellMetadata( ...@@ -554,11 +553,7 @@ export function assignStaticShellMetadata(
route.throwOnEmptyStaticShell = true // Should throw on empty static shell. route.throwOnEmptyStaticShell = true // Should throw on empty static shell.
} }
if ( if (route.fallbackRouteParams && route.fallbackRouteParams.length > 0) {
computeRemainingPrerenderableParams &&
route.fallbackRouteParams &&
route.fallbackRouteParams.length > 0
) {
const fallbackRouteParamsByName = new Map( const fallbackRouteParamsByName = new Map(
route.fallbackRouteParams.map((param) => [param.paramName, param]) route.fallbackRouteParams.map((param) => [param.paramName, param])
) )
...@@ -795,7 +790,6 @@ export async function buildAppStaticPaths({ ...@@ -795,7 +790,6 @@ export async function buildAppStaticPaths({
nextConfigOutput, nextConfigOutput,
ComponentMod, ComponentMod,
isRoutePPREnabled = false, isRoutePPREnabled = false,
partialFallbacksEnabled = false,
buildId, buildId,
deploymentId, deploymentId,
rootParamKeys, rootParamKeys,
...@@ -821,7 +815,6 @@ export async function buildAppStaticPaths({ ...@@ -821,7 +815,6 @@ export async function buildAppStaticPaths({
nextConfigOutput: 'standalone' | 'export' | undefined nextConfigOutput: 'standalone' | 'export' | undefined
ComponentMod: AppPageModule | AppRouteModule ComponentMod: AppPageModule | AppRouteModule
isRoutePPREnabled: boolean isRoutePPREnabled: boolean
partialFallbacksEnabled?: boolean
buildId: string buildId: string
deploymentId: string deploymentId: string
rootParamKeys: readonly string[] rootParamKeys: readonly string[]
...@@ -1125,11 +1118,7 @@ export async function buildAppStaticPaths({ ...@@ -1125,11 +1118,7 @@ export async function buildAppStaticPaths({
// Now we have to set the throwOnEmptyStaticShell for each of the routes. // Now we have to set the throwOnEmptyStaticShell for each of the routes.
if (prerenderedRoutes && cacheComponents) { if (prerenderedRoutes && cacheComponents) {
assignStaticShellMetadata( assignStaticShellMetadata(prerenderedRoutes, prerenderablePathSegments)
prerenderedRoutes,
prerenderablePathSegments,
partialFallbacksEnabled
)
} }
return { fallbackMode, prerenderedRoutes } return { fallbackMode, prerenderedRoutes }
......
...@@ -597,7 +597,6 @@ export async function handler( ...@@ -597,7 +597,6 @@ export async function handler(
: null : null
if ( if (
nextConfig.experimental.partialFallbacks === true &&
fallbackPathname && fallbackPathname &&
prerenderInfo?.fallbackRouteParams?.length && prerenderInfo?.fallbackRouteParams?.length &&
!hasUnresolvedRootFallbackParams !hasUnresolvedRootFallbackParams
...@@ -682,7 +681,6 @@ export async function handler( ...@@ -682,7 +681,6 @@ export async function handler(
routerServerContext?.isWrappedByNextServer routerServerContext?.isWrappedByNextServer
) )
const remainingFallbackRouteParams = const remainingFallbackRouteParams =
nextConfig.experimental.partialFallbacks === true &&
remainingPrerenderableParams.length > 0 remainingPrerenderableParams.length > 0
? (prerenderInfo?.fallbackRouteParams?.filter( ? (prerenderInfo?.fallbackRouteParams?.filter(
(param) => (param) =>
...@@ -1052,7 +1050,6 @@ export async function handler( ...@@ -1052,7 +1050,6 @@ export async function handler(
} }
if ( if (
nextConfig.experimental.partialFallbacks === true &&
prerenderInfo?.fallback === null && prerenderInfo?.fallback === null &&
!hasOmittedConcreteFallbackParam && !hasOmittedConcreteFallbackParam &&
!hasUnresolvedRootFallbackParams && !hasUnresolvedRootFallbackParams &&
...@@ -1214,7 +1211,6 @@ export async function handler( ...@@ -1214,7 +1211,6 @@ export async function handler(
// Match the build-time contract: only fallback shells that can // Match the build-time contract: only fallback shells that can
// still be completed with prerenderable params should upgrade. // still be completed with prerenderable params should upgrade.
remainingPrerenderableParams.length > 0 && remainingPrerenderableParams.length > 0 &&
nextConfig.experimental.partialFallbacks === true &&
ssgCacheKey && ssgCacheKey &&
incrementalCache && incrementalCache &&
!isOnDemandRevalidate && !isOnDemandRevalidate &&
......
...@@ -694,7 +694,6 @@ export async function isPageStatic({ ...@@ -694,7 +694,6 @@ export async function isPageStatic({
cacheHandlers, cacheHandlers,
cacheLifeProfiles, cacheLifeProfiles,
pprConfig, pprConfig,
partialFallbacksEnabled,
buildId, buildId,
deploymentId, deploymentId,
clientAssetToken, clientAssetToken,
...@@ -725,7 +724,6 @@ export async function isPageStatic({ ...@@ -725,7 +724,6 @@ export async function isPageStatic({
} }
nextConfigOutput: 'standalone' | 'export' | undefined nextConfigOutput: 'standalone' | 'export' | undefined
pprConfig: ExperimentalPPRConfig | undefined pprConfig: ExperimentalPPRConfig | undefined
partialFallbacksEnabled: boolean
buildId: string buildId: string
deploymentId: string deploymentId: string
clientAssetToken: string clientAssetToken: string
...@@ -892,7 +890,6 @@ export async function isPageStatic({ ...@@ -892,7 +890,6 @@ export async function isPageStatic({
ComponentMod, ComponentMod,
nextConfigOutput, nextConfigOutput,
isRoutePPREnabled, isRoutePPREnabled,
partialFallbacksEnabled,
buildId, buildId,
deploymentId, deploymentId,
rootParamKeys, rootParamKeys,
......
...@@ -221,7 +221,6 @@ export const experimentalSchema = { ...@@ -221,7 +221,6 @@ export const experimentalSchema = {
caseSensitiveRoutes: z.boolean().optional(), caseSensitiveRoutes: z.boolean().optional(),
clientParamParsingOrigins: z.array(z.string()).optional(), clientParamParsingOrigins: z.array(z.string()).optional(),
cachedNavigations: z.boolean().optional(), cachedNavigations: z.boolean().optional(),
partialFallbacks: z.boolean().optional(),
dynamicOnHover: z.boolean().optional(), dynamicOnHover: z.boolean().optional(),
useOffline: z.boolean().optional(), useOffline: z.boolean().optional(),
optimisticRouting: z.boolean().optional(), optimisticRouting: z.boolean().optional(),
......
...@@ -433,11 +433,6 @@ export interface ExperimentalConfig { ...@@ -433,11 +433,6 @@ export interface ExperimentalConfig {
*/ */
clientParamParsingOrigins?: string[] clientParamParsingOrigins?: string[]
cachedNavigations?: boolean cachedNavigations?: boolean
/**
* Enables partial fallback shells for cache-components routes while the
* feature stabilizes.
*/
partialFallbacks?: boolean
dynamicOnHover?: boolean dynamicOnHover?: boolean
useOffline?: boolean useOffline?: boolean
optimisticRouting?: boolean optimisticRouting?: boolean
...@@ -1921,7 +1916,6 @@ export const defaultConfig = Object.freeze({ ...@@ -1921,7 +1916,6 @@ export const defaultConfig = Object.freeze({
caseSensitiveRoutes: false, caseSensitiveRoutes: false,
clientParamParsingOrigins: undefined, clientParamParsingOrigins: undefined,
cachedNavigations: false, cachedNavigations: false,
partialFallbacks: true,
dynamicOnHover: false, dynamicOnHover: false,
useOffline: false, useOffline: false,
varyParams: false, varyParams: false,
...@@ -2103,7 +2097,6 @@ export interface NextConfigRuntime { ...@@ -2103,7 +2097,6 @@ export interface NextConfigRuntime {
| 'runtimeServerDeploymentId' | 'runtimeServerDeploymentId'
| 'maxPostponedStateSize' | 'maxPostponedStateSize'
| 'cachedNavigations' | 'cachedNavigations'
| 'partialFallbacks'
| 'exposeTestingApiInProductionBuild' | 'exposeTestingApiInProductionBuild'
| 'supportsImmutableAssets' | 'supportsImmutableAssets'
| 'useNodeStreams' | 'useNodeStreams'
...@@ -2172,7 +2165,6 @@ export function getNextConfigRuntime( ...@@ -2172,7 +2165,6 @@ export function getNextConfigRuntime(
runtimeServerDeploymentId: ex.runtimeServerDeploymentId, runtimeServerDeploymentId: ex.runtimeServerDeploymentId,
maxPostponedStateSize: ex.maxPostponedStateSize, maxPostponedStateSize: ex.maxPostponedStateSize,
cachedNavigations: ex.cachedNavigations, cachedNavigations: ex.cachedNavigations,
partialFallbacks: ex.partialFallbacks,
exposeTestingApiInProductionBuild: ex.exposeTestingApiInProductionBuild, exposeTestingApiInProductionBuild: ex.exposeTestingApiInProductionBuild,
supportsImmutableAssets: ex.supportsImmutableAssets, supportsImmutableAssets: ex.supportsImmutableAssets,
useNodeStreams: ex.useNodeStreams, useNodeStreams: ex.useNodeStreams,
......
...@@ -807,8 +807,6 @@ export default class DevServer extends Server { ...@@ -807,8 +807,6 @@ export default class DevServer extends Server {
pathname, pathname,
config: { config: {
pprConfig: this.nextConfig.experimental.ppr, pprConfig: this.nextConfig.experimental.ppr,
partialFallbacks:
this.nextConfig.experimental.partialFallbacks === true,
configFileName, configFileName,
cacheComponents: Boolean(this.nextConfig.cacheComponents), cacheComponents: Boolean(this.nextConfig.cacheComponents),
}, },
......
...@@ -30,7 +30,6 @@ import { parseNormalizedAppRoute } from '../../shared/lib/router/routes/app' ...@@ -30,7 +30,6 @@ import { parseNormalizedAppRoute } from '../../shared/lib/router/routes/app'
type RuntimeConfig = { type RuntimeConfig = {
pprConfig: ExperimentalPPRConfig | undefined pprConfig: ExperimentalPPRConfig | undefined
partialFallbacks: boolean
configFileName: string configFileName: string
cacheComponents: boolean cacheComponents: boolean
} }
...@@ -154,7 +153,6 @@ export async function loadStaticPaths({ ...@@ -154,7 +153,6 @@ export async function loadStaticPaths({
ComponentMod: components.ComponentMod, ComponentMod: components.ComponentMod,
nextConfigOutput, nextConfigOutput,
isRoutePPREnabled, isRoutePPREnabled,
partialFallbacksEnabled: config.partialFallbacks,
buildId, buildId,
deploymentId, deploymentId,
authInterrupts, authInterrupts,
......
import type { ReactNode } from 'react'
export default async function RootLayout({
children,
}: {
children: ReactNode
}) {
return (
<html>
<body>{children}</body>
</html>
)
}
export default function Loading() {
return (
<div id="two-fallback" data-fallback>
loading two...
</div>
)
}
export default async function Page({
params,
}: {
params: Promise<{ one: string; two: string }>
}) {
const { two } = await params
return <div id="two">{two}</div>
}
import { Suspense, type ReactNode } from 'react'
type LayoutProps = {
children: ReactNode
params: Promise<{ one: string }>
}
export function generateStaticParams() {
return [{ one: 'b' }]
}
async function LayoutImpl({ children, params }: LayoutProps) {
const { one } = await params
return (
<div>
<div id="one">{one}</div>
{children}
</div>
)
}
export default async function LayoutWrapper(props: LayoutProps) {
return (
<Suspense
fallback={
<div id="one-fallback" data-fallback>
loading one...
</div>
}
>
<LayoutImpl {...props} />
</Suspense>
)
}
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
cacheComponents: true,
experimental: {
partialFallbacks: false,
},
}
module.exports = nextConfig
...@@ -168,59 +168,3 @@ describe('partial-fallback-shell-upgrade', () => { ...@@ -168,59 +168,3 @@ describe('partial-fallback-shell-upgrade', () => {
) )
}) })
}) })
describe('partial-fallback-shell-upgrade when disabled', () => {
const { next, isNextDev } = nextTestSetup({
files: path.join(__dirname, 'fixtures', 'disabled'),
// The latest changes to support this behavior on deployed infra are available in the adapter,
// and are not being backported to the CLI
skipDeployment: !isAdapterTest,
})
if (isNextDev) {
it('skipped in dev', () => {})
return
}
const fetchSplitHTML = createSplitHTMLFetcher(next)
it('should keep serving the generic shell when partialFallbacks is disabled', async () => {
const firstResult = await fetchSplitHTML('/prefix/c/foo')
expect(firstResult.response.status).toBe(200)
expect(firstResult.static$('#one').length).toBe(0)
expect(firstResult.static$('#one-fallback').text()).toBe('loading one...')
expect(firstResult.static$('#two-fallback').length).toBe(0)
expect(firstResult.static$('#two').length).toBe(0)
expect(firstResult.dynamicPart).toContain('<div id="one">c</div>')
expect(firstResult.dynamicPart).toContain('<div id="two">foo</div>')
const start = Date.now()
await retry(
async () => {
const secondResult = await fetchSplitHTML('/prefix/c/bar')
expect(secondResult.response.status).toBe(200)
expect(secondResult.static$('#one').length).toBe(0)
expect(secondResult.static$('#one-fallback').text()).toBe(
'loading one...'
)
expect(secondResult.static$('#two-fallback').length).toBe(0)
expect(secondResult.static$('#two').length).toBe(0)
expect(secondResult.dynamicPart).toContain('<div id="one">c</div>')
expect(secondResult.dynamicPart).toContain('<div id="two">bar</div>')
expect(secondResult.dynamicPart).not.toContain(
'<div id="two">foo</div>'
)
if (Date.now() - start < 5000) {
throw new Error('continue polling generic shell')
}
},
6000,
500,
'generic shell should remain unupgraded when partialFallbacks is disabled'
)
})
})
...@@ -5920,8 +5920,7 @@ ...@@ -5920,8 +5920,7 @@
"partial-fallback-shell-upgrade should not keep upgrading once only fully dynamic params remain", "partial-fallback-shell-upgrade should not keep upgrading once only fully dynamic params remain",
"partial-fallback-shell-upgrade should not upgrade a route shell when no params were prerendered", "partial-fallback-shell-upgrade should not upgrade a route shell when no params were prerendered",
"partial-fallback-shell-upgrade should upgrade a generic shell into the most specific prerendered shell", "partial-fallback-shell-upgrade should upgrade a generic shell into the most specific prerendered shell",
"partial-fallback-shell-upgrade should upgrade the fallback shell to a route shell", "partial-fallback-shell-upgrade should upgrade the fallback shell to a route shell"
"partial-fallback-shell-upgrade when disabled should keep serving the generic shell when partialFallbacks is disabled"
], ],
"failed": [], "failed": [],
"pending": [], "pending": [],
...@@ -8630,10 +8630,7 @@ ...@@ -8630,10 +8630,7 @@
"runtimeError": false "runtimeError": false
}, },
"test/e2e/app-dir/partial-fallback-shell-upgrade/partial-fallback-shell-upgrade.test.ts": { "test/e2e/app-dir/partial-fallback-shell-upgrade/partial-fallback-shell-upgrade.test.ts": {
"passed": [ "passed": ["partial-fallback-shell-upgrade skipped in dev"],
"partial-fallback-shell-upgrade skipped in dev",
"partial-fallback-shell-upgrade when disabled skipped in dev"
],
"failed": [], "failed": [],
"pending": [], "pending": [],
"flakey": [], "flakey": [],
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment