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