/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
client
/
components
/
/opt/canhelp/node_modules/next/dist/esm/client/components
mkdir
upload
Name
Size
Mode
Actions
builtin/
-
0755
rm
errors/
-
0755
rm
http-access-fallback/
-
0755
rm
metadata/
-
0755
rm
router-reducer/
-
0755
rm
segment-cache-impl/
-
0755
rm
styles/
-
0755
rm
app-router-announcer.js
2757
0644
edit
dl
rm
app-router-announcer.js.map
4660
0644
edit
dl
rm
app-router-headers.js
1675
0644
edit
dl
rm
app-router-headers.js.map
3014
0644
edit
dl
rm
app-router-instance.js
13037
0644
edit
dl
rm
app-router-instance.js.map
21131
0644
edit
dl
rm
app-router.js
23067
0644
edit
dl
rm
app-router.js.map
35012
0644
edit
dl
rm
bailout-to-client-rendering.js
1236
0644
edit
dl
rm
bailout-to-client-rendering.js.map
1706
0644
edit
dl
rm
bfcache.js
4568
0644
edit
dl
rm
bfcache.js.map
6394
0644
edit
dl
rm
client-page.js
2519
0644
edit
dl
rm
client-page.js.map
3919
0644
edit
dl
rm
client-segment.js
2106
0644
edit
dl
rm
client-segment.js.map
3099
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js
901
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js.map
1292
0644
edit
dl
rm
error-boundary.js
4730
0644
edit
dl
rm
error-boundary.js.map
7454
0644
edit
dl
rm
forbidden.js
1543
0644
edit
dl
rm
forbidden.js.map
1988
0644
edit
dl
rm
handle-isr-error.js
709
0644
edit
dl
rm
handle-isr-error.js.map
1316
0644
edit
dl
rm
hooks-server-context.js
534
0644
edit
dl
rm
hooks-server-context.js.map
1133
0644
edit
dl
rm
is-next-router-error.js
481
0644
edit
dl
rm
is-next-router-error.js.map
922
0644
edit
dl
rm
layout-router.js
26406
0644
edit
dl
rm
layout-router.js.map
37850
0644
edit
dl
rm
links.js
12533
0644
edit
dl
rm
links.js.map
21060
0644
edit
dl
rm
match-segments.js
524
0644
edit
dl
rm
match-segments.js.map
1034
0644
edit
dl
rm
nav-failure-handler.js
1614
0644
edit
dl
rm
nav-failure-handler.js.map
2827
0644
edit
dl
rm
navigation-untracked.js
2397
0644
edit
dl
rm
navigation-untracked.js.map
3374
0644
edit
dl
rm
navigation.js
9118
0644
edit
dl
rm
navigation.js.map
12807
0644
edit
dl
rm
navigation.react-server.js
1944
0644
edit
dl
rm
navigation.react-server.js.map
2768
0644
edit
dl
rm
noop-head.js
94
0644
edit
dl
rm
noop-head.js.map
233
0644
edit
dl
rm
not-found.js
1356
0644
edit
dl
rm
not-found.js.map
1752
0644
edit
dl
rm
promise-queue.js
3712
0644
edit
dl
rm
promise-queue.js.map
3591
0644
edit
dl
rm
redirect-boundary.js
2222
0644
edit
dl
rm
redirect-boundary.js.map
3940
0644
edit
dl
rm
redirect-error.js
1123
0644
edit
dl
rm
redirect-error.js.map
2103
0644
edit
dl
rm
redirect-status-code.js
425
0644
edit
dl
rm
redirect-status-code.js.map
319
0644
edit
dl
rm
redirect.js
3822
0644
edit
dl
rm
redirect.js.map
5837
0644
edit
dl
rm
render-from-template-context.js
456
0644
edit
dl
rm
render-from-template-context.js.map
667
0644
edit
dl
rm
segment-cache.js
6004
0644
edit
dl
rm
segment-cache.js.map
8823
0644
edit
dl
rm
static-generation-bailout.js
466
0644
edit
dl
rm
static-generation-bailout.js.map
877
0644
edit
dl
rm
unauthorized.js
1570
0644
edit
dl
rm
unauthorized.js.map
2020
0644
edit
dl
rm
unrecognized-action-error.js
923
0644
edit
dl
rm
unrecognized-action-error.js.map
1478
0644
edit
dl
rm
unresolved-thenable.js
227
0644
edit
dl
rm
unresolved-thenable.js.map
441
0644
edit
dl
rm
unstable-rethrow.browser.js
433
0644
edit
dl
rm
unstable-rethrow.browser.js.map
841
0644
edit
dl
rm
unstable-rethrow.js
712
0644
edit
dl
rm
unstable-rethrow.js.map
1112
0644
edit
dl
rm
unstable-rethrow.server.js
854
0644
edit
dl
rm
unstable-rethrow.server.js.map
1566
0644
edit
dl
rm
use-action-queue.js
1921
0644
edit
dl
rm
use-action-queue.js.map
3273
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/client/components/bfcache.js.map
(6394B)
{"version":3,"sources":["../../../src/client/components/bfcache.ts"],"sourcesContent":["import type { FlightRouterState } from '../../server/app-render/types'\nimport { useState } from 'react'\n\n// When the flag is disabled, only track the currently active tree\nconst MAX_BF_CACHE_ENTRIES = process.env.__NEXT_ROUTER_BF_CACHE ? 3 : 1\n\nexport type RouterBFCacheEntry = {\n tree: FlightRouterState\n stateKey: string\n // The entries form a linked list, sorted in order of most recently active.\n next: RouterBFCacheEntry | null\n}\n\n/**\n * Keeps track of the most recent N trees (FlightRouterStates) that were active\n * at a certain segment level. E.g. for a segment \"/a/b/[param]\", this hook\n * tracks the last N param values that the router rendered for N.\n *\n * The result of this hook precisely determines the number and order of\n * trees that are rendered in parallel at their segment level.\n *\n * The purpose of this cache is to we can preserve the React and DOM state of\n * some number of inactive trees, by rendering them in an <Activity> boundary.\n * That means it would not make sense for the the lifetime of the cache to be\n * any longer than the lifetime of the React tree; e.g. if the hook were\n * unmounted, then the React tree would be, too. So, we use React state to\n * manage it.\n *\n * Note that we don't store the RSC data for the cache entries in this hook —\n * the data for inactive segments is stored in the parent CacheNode, which\n * *does* have a longer lifetime than the React tree. This hook only determines\n * which of those trees should have their *state* preserved, by <Activity>.\n */\nexport function useRouterBFCache(\n activeTree: FlightRouterState,\n activeStateKey: string\n): RouterBFCacheEntry {\n // The currently active entry. The entries form a linked list, sorted in\n // order of most recently active. This allows us to reuse parts of the list\n // without cloning, unless there's a reordering or removal.\n // TODO: Once we start tracking back/forward history at each route level,\n // we should use the history order instead. In other words, when traversing\n // to an existing entry as a result of a popstate event, we should maintain\n // the existing order instead of moving it to the front of the list. I think\n // an initial implementation of this could be to pass an incrementing id\n // to history.pushState/replaceState, then use that here for ordering.\n const [prevActiveEntry, setPrevActiveEntry] = useState<RouterBFCacheEntry>(\n () => {\n const initialEntry: RouterBFCacheEntry = {\n tree: activeTree,\n stateKey: activeStateKey,\n next: null,\n }\n return initialEntry\n }\n )\n\n if (prevActiveEntry.tree === activeTree) {\n // Fast path. The active tree hasn't changed, so we can reuse the\n // existing state.\n return prevActiveEntry\n }\n\n // The route tree changed. Note that this doesn't mean that the tree changed\n // *at this level* — the change may be due to a child route. Either way, we\n // need to either add or update the router tree in the bfcache.\n //\n // The rest of the code looks more complicated than it actually is because we\n // can't mutate the state in place; we have to copy-on-write.\n\n // Create a new entry for the active cache key. This is the head of the new\n // linked list.\n const newActiveEntry: RouterBFCacheEntry = {\n tree: activeTree,\n stateKey: activeStateKey,\n next: null,\n }\n\n // We need to append the old list onto the new list. If the head of the new\n // list was already present in the cache, then we'll need to clone everything\n // that came before it. Then we can reuse the rest.\n let n = 1\n let oldEntry: RouterBFCacheEntry | null = prevActiveEntry\n let clonedEntry: RouterBFCacheEntry = newActiveEntry\n while (oldEntry !== null && n < MAX_BF_CACHE_ENTRIES) {\n if (oldEntry.stateKey === activeStateKey) {\n // Fast path. This entry in the old list that corresponds to the key that\n // is now active. We've already placed a clone of this entry at the front\n // of the new list. We can reuse the rest of the old list without cloning.\n // NOTE: We don't need to worry about eviction in this case because we\n // haven't increased the size of the cache, and we assume the max size\n // is constant across renders. If we were to change it to a dynamic limit,\n // then the implementation would need to account for that.\n clonedEntry.next = oldEntry.next\n break\n } else {\n // Clone the entry and append it to the list.\n n++\n const entry: RouterBFCacheEntry = {\n tree: oldEntry.tree,\n stateKey: oldEntry.stateKey,\n next: null,\n }\n clonedEntry.next = entry\n clonedEntry = entry\n }\n oldEntry = oldEntry.next\n }\n\n setPrevActiveEntry(newActiveEntry)\n return newActiveEntry\n}\n"],"names":["useState","MAX_BF_CACHE_ENTRIES","process","env","__NEXT_ROUTER_BF_CACHE","useRouterBFCache","activeTree","activeStateKey","prevActiveEntry","setPrevActiveEntry","initialEntry","tree","stateKey","next","newActiveEntry","n","oldEntry","clonedEntry","entry"],"mappings":"AACA,SAASA,QAAQ,QAAQ,QAAO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