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

Add unstable_prefetch route segment config and decouple runtime prefetching…

 Add unstable_prefetch route segment config and decouple runtime prefetching from unstable_instant (#92754)

Allows you to opt into runtime prefetching without coupling it to the
way you configure instant validation. We do not intend to allow shipping
runtime prefetching without opting into instant validation unless you
specifically disable the validation because the cost of the runtime
prefetching is potentially high but the way you configure validation is
likely going to be pulling in lots of test code and we want to make it
easier to discern that the validation code is not going to be bundled
into production builds so separating the config is helpful.

Another reason to separate the config is that we expect that eventually
most prefetching is configured globally and you do not need to opt
specific segments into a different prefetching strategy.

Improved client component error messages to accurately describe the
constraint: these are route segment configs that require a Server
Component module, not exports that are forbidden.
parent 9c53486a
...@@ -119,6 +119,9 @@ pub struct NextSegmentConfig { ...@@ -119,6 +119,9 @@ pub struct NextSegmentConfig {
#[turbo_tasks(trace_ignore)] #[turbo_tasks(trace_ignore)]
#[bincode(with_serde)] #[bincode(with_serde)]
pub unstable_instant: Option<Span>, pub unstable_instant: Option<Span>,
#[turbo_tasks(trace_ignore)]
#[bincode(with_serde)]
pub unstable_prefetch: Option<Span>,
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
...@@ -533,9 +536,25 @@ pub async fn parse_segment_config_from_source( ...@@ -533,9 +536,25 @@ pub async fn parse_segment_config_from_source(
"unstable_instant", "unstable_instant",
span, span,
rcstr!( rcstr!(
"App pages cannot export \"unstable_instant\" from a Client Component module. \ "\"unstable_instant\" is a route segment config and can only be used when the \
To use this API, convert this module to a Server Component by removing the \ segment is a Server Component module. Remove the \"use client\" directive to \
\"use client\" directive." use this API."
),
None,
IssueSeverity::Error,
)
.await?;
}
if let Some(span) = config.unstable_prefetch {
invalid_config(
source,
"unstable_prefetch",
span,
rcstr!(
"\"unstable_prefetch\" is a route segment config and can only be used when \
the segment is a Server Component module. Remove the \"use client\" \
directive to use this API."
), ),
None, None,
IssueSeverity::Error, IssueSeverity::Error,
...@@ -962,6 +981,9 @@ async fn parse_config_value( ...@@ -962,6 +981,9 @@ async fn parse_config_value(
"unstable_instant" => { "unstable_instant" => {
config.unstable_instant = Some(span); config.unstable_instant = Some(span);
} }
"unstable_prefetch" => {
config.unstable_prefetch = Some(span);
}
_ => {} _ => {}
} }
......
...@@ -1156,5 +1156,9 @@ ...@@ -1156,5 +1156,9 @@
"1155": "Not implemented", "1155": "Not implemented",
"1156": "Cannot create a replay stream after the ReplayableNodeStream has been disposed.", "1156": "Cannot create a replay stream after the ReplayableNodeStream has been disposed.",
"1157": "`unstable_io()` requires the `experimental.unstableIO` option to be enabled in your Next.js config.", "1157": "`unstable_io()` requires the `experimental.unstableIO` option to be enabled in your Next.js config.",
"1158": "The prerender-ppr work unit type has been removed. This code path should be unreachable." "1158": "The prerender-ppr work unit type has been removed. This code path should be unreachable.",
"1159": "\"unstable_instant\" is a route segment config and can only be used when the segment is a Server Component module. Remove the \"use client\" directive from \"%s\" to use this API.",
"1160": "Route \"%s\" cannot use \\`export const unstable_prefetch = ...\\` without enabling \\`cacheComponents\\`.",
"1161": "\"unstable_prefetch\" is a route segment config and can only be used when the segment is a Server Component module. Remove the \"use client\" directive from \"%s\" to use this API.",
"1162": "Route \"%s\" cannot use \\`export const unstable_instant = ...\\` without enabling \\`cacheComponents\\`."
} }
...@@ -681,13 +681,26 @@ export async function getAppPageStaticInfo({ ...@@ -681,13 +681,26 @@ export async function getAppPageStaticInfo({
// Prevent use client and unstable_instant in the same file. // Prevent use client and unstable_instant in the same file.
if (directives?.has('client') && 'unstable_instant' in config) { if (directives?.has('client') && 'unstable_instant' in config) {
throw new Error( throw new Error(
`Page "${page}" cannot export "unstable_instant" from a Client Component module. To use this API, convert this module to a Server Component by removing the "use client" directive.` `"unstable_instant" is a route segment config and can only be used when the segment is a Server Component module. Remove the "use client" directive from "${pageFilePath}" to use this API.`
) )
} }
if ('unstable_instant' in config && !nextConfig.cacheComponents) { if ('unstable_instant' in config && !nextConfig.cacheComponents) {
throw new Error( throw new Error(
`Page "${page}" cannot use \`export const unstable_instant = ...\` without enabling \`cacheComponents\`.` `Route "${page}" cannot use \`export const unstable_instant = ...\` without enabling \`cacheComponents\`.`
)
}
// Prevent use client and unstable_prefetch in the same file.
if (directives?.has('client') && 'unstable_prefetch' in config) {
throw new Error(
`"unstable_prefetch" is a route segment config and can only be used when the segment is a Server Component module. Remove the "use client" directive from "${pageFilePath}" to use this API.`
)
}
if ('unstable_prefetch' in config && !nextConfig.cacheComponents) {
throw new Error(
`Route "${page}" cannot use \`export const unstable_prefetch = ...\` without enabling \`cacheComponents\`.`
) )
} }
......
...@@ -49,8 +49,12 @@ const InstantConfigSchema = z.union([ ...@@ -49,8 +49,12 @@ const InstantConfigSchema = z.union([
z.literal(false), z.literal(false),
]) ])
const PrefetchSchema = z.enum(['static', 'runtime'])
export type Instant = InstantConfigStatic | InstantConfigRuntime | false export type Instant = InstantConfigStatic | InstantConfigRuntime | false
export type Prefetch = 'static' | 'runtime'
export type InstantConfigForTypeCheckInternal = __GenericInstantConfig | Instant export type InstantConfigForTypeCheckInternal = __GenericInstantConfig | Instant
// the __GenericPrefetch type is used to avoid type widening issues with // the __GenericPrefetch type is used to avoid type widening issues with
// our choice to make exports the medium for programming a Next.js application // our choice to make exports the medium for programming a Next.js application
...@@ -145,6 +149,13 @@ const AppSegmentConfigSchema = z.object({ ...@@ -145,6 +149,13 @@ const AppSegmentConfigSchema = z.object({
*/ */
unstable_instant: InstantConfigSchema.optional(), unstable_instant: InstantConfigSchema.optional(),
/**
* Controls runtime prefetching for this segment.
* 'static' is a noop (default behavior).
* 'runtime' enables runtime prefetching.
*/
unstable_prefetch: PrefetchSchema.optional(),
/** /**
* The stale time for dynamic responses in seconds. * The stale time for dynamic responses in seconds.
* Controls how long the client-side router cache retains dynamic page data. * Controls how long the client-side router cache retains dynamic page data.
...@@ -195,6 +206,11 @@ export function parseAppSegmentConfig( ...@@ -195,6 +206,11 @@ export function parseAppSegmentConfig(
message: `Invalid unstable_instant value ${JSON.stringify(ctx.data)} on "${route}", must be an object with \`prefetch: "static"\` or \`prefetch: "runtime"\`, or \`false\`. Read more at https://nextjs.org/docs/messages/invalid-instant-configuration`, message: `Invalid unstable_instant value ${JSON.stringify(ctx.data)} on "${route}", must be an object with \`prefetch: "static"\` or \`prefetch: "runtime"\`, or \`false\`. Read more at https://nextjs.org/docs/messages/invalid-instant-configuration`,
} }
} }
case 'unstable_prefetch': {
return {
message: `Invalid unstable_prefetch value ${JSON.stringify(ctx.data)} on "${route}", must be "static" or "runtime".`,
}
}
case 'unstable_dynamicStaleTime': { case 'unstable_dynamicStaleTime': {
return { return {
message: `Invalid unstable_dynamicStaleTime value ${JSON.stringify(ctx.data)} on "${route}", must be a non-negative number`, message: `Invalid unstable_dynamicStaleTime value ${JSON.stringify(ctx.data)} on "${route}", must be a non-negative number`,
...@@ -254,6 +270,13 @@ export type AppSegmentConfig = { ...@@ -254,6 +270,13 @@ export type AppSegmentConfig = {
*/ */
unstable_instant?: Instant unstable_instant?: Instant
/**
* Controls runtime prefetching for this segment.
* 'static' is a noop (default behavior).
* 'runtime' enables runtime prefetching.
*/
unstable_prefetch?: Prefetch
/** /**
* The stale time for dynamic responses in seconds. * The stale time for dynamic responses in seconds.
* Controls how long the client-side router cache retains dynamic page data. * Controls how long the client-side router cache retains dynamic page data.
......
...@@ -54,7 +54,7 @@ ${ ...@@ -54,7 +54,7 @@ ${
: `import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'` : `import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'`
} }
import type { InstantConfigForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js' import type { InstantConfigForTypeCheckInternal, Prefetch } from 'next/dist/build/segment-config/app/app-segment-config.js'
type TEntry = typeof import('${relativePath}.js') type TEntry = typeof import('${relativePath}.js')
...@@ -72,6 +72,7 @@ checkFields<Diff<{ ...@@ -72,6 +72,7 @@ checkFields<Diff<{
config?: {} config?: {}
generateStaticParams?: Function generateStaticParams?: Function
unstable_instant?: InstantConfigForTypeCheckInternal unstable_instant?: InstantConfigForTypeCheckInternal
unstable_prefetch?: Prefetch
unstable_dynamicStaleTime?: number unstable_dynamicStaleTime?: number
revalidate?: RevalidateRange<TEntry> | false revalidate?: RevalidateRange<TEntry> | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static' dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
......
...@@ -243,13 +243,10 @@ async function createComponentTreeInternal( ...@@ -243,13 +243,10 @@ async function createComponentTreeInternal(
}) })
: [] : []
const instantConfig = layoutOrPageMod const prefetchConfig = layoutOrPageMod
? (layoutOrPageMod as AppSegmentConfig).unstable_instant ? (layoutOrPageMod as AppSegmentConfig).unstable_prefetch
: undefined : undefined
const hasRuntimePrefetch = const hasRuntimePrefetch = prefetchConfig === 'runtime'
instantConfig && typeof instantConfig === 'object'
? instantConfig.prefetch === 'runtime'
: false
const isRuntimePrefetchable = hasRuntimePrefetch || parentRuntimePrefetchable const isRuntimePrefetchable = hasRuntimePrefetch || parentRuntimePrefetchable
const [Forbidden, forbiddenStyles] = const [Forbidden, forbiddenStyles] =
......
...@@ -28,11 +28,14 @@ async function createFlightRouterStateFromLoaderTreeImpl( ...@@ -28,11 +28,14 @@ async function createFlightRouterStateFromLoaderTreeImpl(
{}, {},
] ]
// Load the layout or page module to check for unstable_instant config // Load the layout or page module to check for unstable_instant/unstable_prefetch config
const mod = layout ? await layout[0]() : page ? await page[0]() : undefined const mod = layout ? await layout[0]() : page ? await page[0]() : undefined
const instantConfig = mod const instantConfig = mod
? (mod as AppSegmentConfig).unstable_instant ? (mod as AppSegmentConfig).unstable_instant
: undefined : undefined
const prefetchConfig = mod
? (mod as AppSegmentConfig).unstable_prefetch
: undefined
let prefetchHints = 0 let prefetchHints = 0
// Union in the precomputed build-time hints (e.g. segment inlining // Union in the precomputed build-time hints (e.g. segment inlining
...@@ -89,9 +92,10 @@ async function createFlightRouterStateFromLoaderTreeImpl( ...@@ -89,9 +92,10 @@ async function createFlightRouterStateFromLoaderTreeImpl(
prefetchHints |= PrefetchHint.PrefetchDisabled prefetchHints |= PrefetchHint.PrefetchDisabled
} else if (instantConfig && typeof instantConfig === 'object') { } else if (instantConfig && typeof instantConfig === 'object') {
prefetchHints |= PrefetchHint.SubtreeHasInstant prefetchHints |= PrefetchHint.SubtreeHasInstant
if (instantConfig.prefetch === 'runtime') {
prefetchHints |= PrefetchHint.HasRuntimePrefetch
} }
if (prefetchConfig === 'runtime') {
prefetchHints |= PrefetchHint.HasRuntimePrefetch
} }
// Check if this segment has a loading boundary // Check if this segment has a loading boundary
......
...@@ -16,14 +16,10 @@ export async function anySegmentHasRuntimePrefetchEnabled( ...@@ -16,14 +16,10 @@ export async function anySegmentHasRuntimePrefetchEnabled(
const { mod: layoutOrPageMod } = await getLayoutOrPageModule(tree) const { mod: layoutOrPageMod } = await getLayoutOrPageModule(tree)
// TODO(restart-on-cache-miss): Does this work correctly for client page/layout modules? // TODO(restart-on-cache-miss): Does this work correctly for client page/layout modules?
const instantConfig = layoutOrPageMod const prefetchConfig = layoutOrPageMod
? (layoutOrPageMod as AppSegmentConfig).unstable_instant ? (layoutOrPageMod as AppSegmentConfig).unstable_prefetch
: undefined : undefined
const hasRuntimePrefetch = if (prefetchConfig === 'runtime') {
instantConfig && typeof instantConfig === 'object'
? instantConfig.prefetch === 'runtime'
: false
if (hasRuntimePrefetch) {
return true return true
} }
......
...@@ -1146,10 +1146,13 @@ export async function createCombinedPayloadAtDepth( ...@@ -1146,10 +1146,13 @@ export async function createCombinedPayloadAtDepth(
: createChildSegmentPath(parentPath, key!, segment) : createChildSegmentPath(parentPath, key!, segment)
let instantConfig: Instant | null = null let instantConfig: Instant | null = null
let prefetchConfig: AppSegmentConfig['unstable_prefetch'] | null = null
let localCreateInstantStack: (() => Error) | null = null let localCreateInstantStack: (() => Error) | null = null
if (layoutOrPageMod !== undefined) { if (layoutOrPageMod !== undefined) {
instantConfig = instantConfig =
(layoutOrPageMod as AppSegmentConfig).unstable_instant ?? null (layoutOrPageMod as AppSegmentConfig).unstable_instant ?? null
prefetchConfig =
(layoutOrPageMod as AppSegmentConfig).unstable_prefetch ?? null
if (instantConfig && typeof instantConfig === 'object') { if (instantConfig && typeof instantConfig === 'object') {
const rawFactory: unknown = (layoutOrPageMod as any) const rawFactory: unknown = (layoutOrPageMod as any)
.__debugCreateInstantConfigStack .__debugCreateInstantConfigStack
...@@ -1158,14 +1161,12 @@ export async function createCombinedPayloadAtDepth( ...@@ -1158,14 +1161,12 @@ export async function createCombinedPayloadAtDepth(
} }
} }
const segmentHasRuntimePrefetch = prefetchConfig === 'runtime'
let childIsInsideRuntimePrefetch = isInsideRuntimePrefetch let childIsInsideRuntimePrefetch = isInsideRuntimePrefetch
let stage: SegmentStage let stage: SegmentStage
if (!isInsideRuntimePrefetch) { if (!isInsideRuntimePrefetch) {
if ( if (segmentHasRuntimePrefetch) {
instantConfig &&
typeof instantConfig === 'object' &&
instantConfig.prefetch === 'runtime'
) {
stage = RenderStage.Runtime stage = RenderStage.Runtime
childIsInsideRuntimePrefetch = true childIsInsideRuntimePrefetch = true
hasRuntimeSegments = true hasRuntimeSegments = true
......
...@@ -4,6 +4,7 @@ import { connection } from 'next/server' ...@@ -4,6 +4,7 @@ import { connection } from 'next/server'
import { Suspense } from 'react' import { Suspense } from 'react'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = __dirname + '/__PAGE__' const CACHE_KEY = __dirname + '/__PAGE__'
......
...@@ -3,6 +3,7 @@ import { UncachedFetch, CachedData } from '../data-fetching' ...@@ -3,6 +3,7 @@ import { UncachedFetch, CachedData } from '../data-fetching'
import { PrivateCachedData } from './data-fetching' import { PrivateCachedData } from './data-fetching'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = '/private-cache/__LAYOUT__' const CACHE_KEY = '/private-cache/__LAYOUT__'
......
...@@ -3,6 +3,7 @@ import { UncachedFetch, CachedData } from '../data-fetching' ...@@ -3,6 +3,7 @@ import { UncachedFetch, CachedData } from '../data-fetching'
import { ShortLivedCache } from './data-fetching' import { ShortLivedCache } from './data-fetching'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = __dirname + '/__LAYOUT__' const CACHE_KEY = __dirname + '/__LAYOUT__'
......
...@@ -2,6 +2,7 @@ import { Suspense } from 'react' ...@@ -2,6 +2,7 @@ import { Suspense } from 'react'
import { UncachedFetch, CachedFetch, CachedData } from '../data-fetching' import { UncachedFetch, CachedFetch, CachedData } from '../data-fetching'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = __dirname + '/__LAYOUT__' const CACHE_KEY = __dirname + '/__LAYOUT__'
......
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -3,6 +3,7 @@ import { CachedData, getCachedData } from '../../data-fetching' ...@@ -3,6 +3,7 @@ import { CachedData, getCachedData } from '../../data-fetching'
import { cookies } from 'next/headers' import { cookies } from 'next/headers'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = __dirname + '/__PAGE__' const CACHE_KEY = __dirname + '/__PAGE__'
......
import { CachedData, getCachedData } from '../../data-fetching' import { CachedData, getCachedData } from '../../data-fetching'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
const CACHE_KEY = __dirname + '/__PAGE__' const CACHE_KEY = __dirname + '/__PAGE__'
......
...@@ -2,6 +2,7 @@ import { Suspense } from 'react' ...@@ -2,6 +2,7 @@ import { Suspense } from 'react'
import { Static, Runtime, Dynamic } from '../shared' import { Static, Runtime, Dynamic } from '../shared'
export const unstable_instant = { prefetch: 'runtime', samples: [{}] } export const unstable_instant = { prefetch: 'runtime', samples: [{}] }
export const unstable_prefetch = 'runtime'
export default function Root({ children }: { children: React.ReactNode }) { export default function Root({ children }: { children: React.ReactNode }) {
return ( return (
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ searchParams: { myParam: 'testValue' } }], samples: [{ searchParams: { myParam: 'testValue' } }],
} }
export const unstable_prefetch = 'runtime'
type SearchParams = { [key: string]: string | string[] | undefined } type SearchParams = { [key: string]: string | string[] | undefined }
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -15,6 +15,7 @@ export const unstable_instant: Instant = { ...@@ -15,6 +15,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -16,6 +16,7 @@ export const unstable_instant: Instant = { ...@@ -16,6 +16,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export function generateStaticParams() { export function generateStaticParams() {
return [{ slug: 'foo' }, { slug: 'bar' }] return [{ slug: 'foo' }, { slug: 'bar' }]
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ headers: [] }], samples: [{ headers: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ headers: [] }], samples: [{ headers: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ headers: [] }], samples: [{ headers: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -15,6 +15,7 @@ export const unstable_instant: Instant = { ...@@ -15,6 +15,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'auth', value: '1' }] }], samples: [{ cookies: [{ name: 'auth', value: '1' }] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
const c = await cookies() const c = await cookies()
......
...@@ -13,6 +13,7 @@ export const unstable_instant: Instant = { ...@@ -13,6 +13,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -13,6 +13,7 @@ export const unstable_instant: Instant = { ...@@ -13,6 +13,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = { ...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -5,6 +5,7 @@ export const unstable_instant: Instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant: Instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ params: { slug: 'hello' } }], samples: [{ params: { slug: 'hello' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -5,6 +5,7 @@ export const unstable_instant: Instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant: Instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ params: { slug: 'hello' } }], samples: [{ params: { slug: 'hello' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ searchParams: { q: 'test' } }], samples: [{ searchParams: { q: 'test' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ searchParams: { q: 'test' } }], samples: [{ searchParams: { q: 'test' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = { ...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -11,6 +11,7 @@ export const unstable_instant: Instant = { ...@@ -11,6 +11,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -16,6 +16,7 @@ export const unstable_instant: Instant = { ...@@ -16,6 +16,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
type SearchParams = Record<string, string | string[]> type SearchParams = Record<string, string | string[]>
......
...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = { ...@@ -12,6 +12,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -14,6 +14,7 @@ export const unstable_instant: Instant = { ...@@ -14,6 +14,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -14,6 +14,7 @@ export const unstable_instant: Instant = { ...@@ -14,6 +14,7 @@ export const unstable_instant: Instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await cachedIO('static') await cachedIO('static')
......
...@@ -2,6 +2,7 @@ export const unstable_instant = { ...@@ -2,6 +2,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await privateCachedIO() await privateCachedIO()
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await cookies() await cookies()
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'auth', value: '1' }] }], samples: [{ cookies: [{ name: 'auth', value: '1' }] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -8,6 +8,7 @@ export const unstable_instant: Instant = { ...@@ -8,6 +8,7 @@ export const unstable_instant: Instant = {
// no samples // no samples
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
// Guard behind cookies() so that the rest of this component only runs during validation // Guard behind cookies() so that the rest of this component only runs during validation
......
...@@ -8,6 +8,7 @@ export const unstable_instant: Instant = { ...@@ -8,6 +8,7 @@ export const unstable_instant: Instant = {
// no samples // no samples
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
// Guard behind cookies() so that the rest of this component only runs during validation // Guard behind cookies() so that the rest of this component only runs during validation
......
...@@ -7,6 +7,7 @@ export const unstable_instant: Instant = { ...@@ -7,6 +7,7 @@ export const unstable_instant: Instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ params: { lang: 'en-from-samples' } }], samples: [{ params: { lang: 'en-from-samples' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
// Guard behind cookies() so that the rest of this component only runs during validation // Guard behind cookies() so that the rest of this component only runs during validation
......
...@@ -13,9 +13,7 @@ describe('app dir - instant-validation-client', () => { ...@@ -13,9 +13,7 @@ describe('app dir - instant-validation-client', () => {
} }
it('should error when a client component exports unstable_instant', async () => { it('should error when a client component exports unstable_instant', async () => {
const expectedErrMsg = process.env.IS_TURBOPACK_TEST const expectedErrMsg = `"unstable_instant" is a route segment config and can only be used when the segment is a Server Component module. Remove the "use client" directive`
? `Next.js can't recognize the exported \`unstable_instant\` field in route. App pages cannot export "unstable_instant" from a Client Component module. To use this API, convert this module to a Server Component by removing the "use client" directive.`
: `Page "/page" cannot export "unstable_instant" from a Client Component module. To use this API, convert this module to a Server Component by removing the "use client" directive.`
if (isNextDev) { if (isNextDev) {
await next.start().catch(() => {}) await next.start().catch(() => {})
......
...@@ -3,6 +3,7 @@ export const unstable_instant = { ...@@ -3,6 +3,7 @@ export const unstable_instant = {
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
unstable_disableValidation: true, unstable_disableValidation: true,
} }
export const unstable_prefetch = 'runtime'
export default function Layout({ children }) { export default function Layout({ children }) {
return <>{children}</> return <>{children}</>
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
unstable_disableValidation: true, unstable_disableValidation: true,
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await connection() await connection()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
unstable_disableValidation: true, unstable_disableValidation: true,
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await connection() await connection()
......
...@@ -7,6 +7,7 @@ export const unstable_instant = { ...@@ -7,6 +7,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
// Note that we're inside a root layout with suspense, so we skip the static shell // Note that we're inside a root layout with suspense, so we skip the static shell
export async function generateViewport(): Promise<Viewport> { export async function generateViewport(): Promise<Viewport> {
......
...@@ -2,6 +2,7 @@ export const unstable_instant = { ...@@ -2,6 +2,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Layout({ children }) { export default async function Layout({ children }) {
return <>{children}</> return <>{children}</>
......
...@@ -7,6 +7,7 @@ export const unstable_instant = { ...@@ -7,6 +7,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export async function generateMetadata(): Promise<Metadata> { export async function generateMetadata(): Promise<Metadata> {
await connection() await connection()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export async function generateViewport(): Promise<Viewport> { export async function generateViewport(): Promise<Viewport> {
await cookies() await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{}], samples: [{}],
} }
export const unstable_prefetch = 'runtime'
export default function SlotPage() { export default function SlotPage() {
return ( return (
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function RuntimeLayout({ children }) { export default async function RuntimeLayout({ children }) {
await cookies() await cookies()
......
// Avoid static shell validation -- we only want to test the validation of `prefetch: 'runtime'` here. // Avoid static shell validation -- we only want to test the validation of `prefetch: 'runtime'` here.
export const unstable_instant = false export const unstable_instant = false
export const unstable_prefetch = 'runtime'
export default function DisableStaticShell({ children }) { export default function DisableStaticShell({ children }) {
return <>{children}</> return <>{children}</>
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
// This page HAS runtime prefetch enabled. cookies() is passed as a promise // This page HAS runtime prefetch enabled. cookies() is passed as a promise
// input to a public "use cache" function. The cache doesn't read the cookies // input to a public "use cache" function. The cache doesn't read the cookies
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export async function generateMetadata() { export async function generateMetadata() {
await cookies() await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
async function Runtime() { async function Runtime() {
await cookies() await cookies()
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
// This page HAS runtime prefetch enabled. The sync IO (Date.now()) after // This page HAS runtime prefetch enabled. The sync IO (Date.now()) after
// cookies() is invalid here because during a runtime prefetch, cookies() // cookies() is invalid here because during a runtime prefetch, cookies()
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await cookies() await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Layout({ children }: { children: ReactNode }) { export default async function Layout({ children }: { children: ReactNode }) {
await connection() await connection()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await cookies() await cookies()
......
...@@ -7,6 +7,7 @@ export const unstable_instant = { ...@@ -7,6 +7,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default function InnerLayout({ children }: { children: ReactNode }) { export default function InnerLayout({ children }: { children: ReactNode }) {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
await cookies() await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function RuntimeLayout({ children }) { export default async function RuntimeLayout({ children }) {
await cookies() await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [], params: { param: '123' } }], samples: [{ cookies: [], params: { param: '123' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
params, params,
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [], searchParams: { foo: 'bar' } }], samples: [{ cookies: [], searchParams: { foo: 'bar' } }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
async function Runtime() { async function Runtime() {
await cookies() await cookies()
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'test', value: null }] }], samples: [{ cookies: [{ name: 'test', value: null }] }],
} }
export const unstable_prefetch = 'runtime'
export default function Layout({ children }: { children: ReactNode }) { export default function Layout({ children }: { children: ReactNode }) {
return <div>{children}</div> return <div>{children}</div>
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'test', value: null }] }], samples: [{ cookies: [{ name: 'test', value: null }] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -14,6 +14,7 @@ export const unstable_instant = { ...@@ -14,6 +14,7 @@ export const unstable_instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ export default async function Page({
searchParams, searchParams,
......
...@@ -15,6 +15,7 @@ export const unstable_instant = { ...@@ -15,6 +15,7 @@ export const unstable_instant = {
}, },
], ],
} }
export const unstable_prefetch = 'runtime'
async function LayoutContent({ children }: { children: ReactNode }) { async function LayoutContent({ children }: { children: ReactNode }) {
const cookieStore = await cookies() const cookieStore = await cookies()
......
...@@ -4,6 +4,7 @@ export const unstable_instant = { ...@@ -4,6 +4,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'theme', value: 'default' }] }], samples: [{ cookies: [{ name: 'theme', value: 'default' }] }],
} }
export const unstable_prefetch = 'runtime'
export default async function RuntimeBailoutPage() { export default async function RuntimeBailoutPage() {
const cookieStore = await cookies() const cookieStore = await cookies()
......
...@@ -9,6 +9,7 @@ export const unstable_instant = { ...@@ -9,6 +9,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'theme', value: 'default' }] }], samples: [{ cookies: [{ name: 'theme', value: 'default' }] }],
} }
export const unstable_prefetch = 'runtime'
async function DynamicContent() { async function DynamicContent() {
const cookieStore = await cookies() const cookieStore = await cookies()
......
...@@ -9,6 +9,7 @@ export const unstable_instant = { ...@@ -9,6 +9,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [{ name: 'theme', value: 'default' }] }], samples: [{ cookies: [{ name: 'theme', value: 'default' }] }],
} }
export const unstable_prefetch = 'runtime'
async function DynamicContent() { async function DynamicContent() {
const cookieStore = await cookies() const cookieStore = await cookies()
......
...@@ -5,6 +5,7 @@ export const unstable_instant = { ...@@ -5,6 +5,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default function Page() { export default function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Layout({ children }) { export default async function Layout({ children }) {
return ( return (
<main> <main>
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -6,6 +6,7 @@ export const unstable_instant = { ...@@ -6,6 +6,7 @@ export const unstable_instant = {
prefetch: 'runtime', prefetch: 'runtime',
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant = {
unstable_disableValidation: true, unstable_disableValidation: true,
samples: [{ cookies: [{ name: 'user-agent', value: null }] }], samples: [{ cookies: [{ name: 'user-agent', value: null }] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -9,6 +9,7 @@ export const unstable_instant = { ...@@ -9,6 +9,7 @@ export const unstable_instant = {
unstable_disableValidation: true, unstable_disableValidation: true,
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
...@@ -10,6 +10,7 @@ export const unstable_instant = { ...@@ -10,6 +10,7 @@ export const unstable_instant = {
unstable_disableValidation: true, unstable_disableValidation: true,
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page({ params }: { params: Promise<Params> }) { export default async function Page({ params }: { params: Promise<Params> }) {
return ( return (
......
...@@ -9,6 +9,7 @@ export const unstable_instant = { ...@@ -9,6 +9,7 @@ export const unstable_instant = {
unstable_disableValidation: true, unstable_disableValidation: true,
samples: [{ cookies: [] }], samples: [{ cookies: [] }],
} }
export const unstable_prefetch = 'runtime'
export default async function Page() { export default async function Page() {
return ( return (
......
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