/opt/canhelp/node_modules/next/dist/client/components/segment-cache-impl
NameSizeModeActions
cache-key.d.ts5090644editdlrm
cache-key.js8770644editdlrm
cache-key.js.map14070644editdlrm
cache.d.ts92220644editdlrm
cache.js757180644editdlrm
cache.js.map1189340644editdlrm
lru.d.ts3490644editdlrm
lru.js40920644editdlrm
lru.js.map61180644editdlrm
navigation.d.ts16140644editdlrm
navigation.js178550644editdlrm
navigation.js.map286640644editdlrm
prefetch.d.ts16380644editdlrm
prefetch.js11990644editdlrm
prefetch.js.map28400644editdlrm
scheduler.d.ts55640644editdlrm
scheduler.js469350644editdlrm
scheduler.js.map736450644editdlrm
tuple-map.d.ts8580644editdlrm
tuple-map.js55220644editdlrm
tuple-map.js.map85030644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/client/components/segment-cache-impl/navigation.js.map (28664B)
{"version":3,"sources":["../../../../src/client/components/segment-cache-impl/navigation.ts"],"sourcesContent":["import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../server/app-render/types'\nimport type {\n CacheNode,\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-context.shared-runtime'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n listenForDynamicRequest,\n type Task as PPRNavigationTask,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl as createCanonicalUrl } from '../router-reducer/create-href-from-url'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n readSegmentCacheEntry,\n waitForSegmentCacheEntry,\n requestOptimisticRouteCacheEntry,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { createCacheKey } from './cache-key'\nimport { addSearchParamsIfPageSegment } from '../../../shared/lib/segment'\nimport { NavigationResultTag } from '../segment-cache'\n\ntype MPANavigationResult = {\n tag: NavigationResultTag.MPA\n data: string\n}\n\ntype NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp\n data: {\n canonicalUrl: string\n shouldScroll: boolean\n }\n}\n\ntype SuccessfulNavigationResult = {\n tag: NavigationResultTag.Success\n data: {\n flightRouterState: FlightRouterState\n cacheNode: CacheNode\n canonicalUrl: string\n scrollableSegments: Array\n shouldScroll: boolean\n hash: string\n }\n}\n\ntype AsyncNavigationResult = {\n tag: NavigationResultTag.Async\n data: Promise<\n MPANavigationResult | NoOpNavigationResult | SuccessfulNavigationResult\n >\n}\n\nexport type NavigationResult =\n | MPANavigationResult\n | SuccessfulNavigationResult\n | NoOpNavigationResult\n | AsyncNavigationResult\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n url: URL,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n shouldScroll: boolean\n): NavigationResult {\n const now = Date.now()\n const href = url.href\n\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation =\n // TODO: This is not the only place we read from the location, but we should\n // consider storing the current URL in the router state instead of reading\n // from the location object. In practice I don't think this matters much\n // since we keep them in sync anyway, but having two sources of truth can\n // lead to subtle bugs and race conditions.\n href === window.location.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n const snapshot = readRenderSnapshotFromCache(now, route, route.tree)\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = route.head\n const isPrefetchHeadPartial = route.isHeadPartial\n const newCanonicalUrl = route.canonicalUrl\n return navigateUsingPrefetchedRouteTree(\n now,\n url,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n newCanonicalUrl,\n shouldScroll,\n url.hash\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree.\n const optimisticRoute = requestOptimisticRouteCacheEntry(now, url, nextUrl)\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n const snapshot = readRenderSnapshotFromCache(\n now,\n optimisticRoute,\n optimisticRoute.tree\n )\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = optimisticRoute.head\n const isPrefetchHeadPartial = optimisticRoute.isHeadPartial\n const newCanonicalUrl = optimisticRoute.canonicalUrl\n return navigateUsingPrefetchedRouteTree(\n now,\n url,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n newCanonicalUrl,\n shouldScroll,\n url.hash\n )\n }\n\n // There's no matching prefetch for this route in the cache.\n return {\n tag: NavigationResultTag.Async,\n data: navigateDynamicallyWithNoPrefetch(\n now,\n url,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n shouldScroll,\n url.hash\n ),\n }\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n url: URL,\n nextUrl: string | null,\n isSamePageNavigation: boolean,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n prefetchFlightRouterState: FlightRouterState,\n prefetchSeedData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n canonicalUrl: string,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | NoOpNavigationResult | MPANavigationResult {\n // Recursively construct a prefetch tree by reading from the Segment Cache. To\n // maintain compatibility, we output the same data structures as the old\n // prefetching implementation: FlightRouterState and CacheNodeSeedData.\n // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should\n // read from the Segment Cache directly. It's only structured this way for now\n // so we can share code with the old prefetching implementation.\n const scrollableSegments: Array = []\n const task = startPPRNavigation(\n now,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n scrollableSegments\n )\n if (task !== null) {\n const dynamicRequestTree = task.dynamicRequestTree\n if (dynamicRequestTree !== null) {\n const promiseForDynamicServerResponse = fetchServerResponse(\n new URL(canonicalUrl, url.origin),\n {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n }\n )\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl,\n shouldScroll,\n },\n }\n}\n\nfunction navigationTaskToResult(\n task: PPRNavigationTask,\n currentCacheNode: CacheNode,\n canonicalUrl: string,\n scrollableSegments: Array,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | MPANavigationResult {\n const flightRouterState = task.route\n if (flightRouterState === null) {\n // When no router state is provided, it signals that we should perform an\n // MPA navigation.\n return {\n tag: NavigationResultTag.MPA,\n data: canonicalUrl,\n }\n }\n const newCacheNode = task.node\n return {\n tag: NavigationResultTag.Success,\n data: {\n flightRouterState,\n cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash,\n },\n }\n}\n\nfunction readRenderSnapshotFromCache(\n now: number,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree\n): { flightRouterState: FlightRouterState; seedData: CacheNodeSeedData } {\n let childRouterStates: { [parallelRouteKey: string]: FlightRouterState } = {}\n let childSeedDatas: {\n [parallelRouteKey: string]: CacheNodeSeedData | null\n } = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n const childResult = readRenderSnapshotFromCache(now, route, childTree)\n childRouterStates[parallelRouteKey] = childResult.flightRouterState\n childSeedDatas[parallelRouteKey] = childResult.seedData\n }\n }\n\n let rsc: React.ReactNode | null = null\n let loading: LoadingModuleData | Promise = null\n let isPartial: boolean = true\n\n const segmentEntry = readSegmentCacheEntry(now, route, tree.cacheKey)\n if (segmentEntry !== null) {\n switch (segmentEntry.status) {\n case EntryStatus.Fulfilled: {\n // Happy path: a cache hit\n rsc = segmentEntry.rsc\n loading = segmentEntry.loading\n isPartial = segmentEntry.isPartial\n break\n }\n case EntryStatus.Pending: {\n // We haven't received data for this segment yet, but there's already\n // an in-progress request. Since it's extremely likely to arrive\n // before the dynamic data response, we might as well use it.\n const promiseForFulfilledEntry = waitForSegmentCacheEntry(segmentEntry)\n rsc = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.rsc : null\n )\n loading = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.loading : null\n )\n // Since we don't know yet whether the segment is partial or fully\n // static, we must assume it's partial; we can't skip the\n // dynamic request.\n isPartial = true\n break\n }\n case EntryStatus.Empty:\n case EntryStatus.Rejected:\n break\n default:\n segmentEntry satisfies never\n }\n }\n\n // The navigation implementation expects the search params to be\n // included in the segment. However, the Segment Cache tracks search\n // params separately from the rest of the segment key. So we need to\n // add them back here.\n //\n // See corresponding comment in convertFlightRouterStateToTree.\n //\n // TODO: What we should do instead is update the navigation diffing\n // logic to compare search params explicitly. This is a temporary\n // solution until more of the Segment Cache implementation has settled.\n const segment = addSearchParamsIfPageSegment(\n tree.segment,\n Object.fromEntries(new URLSearchParams(route.renderedSearch))\n )\n\n return {\n flightRouterState: [\n segment,\n childRouterStates,\n null,\n null,\n tree.isRootLayout,\n ],\n seedData: [segment, rsc, childSeedDatas, loading, isPartial],\n }\n}\n\nasync function navigateDynamicallyWithNoPrefetch(\n now: number,\n url: URL,\n nextUrl: string | null,\n isSamePageNavigation: boolean,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n shouldScroll: boolean,\n hash: string\n): Promise<\n MPANavigationResult | SuccessfulNavigationResult | NoOpNavigationResult\n> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n const { flightData, canonicalUrl: canonicalUrlOverride } =\n await promiseForDynamicServerResponse\n\n if (typeof flightData === 'string') {\n // This is an MPA navigation.\n const newUrl = flightData\n return {\n tag: NavigationResultTag.MPA,\n data: newUrl,\n }\n }\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(\n currentFlightRouterState,\n flightData\n )\n\n // In our simulated prefetch payload, we pretend that there's no seed data\n // nor a prefetch head.\n const prefetchSeedData = null\n const prefetchHead = null\n const isPrefetchHeadPartial = true\n\n const canonicalUrl = createCanonicalUrl(\n canonicalUrlOverride ? canonicalUrlOverride : url\n )\n\n // Now we proceed exactly as we would for normal navigation.\n const scrollableSegments: Array = []\n const task = startPPRNavigation(\n now,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n scrollableSegments\n )\n if (task !== null) {\n // In this case, we've already sent the dynamic request, so we don't\n // actually use the request tree created by `startPPRNavigation`,\n // except to check if it contains dynamic holes.\n //\n // This is almost always true, but it could be false if all the segment data\n // was present in the cache, but the route tree was not. E.g. navigating\n // to a URL that was not prefetched but rewrites to a different URL\n // that was.\n const hasDynamicHoles = task.dynamicRequestTree !== null\n if (hasDynamicHoles) {\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We don't need to process the server response further.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl,\n shouldScroll,\n },\n }\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatch(\n currentTree: FlightRouterState,\n flightData: Array\n): FlightRouterState {\n // Takes the current FlightRouterState and applies the router state patch\n // received from the server, to create a full FlightRouterState tree that we\n // can pretend was returned by a prefetch.\n //\n // (It sounds similar to what applyRouterStatePatch does, but it doesn't need\n // to handle stuff like interception routes or diffing since that will be\n // handled later.)\n let baseTree = currentTree\n for (const { segmentPath, tree: treePatch } of flightData) {\n // If the server sends us multiple tree patches, we only need to clone the\n // base tree when applying the first patch. After the first patch, we can\n // apply the remaining patches in place without copying.\n const canMutateInPlace = baseTree !== currentTree\n baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseTree,\n treePatch,\n segmentPath,\n canMutateInPlace,\n 0\n )\n }\n\n return baseTree\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseRouterState: FlightRouterState,\n patch: FlightRouterState,\n segmentPath: FlightSegmentPath,\n canMutateInPlace: boolean,\n index: number\n) {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return patch\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: In the case of a fully dynamic request with no prefetch, we receive\n // the FlightRouterState patch in the same request as the dynamic data.\n // Therefore we don't need to worry about diffing the segment values; we can\n // assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseChildren = baseRouterState[1]\n const newChildren: { [parallelRouteKey: string]: FlightRouterState } = {}\n for (const parallelRouteKey in baseChildren) {\n if (parallelRouteKey === updatedParallelRouteKey) {\n const childBaseRouterState = baseChildren[parallelRouteKey]\n newChildren[parallelRouteKey] =\n simulatePrefetchTreeUsingDynamicTreePatchImpl(\n childBaseRouterState,\n patch,\n segmentPath,\n canMutateInPlace,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n } else {\n // This child is not being patched. Copy it over as-is.\n newChildren[parallelRouteKey] = baseChildren[parallelRouteKey]\n }\n }\n\n if (canMutateInPlace) {\n // We can mutate the base tree in place, because the base tree is already\n // a clone.\n baseRouterState[1] = newChildren\n return baseRouterState\n }\n\n // Clone all the fields except the children.\n //\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n"],"names":["navigate","url","currentCacheNode","currentFlightRouterState","nextUrl","shouldScroll","now","Date","href","isSamePageNavigation","window","location","cacheKey","createCacheKey","route","readRouteCacheEntry","status","EntryStatus","Fulfilled","snapshot","readRenderSnapshotFromCache","tree","prefetchFlightRouterState","flightRouterState","prefetchSeedData","seedData","prefetchHead","head","isPrefetchHeadPartial","isHeadPartial","newCanonicalUrl","canonicalUrl","navigateUsingPrefetchedRouteTree","hash","optimisticRoute","requestOptimisticRouteCacheEntry","tag","NavigationResultTag","Async","data","navigateDynamicallyWithNoPrefetch","scrollableSegments","task","startPPRNavigation","dynamicRequestTree","promiseForDynamicServerResponse","fetchServerResponse","URL","origin","listenForDynamicRequest","navigationTaskToResult","NoOp","MPA","newCacheNode","node","Success","cacheNode","childRouterStates","childSeedDatas","slots","parallelRouteKey","childTree","childResult","rsc","loading","isPartial","segmentEntry","readSegmentCacheEntry","Pending","promiseForFulfilledEntry","waitForSegmentCacheEntry","then","entry","Empty","Rejected","segment","addSearchParamsIfPageSegment","Object","fromEntries","URLSearchParams","renderedSearch","isRootLayout","flightData","canonicalUrlOverride","newUrl","simulatePrefetchTreeUsingDynamicTreePatch","createCanonicalUrl","hasDynamicHoles","currentTree","baseTree","segmentPath","treePatch","canMutateInPlace","simulatePrefetchTreeUsingDynamicTreePatchImpl","baseRouterState","patch","index","length","updatedParallelRouteKey","baseChildren","newChildren","childBaseRouterState","clone"],"mappings":";;;;+BA6EgBA;;;eAAAA;;;qCAlEoB;gCAK7B;mCACiD;uBASjD;0BACwB;yBACc;8BACT;AAgD7B,SAASA,SACdC,GAAQ,EACRC,gBAA2B,EAC3BC,wBAA2C,EAC3CC,OAAsB,EACtBC,YAAqB;IAErB,MAAMC,MAAMC,KAAKD,GAAG;IACpB,MAAME,OAAOP,IAAIO,IAAI;IAErB,6EAA6E;IAC7E,4EAA4E;IAC5E,8EAA8E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