Files
Janka UrygaandGitHub be2104ae04 test: Remove unnecessary dynamic timestamp from instant-validation root layouts (#95105)
Extracted from #94595 . The root layout includes a timestamp that we use
to check if the root layout changed during a navigation, but it was
unnecessarily using `await connection(); Date.now()` when a
`performance.now()`would be enough. Changing it to not introduce a
random dynamic hole which could affect validation in some way.
  
This change revealed that some client component tests were implicitly
relying on the dynamic timestamp component as a workaround for NAR-800 .
I've added a workaround dynamic component to each of the relevant tests,
those can be removed when we fix the bug.
2026-06-25 16:37:24 +00:00

27 lines
923 B
TypeScript

import type { ReactNode } from 'react'
import { FetchesClientData } from './client'
import { DataCacheProvider } from '../../../../client-data-fetching-lib/server'
import { HackilyPreventFullyStaticServerPrerender } from '../../../shared'
// Make sure that the holes from this layout aren't factored in for validation
// (otherwise, we'd check a navigation into it from the root layout and fail)
export const instant = false
export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<HackilyPreventFullyStaticServerPrerender />
<DataCacheProvider>
<div>
<p>
This layout renders a client component that suspends in SSR and
blocks the children. This prevents us from validating the page
below.
</p>
<FetchesClientData>{children}</FetchesClientData>
</div>
</DataCacheProvider>
</>
)
}