/opt/canhelp/node_modules/next/dist/client/components
NameSizeModeActions
builtin/-0755rm
errors/-0755rm
http-access-fallback/-0755rm
metadata/-0755rm
router-reducer/-0755rm
segment-cache-impl/-0755rm
styles/-0755rm
app-router-announcer.d.ts1960644editdlrm
app-router-announcer.js33520644editdlrm
app-router-announcer.js.map46780644editdlrm
app-router-headers.d.ts12430644editdlrm
app-router-headers.js37970644editdlrm
app-router-headers.js.map31100644editdlrm
app-router-instance.d.ts20810644editdlrm
app-router-instance.js144320644editdlrm
app-router-instance.js.map211790644editdlrm
app-router.d.ts9320644editdlrm
app-router.js249870644editdlrm
app-router.js.map348630644editdlrm
bailout-to-client-rendering.d.ts800644editdlrm
bailout-to-client-rendering.js18770644editdlrm
bailout-to-client-rendering.js.map16650644editdlrm
bfcache.d.ts13970644editdlrm
bfcache.js40350644editdlrm
bfcache.js.map63760644editdlrm
client-page.d.ts8760644editdlrm
client-page.js26030644editdlrm
client-page.js.map39070644editdlrm
client-segment.d.ts8420644editdlrm
client-segment.js21920644editdlrm
client-segment.js.map30870644editdlrm
dev-root-http-access-fallback-boundary.d.ts2300644editdlrm
dev-root-http-access-fallback-boundary.js18620644editdlrm
dev-root-http-access-fallback-boundary.js.map12900644editdlrm
error-boundary.d.ts15660644editdlrm
error-boundary.js54990644editdlrm
error-boundary.js.map74090644editdlrm
forbidden.d.ts440644editdlrm
forbidden.js20770644editdlrm
forbidden.js.map19860644editdlrm
handle-isr-error.d.ts780644editdlrm
handle-isr-error.js10850644editdlrm
handle-isr-error.js.map12950644editdlrm
hooks-server-context.d.ts3260644editdlrm
hooks-server-context.js13520644editdlrm
hooks-server-context.js.map11820644editdlrm
is-next-router-error.d.ts4310644editdlrm
is-next-router-error.js8860644editdlrm
is-next-router-error.js.map8990644editdlrm
layout-router.d.ts9990644editdlrm
layout-router.js279470644editdlrm
layout-router.js.map377010644editdlrm
links.d.ts22410644editdlrm
links.js140530644editdlrm
links.js.map210560644editdlrm
match-segments.d.ts1540644editdlrm
match-segments.js10540644editdlrm
match-segments.js.map10450644editdlrm
nav-failure-handler.d.ts1230644editdlrm
nav-failure-handler.js24920644editdlrm
nav-failure-handler.js.map28680644editdlrm
navigation-untracked.d.ts110644editdlrm
navigation-untracked.js26070644editdlrm
navigation-untracked.js.map33490644editdlrm
navigation.d.ts46350644editdlrm
navigation.js79420644editdlrm
navigation.js.map127130644editdlrm
navigation.react-server.d.ts12380644editdlrm
navigation.react-server.js35010644editdlrm
navigation.react-server.js.map28380644editdlrm
noop-head.d.ts420644editdlrm
noop-head.js6070644editdlrm
noop-head.js.map2490644editdlrm
not-found.d.ts430644editdlrm
not-found.js18880644editdlrm
not-found.js.map17500644editdlrm
promise-queue.d.ts1920644editdlrm
promise-queue.js42740644editdlrm
promise-queue.js.map36070644editdlrm
redirect-boundary.d.ts7760644editdlrm
redirect-boundary.js32700644editdlrm
redirect-boundary.js.map39750644editdlrm
redirect-error.d.ts6330644editdlrm
redirect-error.js18190644editdlrm
redirect-error.js.map21240644editdlrm
redirect-status-code.d.ts1200644editdlrm
redirect-status-code.js9670644editdlrm
redirect-status-code.js.map3300644editdlrm
redirect.d.ts24690644editdlrm
redirect.js37460644editdlrm
redirect.js.map59190644editdlrm
render-from-template-context.d.ts1000644editdlrm
render-from-template-context.js11700644editdlrm
render-from-template-context.js.map6450644editdlrm
segment-cache.d.ts34980644editdlrm
segment-cache.js76110644editdlrm
segment-cache.js.map89460644editdlrm
static-generation-bailout.d.ts2050644editdlrm
static-generation-bailout.js13020644editdlrm
static-generation-bailout.js.map9260644editdlrm
unauthorized.d.ts470644editdlrm
unauthorized.js21100644editdlrm
unauthorized.js.map20180644editdlrm
unrecognized-action-error.d.ts7900644editdlrm
unrecognized-action-error.js12440644editdlrm
unrecognized-action-error.js.map15020644editdlrm
unresolved-thenable.d.ts1830644editdlrm
unresolved-thenable.js7690644editdlrm
unresolved-thenable.js.map4500644editdlrm
unstable-rethrow.browser.d.ts640644editdlrm
unstable-rethrow.browser.js10110644editdlrm
unstable-rethrow.browser.js.map8320644editdlrm
unstable-rethrow.d.ts5910644editdlrm
unstable-rethrow.js12500644editdlrm
unstable-rethrow.js.map11220644editdlrm
unstable-rethrow.server.d.ts640644editdlrm
unstable-rethrow.server.js15210644editdlrm
unstable-rethrow.server.js.map15050644editdlrm
use-action-queue.d.ts3300644editdlrm
use-action-queue.js29030644editdlrm
use-action-queue.js.map33000644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/client/components/bfcache.js (4035B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "useRouterBFCache", { enumerable: true, get: function() { return useRouterBFCache; } }); const _react = require("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; 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] = (0, _react.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; } if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=bfcache.js.map