/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
client
/
components
/
/opt/canhelp/node_modules/next/dist/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.d.ts
196
0644
edit
dl
rm
app-router-announcer.js
3352
0644
edit
dl
rm
app-router-announcer.js.map
4678
0644
edit
dl
rm
app-router-headers.d.ts
1243
0644
edit
dl
rm
app-router-headers.js
3797
0644
edit
dl
rm
app-router-headers.js.map
3110
0644
edit
dl
rm
app-router-instance.d.ts
2081
0644
edit
dl
rm
app-router-instance.js
14432
0644
edit
dl
rm
app-router-instance.js.map
21179
0644
edit
dl
rm
app-router.d.ts
932
0644
edit
dl
rm
app-router.js
24987
0644
edit
dl
rm
app-router.js.map
34863
0644
edit
dl
rm
bailout-to-client-rendering.d.ts
80
0644
edit
dl
rm
bailout-to-client-rendering.js
1877
0644
edit
dl
rm
bailout-to-client-rendering.js.map
1665
0644
edit
dl
rm
bfcache.d.ts
1397
0644
edit
dl
rm
bfcache.js
4035
0644
edit
dl
rm
bfcache.js.map
6376
0644
edit
dl
rm
client-page.d.ts
876
0644
edit
dl
rm
client-page.js
2603
0644
edit
dl
rm
client-page.js.map
3907
0644
edit
dl
rm
client-segment.d.ts
842
0644
edit
dl
rm
client-segment.js
2192
0644
edit
dl
rm
client-segment.js.map
3087
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.d.ts
230
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js
1862
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js.map
1290
0644
edit
dl
rm
error-boundary.d.ts
1566
0644
edit
dl
rm
error-boundary.js
5499
0644
edit
dl
rm
error-boundary.js.map
7409
0644
edit
dl
rm
forbidden.d.ts
44
0644
edit
dl
rm
forbidden.js
2077
0644
edit
dl
rm
forbidden.js.map
1986
0644
edit
dl
rm
handle-isr-error.d.ts
78
0644
edit
dl
rm
handle-isr-error.js
1085
0644
edit
dl
rm
handle-isr-error.js.map
1295
0644
edit
dl
rm
hooks-server-context.d.ts
326
0644
edit
dl
rm
hooks-server-context.js
1352
0644
edit
dl
rm
hooks-server-context.js.map
1182
0644
edit
dl
rm
is-next-router-error.d.ts
431
0644
edit
dl
rm
is-next-router-error.js
886
0644
edit
dl
rm
is-next-router-error.js.map
899
0644
edit
dl
rm
layout-router.d.ts
999
0644
edit
dl
rm
layout-router.js
27947
0644
edit
dl
rm
layout-router.js.map
37701
0644
edit
dl
rm
links.d.ts
2241
0644
edit
dl
rm
links.js
14053
0644
edit
dl
rm
links.js.map
21056
0644
edit
dl
rm
match-segments.d.ts
154
0644
edit
dl
rm
match-segments.js
1054
0644
edit
dl
rm
match-segments.js.map
1045
0644
edit
dl
rm
nav-failure-handler.d.ts
123
0644
edit
dl
rm
nav-failure-handler.js
2492
0644
edit
dl
rm
nav-failure-handler.js.map
2868
0644
edit
dl
rm
navigation-untracked.d.ts
11
0644
edit
dl
rm
navigation-untracked.js
2607
0644
edit
dl
rm
navigation-untracked.js.map
3349
0644
edit
dl
rm
navigation.d.ts
4635
0644
edit
dl
rm
navigation.js
7942
0644
edit
dl
rm
navigation.js.map
12713
0644
edit
dl
rm
navigation.react-server.d.ts
1238
0644
edit
dl
rm
navigation.react-server.js
3501
0644
edit
dl
rm
navigation.react-server.js.map
2838
0644
edit
dl
rm
noop-head.d.ts
42
0644
edit
dl
rm
noop-head.js
607
0644
edit
dl
rm
noop-head.js.map
249
0644
edit
dl
rm
not-found.d.ts
43
0644
edit
dl
rm
not-found.js
1888
0644
edit
dl
rm
not-found.js.map
1750
0644
edit
dl
rm
promise-queue.d.ts
192
0644
edit
dl
rm
promise-queue.js
4274
0644
edit
dl
rm
promise-queue.js.map
3607
0644
edit
dl
rm
redirect-boundary.d.ts
776
0644
edit
dl
rm
redirect-boundary.js
3270
0644
edit
dl
rm
redirect-boundary.js.map
3975
0644
edit
dl
rm
redirect-error.d.ts
633
0644
edit
dl
rm
redirect-error.js
1819
0644
edit
dl
rm
redirect-error.js.map
2124
0644
edit
dl
rm
redirect-status-code.d.ts
120
0644
edit
dl
rm
redirect-status-code.js
967
0644
edit
dl
rm
redirect-status-code.js.map
330
0644
edit
dl
rm
redirect.d.ts
2469
0644
edit
dl
rm
redirect.js
3746
0644
edit
dl
rm
redirect.js.map
5919
0644
edit
dl
rm
render-from-template-context.d.ts
100
0644
edit
dl
rm
render-from-template-context.js
1170
0644
edit
dl
rm
render-from-template-context.js.map
645
0644
edit
dl
rm
segment-cache.d.ts
3498
0644
edit
dl
rm
segment-cache.js
7611
0644
edit
dl
rm
segment-cache.js.map
8946
0644
edit
dl
rm
static-generation-bailout.d.ts
205
0644
edit
dl
rm
static-generation-bailout.js
1302
0644
edit
dl
rm
static-generation-bailout.js.map
926
0644
edit
dl
rm
unauthorized.d.ts
47
0644
edit
dl
rm
unauthorized.js
2110
0644
edit
dl
rm
unauthorized.js.map
2018
0644
edit
dl
rm
unrecognized-action-error.d.ts
790
0644
edit
dl
rm
unrecognized-action-error.js
1244
0644
edit
dl
rm
unrecognized-action-error.js.map
1502
0644
edit
dl
rm
unresolved-thenable.d.ts
183
0644
edit
dl
rm
unresolved-thenable.js
769
0644
edit
dl
rm
unresolved-thenable.js.map
450
0644
edit
dl
rm
unstable-rethrow.browser.d.ts
64
0644
edit
dl
rm
unstable-rethrow.browser.js
1011
0644
edit
dl
rm
unstable-rethrow.browser.js.map
832
0644
edit
dl
rm
unstable-rethrow.d.ts
591
0644
edit
dl
rm
unstable-rethrow.js
1250
0644
edit
dl
rm
unstable-rethrow.js.map
1122
0644
edit
dl
rm
unstable-rethrow.server.d.ts
64
0644
edit
dl
rm
unstable-rethrow.server.js
1521
0644
edit
dl
rm
unstable-rethrow.server.js.map
1505
0644
edit
dl
rm
use-action-queue.d.ts
330
0644
edit
dl
rm
use-action-queue.js
2903
0644
edit
dl
rm
use-action-queue.js.map
3300
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/client/components/bfcache.js.map
(6376B)
{"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":["useRouterBFCache","MAX_BF_CACHE_ENTRIES","process","env","__NEXT_ROUTER_BF_CACHE","activeTree","activeStateKey","prevActiveEntry","setPrevActiveEntry","useState","initialEntry","tree","stateKey","next","newActiveEntry","n","oldEntry","clonedEntry","entry"],"mappings":";;;;+BAiCgBA;;;eAAAA;;;uBAhCS;AAEzB,kEAAkE;AAClE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