Unverified Commit 7d8a923f authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

chore: remove unused helper (#62701)

This code is removed in #62585 , remove it and related imports

Closes NEXT-2652
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent c77454a0
...@@ -4,10 +4,8 @@ import type { ...@@ -4,10 +4,8 @@ import type {
FlightSegmentPath, FlightSegmentPath,
} from '../../../../server/app-render/types' } from '../../../../server/app-render/types'
import { fetchServerResponse } from '../fetch-server-response' import { fetchServerResponse } from '../fetch-server-response'
import type { FetchServerResponseResult } from '../fetch-server-response'
import { createHrefFromUrl } from '../create-href-from-url' import { createHrefFromUrl } from '../create-href-from-url'
import { invalidateCacheBelowFlightSegmentPath } from '../invalidate-cache-below-flight-segmentpath' import { invalidateCacheBelowFlightSegmentPath } from '../invalidate-cache-below-flight-segmentpath'
import { fillCacheWithDataProperty } from '../fill-cache-with-data-property'
import { applyRouterStatePatchToTreeSkipDefault } from '../apply-router-state-patch-to-tree' import { applyRouterStatePatchToTreeSkipDefault } from '../apply-router-state-patch-to-tree'
import { shouldHardNavigate } from '../should-hard-navigate' import { shouldHardNavigate } from '../should-hard-navigate'
import { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout' import { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout'
...@@ -72,33 +70,6 @@ function generateSegmentsFromPatch( ...@@ -72,33 +70,6 @@ function generateSegmentsFromPatch(
return segments return segments
} }
// TODO: if it's not being used, remove it later
export function addRefetchToLeafSegments(
newCache: CacheNode,
currentCache: CacheNode,
flightSegmentPath: FlightSegmentPath,
treePatch: FlightRouterState,
data: () => Promise<FetchServerResponseResult>
) {
let appliedPatch = false
newCache.rsc = currentCache.rsc
newCache.prefetchRsc = currentCache.prefetchRsc
newCache.parallelRoutes = new Map(currentCache.parallelRoutes)
const segmentPathsToFill = generateSegmentsFromPatch(treePatch).map(
(segment) => [...flightSegmentPath, ...segment]
)
for (const segmentPaths of segmentPathsToFill) {
fillCacheWithDataProperty(newCache, currentCache, segmentPaths, data)
appliedPatch = true
}
return appliedPatch
}
// These implementations are expected to diverge significantly, so I've forked // These implementations are expected to diverge significantly, so I've forked
// the entire function. The one that's disabled should be dead code eliminated // the entire function. The one that's disabled should be dead code eliminated
// because the check here is statically inlined at build time. // because the check here is statically inlined at build time.
......
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