/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.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 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 .\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(\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,MAAMC,uBAAuBC,QAAQC,GAAG,CAACC,sBAAsB,GAAG,IAAI;AA6B/D,SAASJ,iBACdK,UAA6B,EAC7BC,cAAsB;IAEtB,wEAAwE;IACxE,2EAA2E;IAC3E,2DAA2D;IAC3D,yEAAyE;IACzE,2EAA2E;IAC3E,2EAA2E;IAC3E,4EAA4E;IAC5E,wEAAwE;IACxE,sEAAsE;IACtE,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGC,IAAAA,eAAQ,EACpD;QACE,MAAMC,eAAmC;YACvCC,MAAMN;YACNO,UAAUN;YACVO,MAAM;QACR;QACA,OAAOH;IACT;IAGF,IAAIH,gBAAgBI,IAAI,KAAKN,YAAY;QACvC,iEAAiE;QACjE,kBAAkB;QAClB,OAAOE;IACT;IAEA,4EAA4E;IAC5E,2EAA2E;IAC3E,+DAA+D;IAC/D,EAAE;IACF,6EAA6E;IAC7E,6DAA6D;IAE7D,2EAA2E;IAC3E,eAAe;IACf,MAAMO,iBAAqC;QACzCH,MAAMN;QACNO,UAAUN;QACVO,MAAM;IACR;IAEA,2EAA2E;IAC3E,6EAA6E;IAC7E,mDAAmD;IACnD,IAAIE,IAAI;IACR,IAAIC,WAAsCT;IAC1C,IAAIU,cAAkCH;IACtC,MAAOE,aAAa,QAAQD,IAAId,qBAAsB;QACpD,IAAIe,SAASJ,QAAQ,KAAKN,gBAAgB;YACxC,yEAAyE;YACzE,yEAAyE;YACzE,0EAA0E;YAC1E,sEAAsE;YACtE,sEAAsE;YACtE,0EAA0E;YAC1E,0DAA0D;YAC1DW,YAAYJ,IAAI,GAAGG,SAASH,IAAI;YAChC;QACF,OAAO;YACL,6CAA6C;YAC7CE;YACA,MAAMG,QAA4B;gBAChCP,MAAMK,SAASL,IAAI;gBACnBC,UAAUI,SAASJ,QAAQ;gBAC3BC,MAAM;YACR;YACAI,YAAYJ,IAAI,GAAGK;YACnBD,cAAcC;QAChB;QACAF,WAAWA,SAASH,IAAI;IAC1B;IAEAL,mBAAmBM;IACnB,OAAOA;AACT","ignoreList":[0]}