one 1.18.2 → 1.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cjs/layouts/NativeTabs.cjs +22 -12
  2. package/dist/cjs/layouts/NativeTabs.native.js +22 -12
  3. package/dist/cjs/layouts/NativeTabs.native.js.map +1 -1
  4. package/dist/cjs/layouts/NativeTabs.test.cjs +24 -0
  5. package/dist/cjs/layouts/NativeTabs.test.native.js +35 -0
  6. package/dist/cjs/layouts/NativeTabs.test.native.js.map +1 -0
  7. package/dist/cjs/useBlocker.native.js +21 -30
  8. package/dist/cjs/useBlocker.native.js.map +1 -1
  9. package/dist/cjs/useLoader.cjs +1 -0
  10. package/dist/cjs/useLoader.native.js +2 -6
  11. package/dist/cjs/useLoader.native.js.map +1 -1
  12. package/dist/esm/layouts/NativeTabs.mjs +11 -12
  13. package/dist/esm/layouts/NativeTabs.mjs.map +1 -1
  14. package/dist/esm/layouts/NativeTabs.native.js +11 -12
  15. package/dist/esm/layouts/NativeTabs.native.js.map +1 -1
  16. package/dist/esm/layouts/NativeTabs.test.mjs +24 -0
  17. package/dist/esm/layouts/NativeTabs.test.mjs.map +1 -0
  18. package/dist/esm/layouts/NativeTabs.test.native.js +32 -0
  19. package/dist/esm/layouts/NativeTabs.test.native.js.map +1 -0
  20. package/dist/esm/useBlocker.native.js +22 -31
  21. package/dist/esm/useBlocker.native.js.map +1 -1
  22. package/dist/esm/useLoader.native.js +2 -12
  23. package/dist/esm/useLoader.native.js.map +1 -1
  24. package/package.json +9 -9
  25. package/src/layouts/NativeTabs.test.ts +30 -0
  26. package/src/layouts/NativeTabs.tsx +15 -17
  27. package/src/useBlocker.native.ts +27 -48
  28. package/src/useLoader.ts +5 -2
  29. package/types/layouts/NativeTabs.d.ts.map +1 -1
  30. package/types/layouts/NativeTabs.test.d.ts +2 -0
  31. package/types/layouts/NativeTabs.test.d.ts.map +1 -0
  32. package/types/useBlocker.native.d.ts +7 -4
  33. package/types/useBlocker.native.d.ts.map +1 -1
  34. package/types/useLoader.d.ts.map +1 -1
@@ -1,49 +1,40 @@
1
- import { useNavigation } from "@react-navigation/native";
1
+ import { useNavigation, usePreventRemove } from "@react-navigation/native";
2
2
  import * as React from "react";
3
3
  function useBlocker(shouldBlock) {
4
4
  var navigation = useNavigation();
5
5
  var [state, setState] = React.useState("unblocked");
6
- var [pendingEvent, setPendingEvent] = React.useState(null);
6
+ var [pendingAction, setPendingAction] = React.useState(null);
7
7
  var [blockedLocation, setBlockedLocation] = React.useState(null);
8
- var shouldBlockRef = React.useRef(shouldBlock);
9
- shouldBlockRef.current = shouldBlock;
10
- React.useEffect(function () {
11
- var unsubscribe = navigation.addListener("beforeRemove", function (e) {
12
- var _e_data_action, _e_data;
13
- var currentShouldBlock = shouldBlockRef.current;
14
- var payload = (_e_data = e.data) === null || _e_data === void 0 ? void 0 : (_e_data_action = _e_data.action) === null || _e_data_action === void 0 ? void 0 : _e_data_action.payload;
15
- var nextLocation = (payload === null || payload === void 0 ? void 0 : payload.name) || "previous screen";
16
- var block = typeof currentShouldBlock === "function" ? currentShouldBlock({
17
- currentLocation: "",
18
- // Not easily available on native
19
- nextLocation,
20
- historyAction: "pop"
21
- }) : currentShouldBlock;
22
- if (!block) {
23
- return;
24
- }
25
- e.preventDefault();
26
- setPendingEvent(e);
27
- setBlockedLocation(nextLocation);
28
- setState("blocked");
29
- });
30
- return unsubscribe;
31
- }, [navigation]);
8
+ var block = typeof shouldBlock === "function" ? shouldBlock({
9
+ currentLocation: "",
10
+ nextLocation: "previous screen",
11
+ historyAction: "pop"
12
+ }) : shouldBlock;
13
+ usePreventRemove(block, function (param) {
14
+ var {
15
+ data
16
+ } = param;
17
+ var _data_action;
18
+ var payload = data === null || data === void 0 ? void 0 : (_data_action = data.action) === null || _data_action === void 0 ? void 0 : _data_action.payload;
19
+ setPendingAction(data.action);
20
+ setBlockedLocation((payload === null || payload === void 0 ? void 0 : payload.name) || "previous screen");
21
+ setState("blocked");
22
+ });
32
23
  var reset = React.useCallback(function () {
33
- setPendingEvent(null);
24
+ setPendingAction(null);
34
25
  setBlockedLocation(null);
35
26
  setState("unblocked");
36
27
  }, []);
37
28
  var proceed = React.useCallback(function () {
38
- if (!pendingEvent) return;
29
+ if (!pendingAction) return;
39
30
  setState("proceeding");
40
- navigation.dispatch(pendingEvent.data.action);
31
+ navigation.dispatch(pendingAction);
41
32
  setTimeout(function () {
42
- setPendingEvent(null);
33
+ setPendingAction(null);
43
34
  setBlockedLocation(null);
44
35
  setState("unblocked");
45
36
  }, 100);
46
- }, [navigation, pendingEvent]);
37
+ }, [navigation, pendingAction]);
47
38
  if (state === "unblocked") {
48
39
  return {
49
40
  state: "unblocked"
@@ -1 +1 @@
1
- {"version":3,"names":["useNavigation","React","useBlocker","shouldBlock","navigation","state","setState","useState","pendingEvent","setPendingEvent","blockedLocation","setBlockedLocation","shouldBlockRef","useRef","current","useEffect","unsubscribe","addListener","e","_e_data_action","_e_data","currentShouldBlock","payload","data","action","nextLocation","name","block","currentLocation","historyAction","preventDefault","reset","useCallback","proceed","dispatch","setTimeout","location","checkBlocker","_nextLocation","_historyAction","arguments","length"],"sources":["../../src/useBlocker.native.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAC9B,YAAYC,KAAA,MAAW;AA+BZ,SAASC,WAAWC,WAAA,EAAa;EACxC,IAAIC,UAAA,GAAaJ,aAAA,CAAc;EAC/B,IAAI,CAACK,KAAA,EAAOC,QAAQ,IAAIL,KAAA,CAAMM,QAAA,CAAS,WAAW;EAClD,IAAI,CAACC,YAAA,EAAcC,eAAe,IAAIR,KAAA,CAAMM,QAAA,CAAS,IAAI;EACzD,IAAI,CAACG,eAAA,EAAiBC,kBAAkB,IAAIV,KAAA,CAAMM,QAAA,CAAS,IAAI;EAC/D,IAAIK,cAAA,GAAiBX,KAAA,CAAMY,MAAA,CAAOV,WAAW;EAC7CS,cAAA,CAAeE,OAAA,GA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AW,YAAW;MAClB1B,eAAA,CAAgB,IAAI;MACpBE,kBAAA,CAAmB,IAAI;MACvBL,QAAA,CAAS,WAAW;IACxB,GAAG,GAAG;EACV,GAAG,CACCF,UAAA,EACAI,YAAA,CACH;EACD,IAAIH,KAAA,KAAU,aAAa;IACvB,OAAO;MACHA,KAAA,EAAO;IACX;EACJ;EACA,IAAIA,KAAA,KAAU,cAAc;IACxB,OAAO;MACHA,KAAA,EAAO;MACP+B,QAAA,EAAU1B;IACd;EACJ;EACA,OAAO;IACHL,KAAA,EAAO;IACP0B,KAAA;IACAE,OAAA;IACAG,QAAA,EAAU1B;EACd;AACJ;AAIW,SAAS2B,aAAaC,aAAA,EAAe;EAC5C,IAAIC,cAAA,GAAiBC,SAAA,CAAUC,MAAA,GAAS,KAAKD,SAAA,CAAU,CAAC,MAAM,SAASA,SAAA,CAAU,CAAC,IAAI;EACtF,OAAO;AACX","ignoreList":[]}
1
+ {"version":3,"names":["useNavigation","usePreventRemove","React","useBlocker","shouldBlock","navigation","state","setState","useState","pendingAction","setPendingAction","blockedLocation","setBlockedLocation","block","currentLocation","nextLocation","historyAction","param","data","_data_action","payload","action","name","reset","useCallback","proceed","dispatch","setTimeout","location","checkBlocker","_nextLocation","_historyAction","arguments","length"],"sources":["../../src/useBlocker.native.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,EAAeC,gBAAA,QAAwB;AAChD,YAAYC,KAAA,MAAW;AAkCZ,SAASC,WAAWC,WAAA,EAAa;EACxC,IAAIC,UAAA,GAAaL,aAAA,CAAc;EAC/B,IAAI,CAACM,KAAA,EAAOC,QAAQ,IAAIL,KAAA,CAAMM,QAAA,CAAS,WAAW;EAClD,IAAI,CAACC,aAAA,EAAeC,gBAAgB,IAAIR,KAAA,CAAMM,QAAA,CAAS,IAAI;EAC3D,IAAI,CAACG,eAAA,EAAiBC,kBAAkB,IAAIV,KAAA,CAAMM,QAAA,CAAS,IAAI;EAE/D,IAAIK,KAAA,GAAQ,OAA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L,KAAA,EAAO;IACPiB,KAAA;IACAE,OAAA;IACAG,QAAA,EAAUjB;EACd;AACJ;AAIW,SAASkB,aAAaC,aAAA,EAAe;EAC5C,IAAIC,cAAA,GAAiBC,SAAA,CAAUC,MAAA,GAAS,KAAKD,SAAA,CAAU,CAAC,MAAM,SAASA,SAAA,CAAU,CAAC,IAAI;EACtF,OAAO;AACX","ignoreList":[]}
@@ -9,16 +9,11 @@ import { preloadedLoaderData, preloadingLoader, routeNode } from "./router/route
9
9
  import { setSSRLoaderData, ssrLoaderData } from "./server/ssrLoaderData.native.js";
10
10
  import { getClientMatchesSnapshot, subscribeToClientMatches, updateMatchLoaderData } from "./useMatches.native.js";
11
11
  import { getLoaderPath } from "./utils/cleanUrl.native.js";
12
+ import { getURL } from "./getURL.native.js";
12
13
  import { LOADER_JS_POSTFIX_UNCACHED } from "./constants.native.js";
13
14
  import { dynamicImport } from "./utils/dynamicImport.native.js";
14
15
  import { weakKey } from "./utils/weakKey.native.js";
15
16
  import { useServerContext } from "./vite/one-server-only.native.js";
16
- var __require = /* @__PURE__ */(x => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
17
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
18
- }) : x)(function (x) {
19
- if (typeof require !== "undefined") return require.apply(this, arguments);
20
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
21
- });
22
17
  function _instanceof(left, right) {
23
18
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);else return left instanceof right;
24
19
  }
@@ -305,12 +300,7 @@ function useLoaderState(loader) {
305
300
  try {
306
301
  var _dynamicImport;
307
302
  var nativeLoaderJSUrl;
308
- if (process.env.NODE_ENV === "development") nativeLoaderJSUrl = `${getLoaderPath(currentPath, true)}?platform=native`;else {
309
- var {
310
- getURL
311
- } = __require("./getURL");
312
- nativeLoaderJSUrl = `${getURL()}/assets/${currentPath.slice(1).replace(/\/$/, "").replaceAll("_", "__").replaceAll("/", "_")}${LOADER_JS_POSTFIX_UNCACHED.replace(".js", ".native.js")}`;
313
- }
303
+ if (process.env.NODE_ENV === "development") nativeLoaderJSUrl = `${getLoaderPath(currentPath, true)}?platform=native`;else nativeLoaderJSUrl = `${getURL()}/assets/${currentPath.slice(1).replace(/\/$/, "").replaceAll("_", "__").replaceAll("/", "_")}${LOADER_JS_POSTFIX_UNCACHED.replace(".js", ".native.js")}`;
314
304
  try {
315
305
  var moduleLoadStart = performance.now();
316
306
  var controller = new AbortController();
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useSyncExternalStore","registerDevtoolsFunction","useParams","usePathname","findNearestNotFoundRoute","setNotFoundState","useContextKey","getContextKey","router","preloadedLoaderData","preloadingLoader","routeNode","setSSRLoaderData","ssrLoaderData","getClientMatchesSnapshot","subscribeToClientMatches","updateMatchLoaderData","getLoaderPath","LOADER_JS_POSTFIX_UNCACHED","dynamicImport","weakKey","useServerContext","__require","x","require","Proxy","get","a","b","apply","arguments","Error","_instanceof","left","right","Symbol","hasInstance","LOADER_TIMEOUT","process","env","ONE_LOADER_TIMEOUT_MS","loaderTimingHistory","MAX_TIMING_HISTORY","recordLoaderTiming","NODE_ENV","entry","unshift","length","pop","window","CustomEvent","dispatchEvent","detail","error","message","name","route","pathname","path","timestamp","Date","now","type","getLoaderTimingHistory","loaderState","subscribers","Set","LOADER_STATE_MAX","loaderStateKeys","setBoundedLoaderState","push","oldest","shift","updateState","updates","forEach","callback","subscribe","add","delete","getLoaderState","preloadedData","data","promise","state","hasLoadedOnce","refetchLoader","startTime","performance","_dynamicImport","loaderJSUrl","moduleLoadStart","module","catch","moduleLoadTime","loader","executionStart","result","executionTime","totalTime","__oneRedirect","source","replace","__oneError","notFoundRoute","notFoundPath","__oneNotFoundPath","notFoundRouteNode","originalPath","currentMatches","pageMatch","normalizedPathname","normalizedMatchPathname","routeId","err","totalTime1","String","__oneRefetchLoader","refetchMatchLoader","currentPath","useLoaderState","loaderProps","loaderPropsFromServerContext","loaderData","loaderDataFromServerContext","params","has","refetch","serverContext","matches","contextKey","match","find","m","useAsyncFn","matchRouteId","startsWith","clientMatches","loaderStateEntry","_clientMatches_","match1","isPageMatch","matchPathNormalized","matchPathFresh","fresh","resolvedPreloadData","then","val","console","loadData","nativeLoaderJSUrl","getURL","slice","replaceAll","controller","AbortController","timeoutId","setTimeout","abort","loaderJsCode","loaderJsCodeResp","fetch","signal","ok","status","text","clearTimeout","Function","e","moduleLoadStart1","moduleLoadTime1","executionStart1","result1","executionTime1","totalTime2","notFoundRoute1","totalTime3","useLoader","results","Map","started","USE_ASYNC_FN_CACHE_MAX","setBoundedResults","key","value","size","firstKey","keys","next","set","resetLoaderState","clear","props","JSON","stringify","Promise","final","current"],"sources":["useLoader.native.js"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\nimport { registerDevtoolsFunction } from \"./devtools/registry\";\nimport { useParams, usePathname } from \"./hooks\";\nimport { findNearestNotFoundRoute, setNotFoundState } from \"./notFoundState\";\nimport { useContextKey } from \"./router/Route\";\nimport { getContextKey } from \"./router/matchers\";\nimport { router } from \"./router/imperative-api\";\nimport { preloadedLoaderData, preloadingLoader, routeNode } from \"./router/router\";\nimport { setSSRLoaderData, ssrLoaderData } from \"./server/ssrLoaderData\";\nimport { getClientMatchesSnapshot, subscribeToClientMatches, updateMatchLoaderData } from \"./useMatches\";\nimport { getLoaderPath } from \"./utils/cleanUrl\";\nimport { LOADER_JS_POSTFIX_UNCACHED } from \"./constants\";\nimport { dynamicImport } from \"./utils/dynamicImport\";\nimport { weakKey } from \"./utils/weakKey\";\nimport { useServerContext } from \"./vite/one-server-only\";\n\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b] }) : x)(function(x) {\n\tif (typeof require !== \"undefined\") return require.apply(this, arguments);\n\tthrow Error(\"Calling `require` for \\\"\" + x + \"\\\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.\");\n});\n\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar LOADER_TIMEOUT = process.env.ONE_LOADER_TIMEOUT_MS ? +process.env.ONE_LOADER_TIMEOUT_MS : 6e4;\nvar loaderTimingHistory = [];\nvar MAX_TIMING_HISTORY = 50;\nvar recordLoaderTiming = process.env.NODE_ENV === \"development\" ? function(entry) {\n\tloaderTimingHistory.unshift(entry);\n\tif (loaderTimingHistory.length > MAX_TIMING_HISTORY) loaderTimingHistory.pop();\n\tif (typeof window !== \"undefined\" && typeof CustomEvent !== \"undefined\") {\n\t\twindow.dispatchEvent(new CustomEvent(\"one-loader-timing\", { detail: entry }));\n\t\tif (entry.error) window.dispatchEvent(new CustomEvent(\"one-error\", { detail: {\n\t\t\terror: {\n\t\t\t\tmessage: entry.error,\n\t\t\t\tname: \"LoaderError\"\n\t\t\t},\n\t\t\troute: { pathname: entry.path },\n\t\t\ttimestamp: Date.now(),\n\t\t\ttype: \"loader\"\n\t\t} }));\n\t}\n} : void 0;\nfunction getLoaderTimingHistory() {\n\treturn loaderTimingHistory;\n}\nregisterDevtoolsFunction(\"getLoaderTimingHistory\", getLoaderTimingHistory);\nregisterDevtoolsFunction(\"recordLoaderTiming\", recordLoaderTiming);\nvar loaderState = {};\nvar subscribers = /* @__PURE__ */ new Set();\nvar LOADER_STATE_MAX = 200;\nvar loaderStateKeys = [];\nfunction setBoundedLoaderState(path, entry) {\n\tif (!(path in loaderState)) {\n\t\tloaderStateKeys.push(path);\n\t\tif (loaderStateKeys.length > LOADER_STATE_MAX) {\n\t\t\tvar oldest = loaderStateKeys.shift();\n\t\t\tdelete loaderState[oldest];\n\t\t}\n\t}\n\tloaderState[path] = entry;\n}\nfunction updateState(path, updates) {\n\tsetBoundedLoaderState(path, {\n\t\t...loaderState[path],\n\t\t...updates\n\t});\n\tsubscribers.forEach(function(callback) {\n\t\tcallback();\n\t});\n}\nfunction subscribe(callback) {\n\tsubscribers.add(callback);\n\treturn function() {\n\t\treturn subscribers.delete(callback);\n\t};\n}\nfunction getLoaderState(path, preloadedData) {\n\tif (!(path in loaderState)) setBoundedLoaderState(path, {\n\t\tdata: preloadedData,\n\t\terror: void 0,\n\t\tpromise: void 0,\n\t\tstate: \"idle\",\n\t\thasLoadedOnce: !!preloadedData\n\t});\n\treturn loaderState[path];\n}\nasync function refetchLoader(pathname) {\n\tvar startTime = performance.now();\n\tupdateState(pathname, {\n\t\tstate: \"loading\",\n\t\terror: null\n\t});\n\ttry {\n\t\tvar _dynamicImport;\n\t\tvar loaderJSUrl = getLoaderPath(pathname, true, `${Date.now()}`);\n\t\tvar moduleLoadStart = performance.now();\n\t\tvar module = await ((_dynamicImport = dynamicImport(loaderJSUrl)) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\t\treturn null;\n\t\t}));\n\t\tvar moduleLoadTime = performance.now() - moduleLoadStart;\n\t\tif (!(module === null || module === void 0 ? void 0 : module.loader)) {\n\t\t\tupdateState(pathname, {\n\t\t\t\tdata: void 0,\n\t\t\t\tstate: \"idle\",\n\t\t\t\thasLoadedOnce: true\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tvar executionStart = performance.now();\n\t\tvar result = await module.loader();\n\t\tvar executionTime = performance.now() - executionStart;\n\t\tvar totalTime = performance.now() - startTime;\n\t\tif (result === null || result === void 0 ? void 0 : result.__oneRedirect) {\n\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\tpath: pathname,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"refetch\"\n\t\t\t});\n\t\t\tupdateState(pathname, {\n\t\t\t\tdata: void 0,\n\t\t\t\tstate: \"idle\",\n\t\t\t\thasLoadedOnce: true\n\t\t\t});\n\t\t\trouter.replace(result.__oneRedirect);\n\t\t\treturn;\n\t\t}\n\t\tif ((result === null || result === void 0 ? void 0 : result.__oneError) === 404) {\n\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\tpath: pathname,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"refetch\"\n\t\t\t});\n\t\t\tvar notFoundRoute = findNearestNotFoundRoute(pathname, routeNode);\n\t\t\tsetNotFoundState({\n\t\t\t\tnotFoundPath: result.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\t\toriginalPath: pathname\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tupdateState(pathname, {\n\t\t\tdata: result,\n\t\t\tstate: \"idle\",\n\t\t\ttimestamp: Date.now(),\n\t\t\thasLoadedOnce: true\n\t\t});\n\t\tvar currentMatches = getClientMatchesSnapshot();\n\t\tvar pageMatch = currentMatches[currentMatches.length - 1];\n\t\tvar normalizedPathname = pathname.replace(/\\/$/, \"\") || \"/\";\n\t\tvar normalizedMatchPathname = ((pageMatch === null || pageMatch === void 0 ? void 0 : pageMatch.pathname) || \"\").replace(/\\/$/, \"\") || \"/\";\n\t\tif (pageMatch && normalizedMatchPathname === normalizedPathname) updateMatchLoaderData(pageMatch.routeId, result);\n\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\tpath: pathname,\n\t\t\tstartTime,\n\t\t\tmoduleLoadTime,\n\t\t\texecutionTime,\n\t\t\ttotalTime,\n\t\t\tsource: \"refetch\"\n\t\t});\n\t} catch (err) {\n\t\tvar totalTime1 = performance.now() - startTime;\n\t\tupdateState(pathname, {\n\t\t\terror: err,\n\t\t\tstate: \"idle\"\n\t\t});\n\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\tpath: pathname,\n\t\t\tstartTime,\n\t\t\ttotalTime: totalTime1,\n\t\t\terror: _instanceof(err, Error) ? err.message : String(err),\n\t\t\tsource: \"refetch\"\n\t\t});\n\t\tthrow err;\n\t}\n}\nif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") window.__oneRefetchLoader = refetchLoader;\nasync function refetchMatchLoader(routeId, currentPath) {\n\tvar _dynamicImport;\n\tvar module = await ((_dynamicImport = dynamicImport(getLoaderPath(currentPath, true, `${Date.now()}`))) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\treturn null;\n\t}));\n\tif (!(module === null || module === void 0 ? void 0 : module.loader)) return;\n\tvar result = await module.loader();\n\tif ((result === null || result === void 0 ? void 0 : result.__oneRedirect) || (result === null || result === void 0 ? void 0 : result.__oneError)) return;\n\tupdateMatchLoaderData(routeId, result);\n}\nfunction useLoaderState(loader) {\n\tvar { loaderProps: loaderPropsFromServerContext, loaderData: loaderDataFromServerContext } = useServerContext() || {};\n\tvar params = useParams();\n\tvar pathname = usePathname();\n\tvar currentPath = pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n\tif (typeof window === \"undefined\") {\n\t\tif (loader) {\n\t\t\tif (ssrLoaderData.has(loader)) return {\n\t\t\t\tdata: ssrLoaderData.get(loader),\n\t\t\t\trefetch: async function() {},\n\t\t\t\tstate: \"idle\"\n\t\t\t};\n\t\t\tvar serverContext = useServerContext();\n\t\t\tif (serverContext === null || serverContext === void 0 ? void 0 : serverContext.matches) {\n\t\t\t\tvar contextKey = useContextKey();\n\t\t\t\tvar match = serverContext.matches.find(function(m) {\n\t\t\t\t\treturn getContextKey(m.routeId) === contextKey;\n\t\t\t\t});\n\t\t\t\tif (match && match.loaderData !== void 0) return {\n\t\t\t\t\tdata: match.loaderData,\n\t\t\t\t\trefetch: async function() {},\n\t\t\t\t\tstate: \"idle\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: useAsyncFn(loader, loaderPropsFromServerContext || {\n\t\t\t\t\tpath: pathname,\n\t\t\t\t\tparams\n\t\t\t\t}),\n\t\t\t\trefetch: async function() {},\n\t\t\t\tstate: \"idle\"\n\t\t\t};\n\t\t}\n\t\tif (loaderDataFromServerContext !== void 0) return {\n\t\t\tdata: loaderDataFromServerContext,\n\t\t\trefetch: async function() {},\n\t\t\tstate: \"idle\"\n\t\t};\n\t}\n\tvar matchRouteId = loader ? (function() {\n\t\tvar result = loader();\n\t\treturn typeof result === \"string\" && result.startsWith(\"./\") ? result : null;\n\t})() : null;\n\tvar clientMatches = useSyncExternalStore(subscribeToClientMatches, getClientMatchesSnapshot, getClientMatchesSnapshot);\n\tvar preloadedData = (loaderPropsFromServerContext === null || loaderPropsFromServerContext === void 0 ? void 0 : loaderPropsFromServerContext.path) === currentPath ? loaderDataFromServerContext : void 0;\n\tvar loaderStateEntry = useSyncExternalStore(subscribe, function() {\n\t\treturn getLoaderState(currentPath, preloadedData);\n\t}, function() {\n\t\treturn getLoaderState(currentPath, preloadedData);\n\t});\n\tvar refetch = useCallback(function() {\n\t\treturn refetchLoader(currentPath);\n\t}, [currentPath]);\n\tif (matchRouteId) {\n\t\tvar _clientMatches_;\n\t\tvar match1 = clientMatches.find(function(m) {\n\t\t\treturn m.routeId === matchRouteId;\n\t\t});\n\t\tvar isPageMatch = clientMatches.length > 0 && ((_clientMatches_ = clientMatches[clientMatches.length - 1]) === null || _clientMatches_ === void 0 ? void 0 : _clientMatches_.routeId) === matchRouteId;\n\t\tvar matchPathNormalized = ((match1 === null || match1 === void 0 ? void 0 : match1.pathname) || \"\").replace(/\\/$/, \"\") || \"/\";\n\t\tvar matchPathFresh = !isPageMatch || matchPathNormalized === currentPath;\n\t\tif (match1 && match1.loaderData != null && matchPathFresh) return {\n\t\t\tdata: match1.loaderData,\n\t\t\trefetch: async function() {\n\t\t\t\tawait refetchLoader(currentPath);\n\t\t\t\tvar fresh = loaderState[currentPath];\n\t\t\t\tif ((fresh === null || fresh === void 0 ? void 0 : fresh.data) != null) updateMatchLoaderData(matchRouteId, fresh.data);\n\t\t\t},\n\t\t\tstate: loaderStateEntry.state\n\t\t};\n\t}\n\tif (!loader) return {\n\t\trefetch,\n\t\tstate: loaderStateEntry.state\n\t};\n\tif (!loaderStateEntry.data && !loaderStateEntry.promise && !loaderStateEntry.hasLoadedOnce) {\n\t\tvar resolvedPreloadData = preloadedLoaderData[currentPath];\n\t\tif (resolvedPreloadData != null) {\n\t\t\tdelete preloadedLoaderData[currentPath];\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tloaderStateEntry.data = resolvedPreloadData;\n\t\t\tloaderStateEntry.hasLoadedOnce = true;\n\t\t} else if (preloadingLoader[currentPath]) loaderStateEntry.promise = preloadingLoader[currentPath].then(function(val) {\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tdelete preloadedLoaderData[currentPath];\n\t\t\tif (val != null) updateState(currentPath, {\n\t\t\t\tdata: val,\n\t\t\t\thasLoadedOnce: true,\n\t\t\t\tpromise: void 0\n\t\t\t});\n\t\t\telse updateState(currentPath, { promise: void 0 });\n\t\t}).catch(function(err) {\n\t\t\tconsole.error(`Error running loader()`, err);\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tupdateState(currentPath, {\n\t\t\t\terror: err,\n\t\t\t\tpromise: void 0\n\t\t\t});\n\t\t});\n\t\telse {\n\t\t\tvar loadData = async function() {\n\t\t\t\tvar startTime = performance.now();\n\t\t\t\ttry {\n\t\t\t\t\tvar _dynamicImport;\n\t\t\t\t\tvar nativeLoaderJSUrl;\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\") nativeLoaderJSUrl = `${getLoaderPath(currentPath, true)}?platform=native`;\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar { getURL } = __require(\"./getURL\");\n\t\t\t\t\t\tnativeLoaderJSUrl = `${getURL()}/assets/${currentPath.slice(1).replace(/\\/$/, \"\").replaceAll(\"_\", \"__\").replaceAll(\"/\", \"_\")}${LOADER_JS_POSTFIX_UNCACHED.replace(\".js\", \".native.js\")}`;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar moduleLoadStart = performance.now();\n\t\t\t\t\t\tvar controller = new AbortController();\n\t\t\t\t\t\tvar timeoutId = setTimeout(function() {\n\t\t\t\t\t\t\treturn controller.abort();\n\t\t\t\t\t\t}, LOADER_TIMEOUT);\n\t\t\t\t\t\tvar loaderJsCode;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar loaderJsCodeResp = await fetch(nativeLoaderJSUrl, { signal: controller.signal });\n\t\t\t\t\t\t\tif (!loaderJsCodeResp.ok) throw new Error(`Response not ok: ${loaderJsCodeResp.status}`);\n\t\t\t\t\t\t\tloaderJsCode = await loaderJsCodeResp.text();\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar result = {};\n\t\t\t\t\t\tnew Function(\"exports\", loaderJsCode)(result);\n\t\t\t\t\t\tvar moduleLoadTime = performance.now() - moduleLoadStart;\n\t\t\t\t\t\tif (typeof result.loader !== \"function\") throw new Error(\"Loader code isn't exporting a `loader` function\");\n\t\t\t\t\t\tvar executionStart = performance.now();\n\t\t\t\t\t\tvar data = await result.loader();\n\t\t\t\t\t\tvar executionTime = performance.now() - executionStart;\n\t\t\t\t\t\tvar totalTime = performance.now() - startTime;\n\t\t\t\t\t\tif (data === null || data === void 0 ? void 0 : data.__oneRedirect) {\n\t\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\trouter.replace(data.__oneRedirect);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((data === null || data === void 0 ? void 0 : data.__oneError) === 404) {\n\t\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tvar notFoundRoute = findNearestNotFoundRoute(currentPath, routeNode);\n\t\t\t\t\t\t\tsetNotFoundState({\n\t\t\t\t\t\t\t\tnotFoundPath: data.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\t\t\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\t\t\t\t\t\toriginalPath: currentPath\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(`[one] native loader error for ${currentPath}:`, _instanceof(e, Error) ? e.message : e, `url: ${nativeLoaderJSUrl}`);\n\t\t\t\t\t\tvar totalTime1 = performance.now() - startTime;\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\ttotalTime: totalTime1,\n\t\t\t\t\t\t\terror: _instanceof(e, Error) ? e.message : String(e),\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar loaderJSUrl = getLoaderPath(currentPath, true);\n\t\t\t\t\tvar moduleLoadStart1 = performance.now();\n\t\t\t\t\tvar module = await ((_dynamicImport = dynamicImport(loaderJSUrl)) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}));\n\t\t\t\t\tvar moduleLoadTime1 = performance.now() - moduleLoadStart1;\n\t\t\t\t\tif (!(module === null || module === void 0 ? void 0 : module.loader)) {\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar executionStart1 = performance.now();\n\t\t\t\t\tvar result1 = await module.loader();\n\t\t\t\t\tvar executionTime1 = performance.now() - executionStart1;\n\t\t\t\t\tvar totalTime2 = performance.now() - startTime;\n\t\t\t\t\tif (result1 === null || result1 === void 0 ? void 0 : result1.__oneRedirect) {\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trouter.replace(result1.__oneRedirect);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ((result1 === null || result1 === void 0 ? void 0 : result1.__oneError) === 404) {\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar notFoundRoute1 = findNearestNotFoundRoute(currentPath, routeNode);\n\t\t\t\t\t\tsetNotFoundState({\n\t\t\t\t\t\t\tnotFoundPath: result1.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\t\t\t\tnotFoundRouteNode: notFoundRoute1 || void 0,\n\t\t\t\t\t\t\toriginalPath: currentPath\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\tdata: result1,\n\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t});\n\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\tvar totalTime3 = performance.now() - startTime;\n\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\terror: err,\n\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t});\n\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\ttotalTime: totalTime3,\n\t\t\t\t\t\terror: _instanceof(err, Error) ? err.message : String(err),\n\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t\tloaderStateEntry.promise = loadData();\n\t\t}\n\t}\n\tif (loaderStateEntry.error && !loaderStateEntry.hasLoadedOnce) throw loaderStateEntry.error;\n\tif (loaderStateEntry.data === void 0 && loaderStateEntry.promise && !loaderStateEntry.hasLoadedOnce) throw loaderStateEntry.promise;\n\treturn {\n\t\tdata: loaderStateEntry.data,\n\t\trefetch,\n\t\tstate: loaderStateEntry.state\n\t};\n}\nfunction useLoader(loader) {\n\tvar { data } = useLoaderState(loader);\n\treturn data;\n}\nvar results = /* @__PURE__ */ new Map();\nvar started = /* @__PURE__ */ new Map();\nvar USE_ASYNC_FN_CACHE_MAX = 100;\nfunction setBoundedResults(key, value) {\n\tif (results.size >= USE_ASYNC_FN_CACHE_MAX && !results.has(key)) {\n\t\tvar firstKey = results.keys().next().value;\n\t\tif (firstKey !== void 0) {\n\t\t\tresults.delete(firstKey);\n\t\t\tstarted.delete(firstKey);\n\t\t}\n\t}\n\tresults.set(key, value);\n}\nfunction resetLoaderState() {\n\tresults.clear();\n\tstarted.clear();\n}\nfunction useAsyncFn(val, props) {\n\tvar key = (val ? weakKey(val) : \"\") + JSON.stringify(props);\n\tif (val) {\n\t\tif (!started.get(key)) {\n\t\t\tstarted.set(key, true);\n\t\t\tvar next = val(props);\n\t\t\tif (_instanceof(next, Promise)) next = next.then(function(final) {\n\t\t\t\tsetBoundedResults(key, final);\n\t\t\t}).catch(function(err) {\n\t\t\t\tconsole.error(`Error running loader()`, err);\n\t\t\t\tsetBoundedResults(key, void 0);\n\t\t\t});\n\t\t\tsetBoundedResults(key, next);\n\t\t}\n\t}\n\tvar current = results.get(key);\n\tif (_instanceof(current, Promise)) throw current;\n\treturn current;\n}\n\nexport { getLoaderTimingHistory, refetchLoader, refetchMatchLoader, resetLoaderState, setSSRLoaderData, useLoader, useLoaderState };"],"mappings":"AAAA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AACzD,SAASC,wBAAwB,QAAQ,+BAAqB;AAC9D,SAASC,SAAS,EAAEC,WAAW,QAAQ,mBAAS;AAChD,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,2BAAiB;AAC5E,SAASC,aAAa,QAAQ,0BAAgB;AAC9C,SAASC,aAAa,QAAQ,6BAAmB;AACjD,SAASC,MAAM,QAAQ,mCAAyB;AAChD,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,SAAS,QAAQ,2BAAiB;AAClF,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,kCAAwB;AACxE,SAASC,wBAAwB,EAAEC,wBAAwB,EAAEC,qBAAqB,QAAQ,wBAAc;AACxG,SAASC,aAAa,QAAQ,4BAAkB;AAChD,SAASC,0BAA0B,QAAQ,uBAAa;AACxD,SAASC,aAAa,QAAQ,iCAAuB;AACrD,SAASC,OAAO,QAAQ,2BAAiB;AACzC,SAASC,gBAAgB,QAAQ,kCAAwB;AA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O,CAACxJ,GAAG,CAAC6J,GAAG,CAAC;EAC9B,IAAIvJ,WAAW,CAACqK,OAAO,EAAEF,OAAO,CAAC,EAAE,MAAME,OAAO;EAChD,OAAOA,OAAO;AACf;AAEA,SAAStI,sBAAsB,EAAEuB,aAAa,EAAEgC,kBAAkB,EAAEwE,gBAAgB,EAAElL,gBAAgB,EAAEqK,SAAS,EAAEzD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useSyncExternalStore","registerDevtoolsFunction","useParams","usePathname","findNearestNotFoundRoute","setNotFoundState","useContextKey","getContextKey","router","preloadedLoaderData","preloadingLoader","routeNode","setSSRLoaderData","ssrLoaderData","getClientMatchesSnapshot","subscribeToClientMatches","updateMatchLoaderData","getLoaderPath","getURL","LOADER_JS_POSTFIX_UNCACHED","dynamicImport","weakKey","useServerContext","_instanceof","left","right","Symbol","hasInstance","LOADER_TIMEOUT","process","env","ONE_LOADER_TIMEOUT_MS","loaderTimingHistory","MAX_TIMING_HISTORY","recordLoaderTiming","NODE_ENV","entry","unshift","length","pop","window","CustomEvent","dispatchEvent","detail","error","message","name","route","pathname","path","timestamp","Date","now","type","getLoaderTimingHistory","loaderState","subscribers","Set","LOADER_STATE_MAX","loaderStateKeys","setBoundedLoaderState","push","oldest","shift","updateState","updates","forEach","callback","subscribe","add","delete","getLoaderState","preloadedData","data","promise","state","hasLoadedOnce","refetchLoader","startTime","performance","_dynamicImport","loaderJSUrl","moduleLoadStart","module","catch","moduleLoadTime","loader","executionStart","result","executionTime","totalTime","__oneRedirect","source","replace","__oneError","notFoundRoute","notFoundPath","__oneNotFoundPath","notFoundRouteNode","originalPath","currentMatches","pageMatch","normalizedPathname","normalizedMatchPathname","routeId","err","totalTime1","Error","String","__oneRefetchLoader","refetchMatchLoader","currentPath","useLoaderState","loaderProps","loaderPropsFromServerContext","loaderData","loaderDataFromServerContext","params","has","get","refetch","serverContext","matches","contextKey","match","find","m","useAsyncFn","matchRouteId","startsWith","clientMatches","loaderStateEntry","_clientMatches_","match1","isPageMatch","matchPathNormalized","matchPathFresh","fresh","resolvedPreloadData","then","val","console","loadData","nativeLoaderJSUrl","slice","replaceAll","controller","AbortController","timeoutId","setTimeout","abort","loaderJsCode","loaderJsCodeResp","fetch","signal","ok","status","text","clearTimeout","Function","e","moduleLoadStart1","moduleLoadTime1","executionStart1","result1","executionTime1","totalTime2","notFoundRoute1","totalTime3","useLoader","results","Map","started","USE_ASYNC_FN_CACHE_MAX","setBoundedResults","key","value","size","firstKey","keys","next","set","resetLoaderState","clear","props","JSON","stringify","Promise","final","current"],"sources":["useLoader.native.js"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\nimport { registerDevtoolsFunction } from \"./devtools/registry\";\nimport { useParams, usePathname } from \"./hooks\";\nimport { findNearestNotFoundRoute, setNotFoundState } from \"./notFoundState\";\nimport { useContextKey } from \"./router/Route\";\nimport { getContextKey } from \"./router/matchers\";\nimport { router } from \"./router/imperative-api\";\nimport { preloadedLoaderData, preloadingLoader, routeNode } from \"./router/router\";\nimport { setSSRLoaderData, ssrLoaderData } from \"./server/ssrLoaderData\";\nimport { getClientMatchesSnapshot, subscribeToClientMatches, updateMatchLoaderData } from \"./useMatches\";\nimport { getLoaderPath } from \"./utils/cleanUrl\";\nimport { getURL } from \"./getURL\";\nimport { LOADER_JS_POSTFIX_UNCACHED } from \"./constants\";\nimport { dynamicImport } from \"./utils/dynamicImport\";\nimport { weakKey } from \"./utils/weakKey\";\nimport { useServerContext } from \"./vite/one-server-only\";\n\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar LOADER_TIMEOUT = process.env.ONE_LOADER_TIMEOUT_MS ? +process.env.ONE_LOADER_TIMEOUT_MS : 6e4;\nvar loaderTimingHistory = [];\nvar MAX_TIMING_HISTORY = 50;\nvar recordLoaderTiming = process.env.NODE_ENV === \"development\" ? function(entry) {\n\tloaderTimingHistory.unshift(entry);\n\tif (loaderTimingHistory.length > MAX_TIMING_HISTORY) loaderTimingHistory.pop();\n\tif (typeof window !== \"undefined\" && typeof CustomEvent !== \"undefined\") {\n\t\twindow.dispatchEvent(new CustomEvent(\"one-loader-timing\", { detail: entry }));\n\t\tif (entry.error) window.dispatchEvent(new CustomEvent(\"one-error\", { detail: {\n\t\t\terror: {\n\t\t\t\tmessage: entry.error,\n\t\t\t\tname: \"LoaderError\"\n\t\t\t},\n\t\t\troute: { pathname: entry.path },\n\t\t\ttimestamp: Date.now(),\n\t\t\ttype: \"loader\"\n\t\t} }));\n\t}\n} : void 0;\nfunction getLoaderTimingHistory() {\n\treturn loaderTimingHistory;\n}\nregisterDevtoolsFunction(\"getLoaderTimingHistory\", getLoaderTimingHistory);\nregisterDevtoolsFunction(\"recordLoaderTiming\", recordLoaderTiming);\nvar loaderState = {};\nvar subscribers = /* @__PURE__ */ new Set();\nvar LOADER_STATE_MAX = 200;\nvar loaderStateKeys = [];\nfunction setBoundedLoaderState(path, entry) {\n\tif (!(path in loaderState)) {\n\t\tloaderStateKeys.push(path);\n\t\tif (loaderStateKeys.length > LOADER_STATE_MAX) {\n\t\t\tvar oldest = loaderStateKeys.shift();\n\t\t\tdelete loaderState[oldest];\n\t\t}\n\t}\n\tloaderState[path] = entry;\n}\nfunction updateState(path, updates) {\n\tsetBoundedLoaderState(path, {\n\t\t...loaderState[path],\n\t\t...updates\n\t});\n\tsubscribers.forEach(function(callback) {\n\t\tcallback();\n\t});\n}\nfunction subscribe(callback) {\n\tsubscribers.add(callback);\n\treturn function() {\n\t\treturn subscribers.delete(callback);\n\t};\n}\nfunction getLoaderState(path, preloadedData) {\n\tif (!(path in loaderState)) setBoundedLoaderState(path, {\n\t\tdata: preloadedData,\n\t\terror: void 0,\n\t\tpromise: void 0,\n\t\tstate: \"idle\",\n\t\thasLoadedOnce: !!preloadedData\n\t});\n\treturn loaderState[path];\n}\nasync function refetchLoader(pathname) {\n\tvar startTime = performance.now();\n\tupdateState(pathname, {\n\t\tstate: \"loading\",\n\t\terror: null\n\t});\n\ttry {\n\t\tvar _dynamicImport;\n\t\tvar loaderJSUrl = getLoaderPath(pathname, true, `${Date.now()}`);\n\t\tvar moduleLoadStart = performance.now();\n\t\tvar module = await ((_dynamicImport = dynamicImport(loaderJSUrl)) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\t\treturn null;\n\t\t}));\n\t\tvar moduleLoadTime = performance.now() - moduleLoadStart;\n\t\tif (!(module === null || module === void 0 ? void 0 : module.loader)) {\n\t\t\tupdateState(pathname, {\n\t\t\t\tdata: void 0,\n\t\t\t\tstate: \"idle\",\n\t\t\t\thasLoadedOnce: true\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tvar executionStart = performance.now();\n\t\tvar result = await module.loader();\n\t\tvar executionTime = performance.now() - executionStart;\n\t\tvar totalTime = performance.now() - startTime;\n\t\tif (result === null || result === void 0 ? void 0 : result.__oneRedirect) {\n\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\tpath: pathname,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"refetch\"\n\t\t\t});\n\t\t\tupdateState(pathname, {\n\t\t\t\tdata: void 0,\n\t\t\t\tstate: \"idle\",\n\t\t\t\thasLoadedOnce: true\n\t\t\t});\n\t\t\trouter.replace(result.__oneRedirect);\n\t\t\treturn;\n\t\t}\n\t\tif ((result === null || result === void 0 ? void 0 : result.__oneError) === 404) {\n\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\tpath: pathname,\n\t\t\t\tstartTime,\n\t\t\t\tmoduleLoadTime,\n\t\t\t\texecutionTime,\n\t\t\t\ttotalTime,\n\t\t\t\tsource: \"refetch\"\n\t\t\t});\n\t\t\tvar notFoundRoute = findNearestNotFoundRoute(pathname, routeNode);\n\t\t\tsetNotFoundState({\n\t\t\t\tnotFoundPath: result.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\t\toriginalPath: pathname\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tupdateState(pathname, {\n\t\t\tdata: result,\n\t\t\tstate: \"idle\",\n\t\t\ttimestamp: Date.now(),\n\t\t\thasLoadedOnce: true\n\t\t});\n\t\tvar currentMatches = getClientMatchesSnapshot();\n\t\tvar pageMatch = currentMatches[currentMatches.length - 1];\n\t\tvar normalizedPathname = pathname.replace(/\\/$/, \"\") || \"/\";\n\t\tvar normalizedMatchPathname = ((pageMatch === null || pageMatch === void 0 ? void 0 : pageMatch.pathname) || \"\").replace(/\\/$/, \"\") || \"/\";\n\t\tif (pageMatch && normalizedMatchPathname === normalizedPathname) updateMatchLoaderData(pageMatch.routeId, result);\n\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\tpath: pathname,\n\t\t\tstartTime,\n\t\t\tmoduleLoadTime,\n\t\t\texecutionTime,\n\t\t\ttotalTime,\n\t\t\tsource: \"refetch\"\n\t\t});\n\t} catch (err) {\n\t\tvar totalTime1 = performance.now() - startTime;\n\t\tupdateState(pathname, {\n\t\t\terror: err,\n\t\t\tstate: \"idle\"\n\t\t});\n\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\tpath: pathname,\n\t\t\tstartTime,\n\t\t\ttotalTime: totalTime1,\n\t\t\terror: _instanceof(err, Error) ? err.message : String(err),\n\t\t\tsource: \"refetch\"\n\t\t});\n\t\tthrow err;\n\t}\n}\nif (process.env.NODE_ENV === \"development\" && typeof window !== \"undefined\") window.__oneRefetchLoader = refetchLoader;\nasync function refetchMatchLoader(routeId, currentPath) {\n\tvar _dynamicImport;\n\tvar module = await ((_dynamicImport = dynamicImport(getLoaderPath(currentPath, true, `${Date.now()}`))) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\treturn null;\n\t}));\n\tif (!(module === null || module === void 0 ? void 0 : module.loader)) return;\n\tvar result = await module.loader();\n\tif ((result === null || result === void 0 ? void 0 : result.__oneRedirect) || (result === null || result === void 0 ? void 0 : result.__oneError)) return;\n\tupdateMatchLoaderData(routeId, result);\n}\nfunction useLoaderState(loader) {\n\tvar { loaderProps: loaderPropsFromServerContext, loaderData: loaderDataFromServerContext } = useServerContext() || {};\n\tvar params = useParams();\n\tvar pathname = usePathname();\n\tvar currentPath = pathname.replace(/\\/index$/, \"\").replace(/\\/$/, \"\") || \"/\";\n\tif (typeof window === \"undefined\") {\n\t\tif (loader) {\n\t\t\tif (ssrLoaderData.has(loader)) return {\n\t\t\t\tdata: ssrLoaderData.get(loader),\n\t\t\t\trefetch: async function() {},\n\t\t\t\tstate: \"idle\"\n\t\t\t};\n\t\t\tvar serverContext = useServerContext();\n\t\t\tif (serverContext === null || serverContext === void 0 ? void 0 : serverContext.matches) {\n\t\t\t\tvar contextKey = useContextKey();\n\t\t\t\tvar match = serverContext.matches.find(function(m) {\n\t\t\t\t\treturn getContextKey(m.routeId) === contextKey;\n\t\t\t\t});\n\t\t\t\tif (match && match.loaderData !== void 0) return {\n\t\t\t\t\tdata: match.loaderData,\n\t\t\t\t\trefetch: async function() {},\n\t\t\t\t\tstate: \"idle\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: useAsyncFn(loader, loaderPropsFromServerContext || {\n\t\t\t\t\tpath: pathname,\n\t\t\t\t\tparams\n\t\t\t\t}),\n\t\t\t\trefetch: async function() {},\n\t\t\t\tstate: \"idle\"\n\t\t\t};\n\t\t}\n\t\tif (loaderDataFromServerContext !== void 0) return {\n\t\t\tdata: loaderDataFromServerContext,\n\t\t\trefetch: async function() {},\n\t\t\tstate: \"idle\"\n\t\t};\n\t}\n\tvar matchRouteId = loader ? (function() {\n\t\tvar result = loader();\n\t\treturn typeof result === \"string\" && result.startsWith(\"./\") ? result : null;\n\t})() : null;\n\tvar clientMatches = useSyncExternalStore(subscribeToClientMatches, getClientMatchesSnapshot, getClientMatchesSnapshot);\n\tvar preloadedData = (loaderPropsFromServerContext === null || loaderPropsFromServerContext === void 0 ? void 0 : loaderPropsFromServerContext.path) === currentPath ? loaderDataFromServerContext : void 0;\n\tvar loaderStateEntry = useSyncExternalStore(subscribe, function() {\n\t\treturn getLoaderState(currentPath, preloadedData);\n\t}, function() {\n\t\treturn getLoaderState(currentPath, preloadedData);\n\t});\n\tvar refetch = useCallback(function() {\n\t\treturn refetchLoader(currentPath);\n\t}, [currentPath]);\n\tif (matchRouteId) {\n\t\tvar _clientMatches_;\n\t\tvar match1 = clientMatches.find(function(m) {\n\t\t\treturn m.routeId === matchRouteId;\n\t\t});\n\t\tvar isPageMatch = clientMatches.length > 0 && ((_clientMatches_ = clientMatches[clientMatches.length - 1]) === null || _clientMatches_ === void 0 ? void 0 : _clientMatches_.routeId) === matchRouteId;\n\t\tvar matchPathNormalized = ((match1 === null || match1 === void 0 ? void 0 : match1.pathname) || \"\").replace(/\\/$/, \"\") || \"/\";\n\t\tvar matchPathFresh = !isPageMatch || matchPathNormalized === currentPath;\n\t\tif (match1 && match1.loaderData != null && matchPathFresh) return {\n\t\t\tdata: match1.loaderData,\n\t\t\trefetch: async function() {\n\t\t\t\tawait refetchLoader(currentPath);\n\t\t\t\tvar fresh = loaderState[currentPath];\n\t\t\t\tif ((fresh === null || fresh === void 0 ? void 0 : fresh.data) != null) updateMatchLoaderData(matchRouteId, fresh.data);\n\t\t\t},\n\t\t\tstate: loaderStateEntry.state\n\t\t};\n\t}\n\tif (!loader) return {\n\t\trefetch,\n\t\tstate: loaderStateEntry.state\n\t};\n\tif (!loaderStateEntry.data && !loaderStateEntry.promise && !loaderStateEntry.hasLoadedOnce) {\n\t\tvar resolvedPreloadData = preloadedLoaderData[currentPath];\n\t\tif (resolvedPreloadData != null) {\n\t\t\tdelete preloadedLoaderData[currentPath];\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tloaderStateEntry.data = resolvedPreloadData;\n\t\t\tloaderStateEntry.hasLoadedOnce = true;\n\t\t} else if (preloadingLoader[currentPath]) loaderStateEntry.promise = preloadingLoader[currentPath].then(function(val) {\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tdelete preloadedLoaderData[currentPath];\n\t\t\tif (val != null) updateState(currentPath, {\n\t\t\t\tdata: val,\n\t\t\t\thasLoadedOnce: true,\n\t\t\t\tpromise: void 0\n\t\t\t});\n\t\t\telse updateState(currentPath, { promise: void 0 });\n\t\t}).catch(function(err) {\n\t\t\tconsole.error(`Error running loader()`, err);\n\t\t\tdelete preloadingLoader[currentPath];\n\t\t\tupdateState(currentPath, {\n\t\t\t\terror: err,\n\t\t\t\tpromise: void 0\n\t\t\t});\n\t\t});\n\t\telse {\n\t\t\tvar loadData = async function() {\n\t\t\t\tvar startTime = performance.now();\n\t\t\t\ttry {\n\t\t\t\t\tvar _dynamicImport;\n\t\t\t\t\tvar nativeLoaderJSUrl;\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\") nativeLoaderJSUrl = `${getLoaderPath(currentPath, true)}?platform=native`;\n\t\t\t\t\telse nativeLoaderJSUrl = `${getURL()}/assets/${currentPath.slice(1).replace(/\\/$/, \"\").replaceAll(\"_\", \"__\").replaceAll(\"/\", \"_\")}${LOADER_JS_POSTFIX_UNCACHED.replace(\".js\", \".native.js\")}`;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar moduleLoadStart = performance.now();\n\t\t\t\t\t\tvar controller = new AbortController();\n\t\t\t\t\t\tvar timeoutId = setTimeout(function() {\n\t\t\t\t\t\t\treturn controller.abort();\n\t\t\t\t\t\t}, LOADER_TIMEOUT);\n\t\t\t\t\t\tvar loaderJsCode;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar loaderJsCodeResp = await fetch(nativeLoaderJSUrl, { signal: controller.signal });\n\t\t\t\t\t\t\tif (!loaderJsCodeResp.ok) throw new Error(`Response not ok: ${loaderJsCodeResp.status}`);\n\t\t\t\t\t\t\tloaderJsCode = await loaderJsCodeResp.text();\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar result = {};\n\t\t\t\t\t\tnew Function(\"exports\", loaderJsCode)(result);\n\t\t\t\t\t\tvar moduleLoadTime = performance.now() - moduleLoadStart;\n\t\t\t\t\t\tif (typeof result.loader !== \"function\") throw new Error(\"Loader code isn't exporting a `loader` function\");\n\t\t\t\t\t\tvar executionStart = performance.now();\n\t\t\t\t\t\tvar data = await result.loader();\n\t\t\t\t\t\tvar executionTime = performance.now() - executionStart;\n\t\t\t\t\t\tvar totalTime = performance.now() - startTime;\n\t\t\t\t\t\tif (data === null || data === void 0 ? void 0 : data.__oneRedirect) {\n\t\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\trouter.replace(data.__oneRedirect);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((data === null || data === void 0 ? void 0 : data.__oneError) === 404) {\n\t\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tvar notFoundRoute = findNearestNotFoundRoute(currentPath, routeNode);\n\t\t\t\t\t\t\tsetNotFoundState({\n\t\t\t\t\t\t\t\tnotFoundPath: data.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\t\t\t\t\tnotFoundRouteNode: notFoundRoute || void 0,\n\t\t\t\t\t\t\t\toriginalPath: currentPath\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime,\n\t\t\t\t\t\t\texecutionTime,\n\t\t\t\t\t\t\ttotalTime,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(`[one] native loader error for ${currentPath}:`, _instanceof(e, Error) ? e.message : e, `url: ${nativeLoaderJSUrl}`);\n\t\t\t\t\t\tvar totalTime1 = performance.now() - startTime;\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: {},\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\ttotalTime: totalTime1,\n\t\t\t\t\t\t\terror: _instanceof(e, Error) ? e.message : String(e),\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar loaderJSUrl = getLoaderPath(currentPath, true);\n\t\t\t\t\tvar moduleLoadStart1 = performance.now();\n\t\t\t\t\tvar module = await ((_dynamicImport = dynamicImport(loaderJSUrl)) === null || _dynamicImport === void 0 ? void 0 : _dynamicImport.catch(function() {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}));\n\t\t\t\t\tvar moduleLoadTime1 = performance.now() - moduleLoadStart1;\n\t\t\t\t\tif (!(module === null || module === void 0 ? void 0 : module.loader)) {\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar executionStart1 = performance.now();\n\t\t\t\t\tvar result1 = await module.loader();\n\t\t\t\t\tvar executionTime1 = performance.now() - executionStart1;\n\t\t\t\t\tvar totalTime2 = performance.now() - startTime;\n\t\t\t\t\tif (result1 === null || result1 === void 0 ? void 0 : result1.__oneRedirect) {\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t\t});\n\t\t\t\t\t\trouter.replace(result1.__oneRedirect);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ((result1 === null || result1 === void 0 ? void 0 : result1.__oneError) === 404) {\n\t\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar notFoundRoute1 = findNearestNotFoundRoute(currentPath, routeNode);\n\t\t\t\t\t\tsetNotFoundState({\n\t\t\t\t\t\t\tnotFoundPath: result1.__oneNotFoundPath || \"/+not-found\",\n\t\t\t\t\t\t\tnotFoundRouteNode: notFoundRoute1 || void 0,\n\t\t\t\t\t\t\toriginalPath: currentPath\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\tdata: result1,\n\t\t\t\t\t\thasLoadedOnce: true,\n\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t});\n\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\tmoduleLoadTime: moduleLoadTime1,\n\t\t\t\t\t\texecutionTime: executionTime1,\n\t\t\t\t\t\ttotalTime: totalTime2,\n\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\tvar totalTime3 = performance.now() - startTime;\n\t\t\t\t\tupdateState(currentPath, {\n\t\t\t\t\t\terror: err,\n\t\t\t\t\t\tpromise: void 0\n\t\t\t\t\t});\n\t\t\t\t\trecordLoaderTiming === null || recordLoaderTiming === void 0 || recordLoaderTiming({\n\t\t\t\t\t\tpath: currentPath,\n\t\t\t\t\t\tstartTime,\n\t\t\t\t\t\ttotalTime: totalTime3,\n\t\t\t\t\t\terror: _instanceof(err, Error) ? err.message : String(err),\n\t\t\t\t\t\tsource: \"initial\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t\tloaderStateEntry.promise = loadData();\n\t\t}\n\t}\n\tif (loaderStateEntry.error && !loaderStateEntry.hasLoadedOnce) throw loaderStateEntry.error;\n\tif (loaderStateEntry.data === void 0 && loaderStateEntry.promise && !loaderStateEntry.hasLoadedOnce) throw loaderStateEntry.promise;\n\treturn {\n\t\tdata: loaderStateEntry.data,\n\t\trefetch,\n\t\tstate: loaderStateEntry.state\n\t};\n}\nfunction useLoader(loader) {\n\tvar { data } = useLoaderState(loader);\n\treturn data;\n}\nvar results = /* @__PURE__ */ new Map();\nvar started = /* @__PURE__ */ new Map();\nvar USE_ASYNC_FN_CACHE_MAX = 100;\nfunction setBoundedResults(key, value) {\n\tif (results.size >= USE_ASYNC_FN_CACHE_MAX && !results.has(key)) {\n\t\tvar firstKey = results.keys().next().value;\n\t\tif (firstKey !== void 0) {\n\t\t\tresults.delete(firstKey);\n\t\t\tstarted.delete(firstKey);\n\t\t}\n\t}\n\tresults.set(key, value);\n}\nfunction resetLoaderState() {\n\tresults.clear();\n\tstarted.clear();\n}\nfunction useAsyncFn(val, props) {\n\tvar key = (val ? weakKey(val) : \"\") + JSON.stringify(props);\n\tif (val) {\n\t\tif (!started.get(key)) {\n\t\t\tstarted.set(key, true);\n\t\t\tvar next = val(props);\n\t\t\tif (_instanceof(next, Promise)) next = next.then(function(final) {\n\t\t\t\tsetBoundedResults(key, final);\n\t\t\t}).catch(function(err) {\n\t\t\t\tconsole.error(`Error running loader()`, err);\n\t\t\t\tsetBoundedResults(key, void 0);\n\t\t\t});\n\t\t\tsetBoundedResults(key, next);\n\t\t}\n\t}\n\tvar current = results.get(key);\n\tif (_instanceof(current, Promise)) throw current;\n\treturn current;\n}\n\nexport { getLoaderTimingHistory, refetchLoader, refetchMatchLoader, resetLoaderState, setSSRLoaderData, useLoader, useLoaderState };"],"mappings":"AAAA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AACzD,SAASC,wBAAwB,QAAQ,+BAAqB;AAC9D,SAASC,SAAS,EAAEC,WAAW,QAAQ,mBAAS;AAChD,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,2BAAiB;AAC5E,SAASC,aAAa,QAAQ,0BAAgB;AAC9C,SAASC,aAAa,QAAQ,6BAAmB;AACjD,SAASC,MAAM,QAAQ,mCAAyB;AAChD,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,SAAS,QAAQ,2BAAiB;AAClF,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,kCAAwB;AACxE,SAASC,wBAAwB,EAAEC,wBAAwB,EAAEC,qBAAqB,QAAQ,wBAAc;AACxG,SAASC,aAAa,QAAQ,4BAAkB;AAChD,SAASC,MAAM,QAAQ,oBAAU;AACjC,SAASC,0BAA0B,QAAQ,uBAAa;AACxD,SAASC,aAAa,QAAQ,iCAAuB;AACrD,SAASC,OAAO,QAAQ,2BAAiB;AACzC,SAASC,gBAAgB,QAAQ,kCAAwB;AAEzD,SAASC,WAAWA,CAACC,IAAI,EAAEC,KAAK,EAAE;EACjC,IAAIA,KAAK,IAAI,IAAI,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAID,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,EAAE,OAAO,CAAC,CAACF,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,CAACH,IAAI,CAAC,CAAC,KACrH,OAAOA,IAAI,YAAYC,KAAK;AAClC;AACA,IAAIG,cAAc,GAAGC,OAAO,CAACC,GAAG,CAACC,qBAAqB,GAAG,CAACF,OAAO,CAACC,GAAG,CAACC,qBAAqB,GAAG,GAAG;AACjG,IAAIC,mBAAmB,GAAG,EAAE;AAC5B,IAAIC,kBAAkB,GAAG,EAAE;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AAC;QAC5CqE,iBAAiB,CAACC,GAAG,EAAE,KAAK,CAAC,CAAC;MAC/B,CAAC,CAAC;MACFD,iBAAiB,CAACC,GAAG,EAAEK,IAAI,CAAC;IAC7B;EACD;EACA,IAAIS,OAAO,GAAGnB,OAAO,CAACnD,GAAG,CAACwD,GAAG,CAAC;EAC9B,IAAIxJ,WAAW,CAACsK,OAAO,EAAEF,OAAO,CAAC,EAAE,MAAME,OAAO;EAChD,OAAOA,OAAO;AACf;AAEA,SAASvI,sBAAsB,EAAEuB,aAAa,EAAEiC,kBAAkB,EAAEwE,gBAAgB,EAAE1K,gBAAgB,EAAE6J,SAAS,EAAEzD,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "one",
3
- "version": "1.18.2",
3
+ "version": "1.18.4",
4
4
  "license": "BSD-3-Clause",
5
5
  "sideEffects": [
6
6
  "setup.mjs",
@@ -186,18 +186,18 @@
186
186
  "@cloudflare/vite-plugin": "^1.33.1",
187
187
  "@swc/core": "^1.14.0",
188
188
  "@ungap/structured-clone": "^1.2.0",
189
- "@vxrn/color-scheme": "1.18.2",
190
- "@vxrn/compiler": "1.18.2",
191
- "@vxrn/resolve": "1.18.2",
192
- "@vxrn/tslib-lite": "1.18.2",
193
- "@vxrn/use-isomorphic-layout-effect": "1.18.2",
194
- "@vxrn/vite-plugin-metro": "1.18.2",
189
+ "@vxrn/color-scheme": "1.18.4",
190
+ "@vxrn/compiler": "1.18.4",
191
+ "@vxrn/resolve": "1.18.4",
192
+ "@vxrn/tslib-lite": "1.18.4",
193
+ "@vxrn/use-isomorphic-layout-effect": "1.18.4",
194
+ "@vxrn/vite-plugin-metro": "1.18.4",
195
195
  "babel-dead-code-elimination": "1.0.10",
196
196
  "babel-plugin-module-resolver": "^5.0.2",
197
197
  "babel-preset-expo": "~55.0.0",
198
198
  "citty": "^0.1.6",
199
199
  "core-js": "^3.38.1",
200
- "create-vxrn": "1.18.2",
200
+ "create-vxrn": "1.18.4",
201
201
  "escape-string-regexp": "^5.0.0",
202
202
  "expo-linking": "~55.0.7",
203
203
  "expo-modules-core": "~55.0.16",
@@ -217,7 +217,7 @@
217
217
  "tsconfig-paths": "^4",
218
218
  "use-latest-callback": "^0.2.3",
219
219
  "vite": "^8.0.13",
220
- "vxrn": "1.18.2",
220
+ "vxrn": "1.18.4",
221
221
  "ws": "^8.18.0",
222
222
  "xxhashjs": "^0.2.2"
223
223
  },
@@ -0,0 +1,30 @@
1
+ import { createRequire } from 'node:module'
2
+ import { describe, expect, it } from 'vitest'
3
+ import { NativeTabs } from './NativeTabs'
4
+
5
+ const require = createRequire(import.meta.url)
6
+
7
+ function hasNativeTabsPeer() {
8
+ try {
9
+ require.resolve('@bottom-tabs/react-navigation')
10
+ return true
11
+ } catch {
12
+ return false
13
+ }
14
+ }
15
+
16
+ describe('NativeTabs optional peer', () => {
17
+ it('does not throw during ordinary import-time inspection', () => {
18
+ expect(() => Object.prototype.toString.call(NativeTabs)).not.toThrow()
19
+ expect(() => Reflect.get(NativeTabs, '$$typeof')).not.toThrow()
20
+ expect(() => Reflect.get(NativeTabs, 'Screen')).not.toThrow()
21
+ })
22
+
23
+ it('keeps the missing-peer error on actual render use', () => {
24
+ if (hasNativeTabsPeer()) return
25
+
26
+ expect(() => (NativeTabs as any).render({}, null)).toThrow(
27
+ 'NativeTabs requires @bottom-tabs/react-navigation and react-native-bottom-tabs'
28
+ )
29
+ })
30
+ })
@@ -1,7 +1,8 @@
1
1
  import type { ParamListBase, TabNavigationState } from '@react-navigation/native'
2
- import type React from 'react'
2
+ import React from 'react'
3
3
 
4
4
  import { Protected } from '../views/Protected'
5
+ import { Screen } from '../views/Screen'
5
6
  import { withLayoutContext } from './withLayoutContext'
6
7
 
7
8
  let NativeBottomTabNavigator: React.ComponentType<any> | null = null
@@ -17,12 +18,20 @@ type NativeTabsType = ReturnType<typeof withLayoutContext> & {
17
18
  Protected: typeof Protected
18
19
  }
19
20
 
21
+ const missingNativeTabsMessage =
22
+ 'NativeTabs requires @bottom-tabs/react-navigation and react-native-bottom-tabs.\n' +
23
+ 'Install: npx expo install @bottom-tabs/react-navigation react-native-bottom-tabs'
24
+
25
+ const MissingNativeTabs = React.forwardRef<unknown, any>(function MissingNativeTabs(): never {
26
+ throw new Error(missingNativeTabsMessage)
27
+ })
28
+
20
29
  function createNativeTabs(): NativeTabsType {
21
30
  if (!NativeBottomTabNavigator) {
22
- throw new Error(
23
- 'NativeTabs requires @bottom-tabs/react-navigation and react-native-bottom-tabs.\n' +
24
- 'Install: npx expo install @bottom-tabs/react-navigation react-native-bottom-tabs'
25
- )
31
+ return Object.assign(MissingNativeTabs, {
32
+ Protected,
33
+ Screen,
34
+ }) as NativeTabsType
26
35
  }
27
36
 
28
37
  return Object.assign(withLayoutContext(NativeBottomTabNavigator), {
@@ -30,17 +39,6 @@ function createNativeTabs(): NativeTabsType {
30
39
  }) as NativeTabsType
31
40
  }
32
41
 
33
- let _nativeTabs: NativeTabsType | null = null
34
-
35
- export const NativeTabs = new Proxy({} as NativeTabsType, {
36
- get(_, prop) {
37
- if (!_nativeTabs) _nativeTabs = createNativeTabs()
38
- return (_nativeTabs as any)[prop]
39
- },
40
- apply(_, thisArg, args) {
41
- if (!_nativeTabs) _nativeTabs = createNativeTabs()
42
- return (_nativeTabs as any).apply(thisArg, args)
43
- },
44
- })
42
+ export const NativeTabs = createNativeTabs()
45
43
 
46
44
  export default NativeTabs
@@ -1,4 +1,4 @@
1
- import { useNavigation } from '@react-navigation/native'
1
+ import { useNavigation, usePreventRemove } from '@react-navigation/native'
2
2
  import * as React from 'react'
3
3
 
4
4
  export type BlockerState = 'unblocked' | 'blocked' | 'proceeding'
@@ -32,9 +32,12 @@ export type Blocker =
32
32
  /**
33
33
  * Block navigation when a condition is met.
34
34
  *
35
- * On native, this uses React Navigation's `beforeRemove` event to prevent navigation.
36
- * Note that this only works for navigation within the app - it cannot prevent
37
- * the app from being closed or backgrounded.
35
+ * On native, this uses React Navigation's `usePreventRemove`, which registers the
36
+ * route with the native stack so the iOS interactive swipe-back gesture is blocked
37
+ * too (via `preventNativeDismiss`), not just JS-driven pops. A raw `beforeRemove`
38
+ * listener only stops JS-driven pops, so swiping would bypass the guard and desync
39
+ * JS<->native state. Note that this only works for navigation within the app - it
40
+ * cannot prevent the app from being closed or backgrounded.
38
41
  *
39
42
  * @param shouldBlock - Either a boolean or a function that returns whether to block.
40
43
  *
@@ -63,67 +66,43 @@ export type Blocker =
63
66
  export function useBlocker(shouldBlock: BlockerFunction | boolean): Blocker {
64
67
  const navigation = useNavigation()
65
68
  const [state, setState] = React.useState<BlockerState>('unblocked')
66
- const [pendingEvent, setPendingEvent] = React.useState<any>(null)
69
+ const [pendingAction, setPendingAction] = React.useState<any>(null)
67
70
  const [blockedLocation, setBlockedLocation] = React.useState<string | null>(null)
68
71
 
69
- const shouldBlockRef = React.useRef(shouldBlock)
70
- shouldBlockRef.current = shouldBlock
72
+ // native has no current location and the gesture/back button are always a pop
73
+ const block =
74
+ typeof shouldBlock === 'function'
75
+ ? shouldBlock({ currentLocation: '', nextLocation: 'previous screen', historyAction: 'pop' })
76
+ : shouldBlock
71
77
 
72
- React.useEffect(() => {
73
- const unsubscribe = navigation.addListener('beforeRemove', (e) => {
74
- const currentShouldBlock = shouldBlockRef.current
75
-
76
- // Get the next location from the action payload
77
- const payload = e.data?.action?.payload as { name?: string } | undefined
78
- const nextLocation = payload?.name || 'previous screen'
79
-
80
- // Determine if we should block
81
- const block =
82
- typeof currentShouldBlock === 'function'
83
- ? currentShouldBlock({
84
- currentLocation: '', // Not easily available on native
85
- nextLocation,
86
- historyAction: 'pop',
87
- })
88
- : currentShouldBlock
89
-
90
- if (!block) {
91
- return
92
- }
93
-
94
- // Prevent default behavior (leaving the screen)
95
- e.preventDefault()
96
-
97
- // Store the event to dispatch later if user confirms
98
- setPendingEvent(e)
99
- setBlockedLocation(nextLocation)
100
- setState('blocked')
101
- })
102
-
103
- return unsubscribe
104
- }, [navigation])
78
+ usePreventRemove(block, ({ data }) => {
79
+ const payload = data?.action?.payload as { name?: string } | undefined
80
+ setPendingAction(data.action)
81
+ setBlockedLocation(payload?.name || 'previous screen')
82
+ setState('blocked')
83
+ })
105
84
 
106
85
  const reset = React.useCallback(() => {
107
- setPendingEvent(null)
86
+ setPendingAction(null)
108
87
  setBlockedLocation(null)
109
88
  setState('unblocked')
110
89
  }, [])
111
90
 
112
91
  const proceed = React.useCallback(() => {
113
- if (!pendingEvent) return
92
+ if (!pendingAction) return
114
93
 
115
94
  setState('proceeding')
116
95
 
117
- // Dispatch the original action to complete navigation
118
- navigation.dispatch(pendingEvent.data.action)
96
+ // the captured action carries a VISITED_ROUTE_KEYS marker, so re-dispatching
97
+ // it skips the beforeRemove guard and navigation completes without re-blocking
98
+ navigation.dispatch(pendingAction)
119
99
 
120
- // Reset after navigation
121
100
  setTimeout(() => {
122
- setPendingEvent(null)
101
+ setPendingAction(null)
123
102
  setBlockedLocation(null)
124
103
  setState('unblocked')
125
104
  }, 100)
126
- }, [navigation, pendingEvent])
105
+ }, [navigation, pendingAction])
127
106
 
128
107
  if (state === 'unblocked') {
129
108
  return { state: 'unblocked' }
@@ -142,7 +121,7 @@ export function useBlocker(shouldBlock: BlockerFunction | boolean): Blocker {
142
121
  }
143
122
 
144
123
  /**
145
- * No-op on native - native uses React Navigation's beforeRemove event instead.
124
+ * No-op on native - native uses React Navigation's usePreventRemove instead.
146
125
  * This is only used by the router on web.
147
126
  */
148
127
  export function checkBlocker(
package/src/useLoader.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  updateMatchLoaderData,
14
14
  } from './useMatches'
15
15
  import { getLoaderPath } from './utils/cleanUrl'
16
+ import { getURL } from './getURL'
16
17
  import { LOADER_JS_POSTFIX_UNCACHED } from './constants'
17
18
  import { dynamicImport } from './utils/dynamicImport'
18
19
  import { weakKey } from './utils/weakKey'
@@ -509,8 +510,10 @@ export function useLoaderState<
509
510
  nativeLoaderJSUrl = `${getLoaderPath(currentPath, true)}?platform=native`
510
511
  } else {
511
512
  // prod: request the .native.js static file directly
512
- // use uncached postfix since metro can't inline ONE_CACHE_KEY
513
- const { getURL } = require('./getURL')
513
+ // use uncached postfix since metro can't inline ONE_CACHE_KEY.
514
+ // must use the static import — a dynamic require('./getURL') is
515
+ // left as a runtime string require by metro and resolves to
516
+ // undefined in the prod native bundle (crashes the route).
514
517
  const base = getURL()
515
518
  const cleanedPath = currentPath
516
519
  .slice(1)
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabs.d.ts","sourceRoot":"","sources":["../../src/layouts/NativeTabs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAWvD,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,GAAG;IAC3D,SAAS,EAAE,OAAO,SAAS,CAAA;CAC5B,CAAA;AAiBD,eAAO,MAAM,UAAU,gBASrB,CAAA;AAEF,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"NativeTabs.d.ts","sourceRoot":"","sources":["../../src/layouts/NativeTabs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAWvD,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,GAAG;IAC3D,SAAS,EAAE,OAAO,SAAS,CAAA;CAC5B,CAAA;AAuBD,eAAO,MAAM,UAAU,gBAAqB,CAAA;AAE5C,eAAe,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NativeTabs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeTabs.test.d.ts","sourceRoot":"","sources":["../../src/layouts/NativeTabs.test.ts"],"names":[],"mappings":""}