Skip to content

Commit c5b77e7

Browse files
committed
[Segment Cache] Re-implement refresh reducer
This re-implements the refresh reducer to use the Segment Cache-style flow, similar to how the navigate reducer already works. Most of the logic can be reused from what was already implemented for navigations. The bulk of the changes are related to the case where a "default" parallel route slot is not present on the current page, and so needs to be refreshed from an older page's URL. Theoretically, this should be the last remaining case where we rely on the lazy fetching logic in LayoutRouter. I think there may still be some error cases where we still rely on that, though. Once these are all addressed, we can remove the lazy-fetching mechanism entirely.
1 parent 3676d72 commit c5b77e7

File tree

18 files changed

+738
-247
lines changed

18 files changed

+738
-247
lines changed

packages/next/src/client/components/router-reducer/create-initial-router-state.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-
88
import { extractPathFromFlightRouterState } from './compute-changed-path'
99

1010
import type { AppRouterState } from './router-reducer-types'
11-
import { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'
1211
import { getFlightDataPartsFromPath } from '../../flight-data-helpers'
1312

1413
export interface InitialRouterStateParameters {
@@ -64,8 +63,6 @@ export function createInitialRouterState({
6463
createHrefFromUrl(location)
6564
: initialCanonicalUrl
6665

67-
addRefreshMarkerToActiveParallelSegments(initialTree, canonicalUrl)
68-
6966
// When the cache hasn't been seeded yet we fill the cache with the head.
7067
if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {
7168
fillLazyItemsTillLeafWithHead(

0 commit comments

Comments
 (0)