From b4e69b86fba38403d47fec91c965c845bf048c17 Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:35:34 -0700 Subject: [PATCH] isPrerender -> prerendered --- packages/next/src/client/app-index.tsx | 2 +- .../router-reducer/create-initial-router-state.test.tsx | 4 ++-- .../router-reducer/create-initial-router-state.ts | 8 ++++---- .../components/router-reducer/fetch-server-response.ts | 8 ++++---- .../components/router-reducer/prefetch-cache-utils.ts | 2 +- .../router-reducer/reducers/server-action-reducer.ts | 2 +- packages/next/src/server/app-render/app-render.tsx | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index 2e0e3dfa94ffc..bd5f0a789174b 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -160,7 +160,7 @@ const pendingActionQueue: Promise = new Promise( location: window.location, couldBeIntercepted: initialRSCPayload.i, postponed: initialRSCPayload.s, - isPrerender: initialRSCPayload.S, + prerendered: initialRSCPayload.S, }) ) ) diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx index a2ca47e6a4c7b..ef97ec9afb952 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx @@ -43,7 +43,7 @@ describe('createInitialRouterState', () => { location: new URL('/linking', 'https://localhost') as any, couldBeIntercepted: false, postponed: false, - isPrerender: false, + prerendered: false, }) const state2 = createInitialRouterState({ @@ -56,7 +56,7 @@ describe('createInitialRouterState', () => { location: new URL('/linking', 'https://localhost') as any, couldBeIntercepted: false, postponed: false, - isPrerender: false, + prerendered: false, }) const expectedCache: CacheNode = { diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts index a6c8191dfb602..0ffc3d7fc33ef 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts @@ -17,7 +17,7 @@ export interface InitialRouterStateParameters { location: Location | null couldBeIntercepted: boolean postponed: boolean - isPrerender: boolean + prerendered: boolean } export function createInitialRouterState({ @@ -28,7 +28,7 @@ export function createInitialRouterState({ location, couldBeIntercepted, postponed, - isPrerender, + prerendered, }: InitialRouterStateParameters) { // When initialized on the server, the canonical URL is provided as an array of parts. // This is to ensure that when the RSC payload streamed to the client, crawlers don't interpret it @@ -120,13 +120,13 @@ export function createInitialRouterState({ flightData: [normalizedFlightData], canonicalUrl: undefined, couldBeIntercepted: !!couldBeIntercepted, - isPrerender, + prerendered, postponed, }, tree: initialState.tree, prefetchCache: initialState.prefetchCache, nextUrl: initialState.nextUrl, - kind: isPrerender ? PrefetchKind.FULL : PrefetchKind.AUTO, + kind: prerendered ? PrefetchKind.FULL : PrefetchKind.AUTO, }) } diff --git a/packages/next/src/client/components/router-reducer/fetch-server-response.ts b/packages/next/src/client/components/router-reducer/fetch-server-response.ts index 0252f07cb9a5d..4fa93362a23ee 100644 --- a/packages/next/src/client/components/router-reducer/fetch-server-response.ts +++ b/packages/next/src/client/components/router-reducer/fetch-server-response.ts @@ -45,7 +45,7 @@ export type FetchServerResponseResult = { flightData: NormalizedFlightData[] | string canonicalUrl: URL | undefined couldBeIntercepted: boolean - isPrerender: boolean + prerendered: boolean postponed: boolean } @@ -71,7 +71,7 @@ function doMpaNavigation(url: string): FetchServerResponseResult { flightData: urlToUrlWithoutFlightMarker(url).toString(), canonicalUrl: undefined, couldBeIntercepted: false, - isPrerender: false, + prerendered: false, postponed: false, } } @@ -221,7 +221,7 @@ export async function fetchServerResponse( flightData: normalizeFlightData(response.f), canonicalUrl: canonicalUrl, couldBeIntercepted: interception, - isPrerender: response.S, + prerendered: response.S, postponed, } } catch (err) { @@ -236,7 +236,7 @@ export async function fetchServerResponse( flightData: url.toString(), canonicalUrl: undefined, couldBeIntercepted: false, - isPrerender: false, + prerendered: false, postponed: false, } } diff --git a/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts b/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts index 621b74dc6db4f..9e353cfc23ed5 100644 --- a/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts +++ b/packages/next/src/client/components/router-reducer/prefetch-cache-utils.ts @@ -353,7 +353,7 @@ function createLazyPrefetchEntry({ // If the prefetch was a cache hit, we want to update the existing cache entry to reflect that it was a full prefetch. // This is because we know that a static response will contain the full RSC payload, and can be updated to respect the `static` // staleTime. - if (prefetchResponse.isPrerender) { + if (prefetchResponse.prerendered) { const existingCacheEntry = prefetchCache.get( // if we prefixed the cache key due to route interception, we want to use the new key. Otherwise we use the original key newCacheKey ?? prefetchCacheKey diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index fd1f0846085c7..5d599c49c6265 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -265,7 +265,7 @@ export function serverActionReducer( flightData, canonicalUrl: undefined, couldBeIntercepted: false, - isPrerender: false, + prerendered: false, postponed: false, }, tree: state.tree, diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 2c4fd28d20b4d..7b4f969702dc9 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -770,7 +770,7 @@ function App({ location: null, couldBeIntercepted: response.i, postponed: response.s, - isPrerender: response.S, + prerendered: response.S, }) const actionQueue = createMutableActionQueue(initialState) @@ -829,7 +829,7 @@ function AppWithoutContext({ location: null, couldBeIntercepted: response.i, postponed: response.s, - isPrerender: response.S, + prerendered: response.S, }) const actionQueue = createMutableActionQueue(initialState)