@depup/tanstack__react-router 1.167.1-depup.0 → 1.167.3-depup.0

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 (195) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/Asset.cjs +115 -174
  3. package/dist/cjs/Asset.cjs.map +1 -1
  4. package/dist/cjs/CatchBoundary.cjs +92 -108
  5. package/dist/cjs/CatchBoundary.cjs.map +1 -1
  6. package/dist/cjs/ClientOnly.cjs +47 -13
  7. package/dist/cjs/ClientOnly.cjs.map +1 -1
  8. package/dist/cjs/HeadContent.cjs +23 -12
  9. package/dist/cjs/HeadContent.cjs.map +1 -1
  10. package/dist/cjs/HeadContent.dev.cjs +33 -38
  11. package/dist/cjs/HeadContent.dev.cjs.map +1 -1
  12. package/dist/cjs/Match.cjs +190 -247
  13. package/dist/cjs/Match.cjs.map +1 -1
  14. package/dist/cjs/Matches.cjs +131 -118
  15. package/dist/cjs/Matches.cjs.map +1 -1
  16. package/dist/cjs/RouterProvider.cjs +43 -27
  17. package/dist/cjs/RouterProvider.cjs.map +1 -1
  18. package/dist/cjs/SafeFragment.cjs +9 -5
  19. package/dist/cjs/SafeFragment.cjs.map +1 -1
  20. package/dist/cjs/ScriptOnce.cjs +17 -19
  21. package/dist/cjs/ScriptOnce.cjs.map +1 -1
  22. package/dist/cjs/Scripts.cjs +56 -54
  23. package/dist/cjs/Scripts.cjs.map +1 -1
  24. package/dist/cjs/ScrollRestoration.cjs +26 -30
  25. package/dist/cjs/ScrollRestoration.cjs.map +1 -1
  26. package/dist/cjs/Transitioner.cjs +109 -116
  27. package/dist/cjs/Transitioner.cjs.map +1 -1
  28. package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
  29. package/dist/cjs/awaited.cjs +28 -43
  30. package/dist/cjs/awaited.cjs.map +1 -1
  31. package/dist/cjs/fileRoute.cjs +133 -95
  32. package/dist/cjs/fileRoute.cjs.map +1 -1
  33. package/dist/cjs/headContentUtils.cjs +144 -181
  34. package/dist/cjs/headContentUtils.cjs.map +1 -1
  35. package/dist/cjs/index.cjs +249 -178
  36. package/dist/cjs/index.dev.cjs +249 -178
  37. package/dist/cjs/lazyRouteComponent.cjs +52 -67
  38. package/dist/cjs/lazyRouteComponent.cjs.map +1 -1
  39. package/dist/cjs/link.cjs +462 -556
  40. package/dist/cjs/link.cjs.map +1 -1
  41. package/dist/cjs/matchContext.cjs +9 -25
  42. package/dist/cjs/matchContext.cjs.map +1 -1
  43. package/dist/cjs/not-found.cjs +25 -32
  44. package/dist/cjs/not-found.cjs.map +1 -1
  45. package/dist/cjs/renderRouteNotFound.cjs +25 -19
  46. package/dist/cjs/renderRouteNotFound.cjs.map +1 -1
  47. package/dist/cjs/route.cjs +258 -178
  48. package/dist/cjs/route.cjs.map +1 -1
  49. package/dist/cjs/router.cjs +29 -16
  50. package/dist/cjs/router.cjs.map +1 -1
  51. package/dist/cjs/routerContext.cjs +8 -22
  52. package/dist/cjs/routerContext.cjs.map +1 -1
  53. package/dist/cjs/scroll-restoration.cjs +23 -36
  54. package/dist/cjs/scroll-restoration.cjs.map +1 -1
  55. package/dist/cjs/ssr/RouterClient.cjs +16 -22
  56. package/dist/cjs/ssr/RouterClient.cjs.map +1 -1
  57. package/dist/cjs/ssr/RouterServer.cjs +10 -6
  58. package/dist/cjs/ssr/RouterServer.cjs.map +1 -1
  59. package/dist/cjs/ssr/client.cjs +10 -10
  60. package/dist/cjs/ssr/defaultRenderHandler.cjs +13 -14
  61. package/dist/cjs/ssr/defaultRenderHandler.cjs.map +1 -1
  62. package/dist/cjs/ssr/defaultStreamHandler.cjs +14 -15
  63. package/dist/cjs/ssr/defaultStreamHandler.cjs.map +1 -1
  64. package/dist/cjs/ssr/renderRouterToStream.cjs +51 -71
  65. package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -1
  66. package/dist/cjs/ssr/renderRouterToString.cjs +26 -29
  67. package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -1
  68. package/dist/cjs/ssr/server.cjs +18 -18
  69. package/dist/cjs/useBlocker.cjs +126 -162
  70. package/dist/cjs/useBlocker.cjs.map +1 -1
  71. package/dist/cjs/useCanGoBack.cjs +6 -5
  72. package/dist/cjs/useCanGoBack.cjs.map +1 -1
  73. package/dist/cjs/useLoaderData.cjs +24 -12
  74. package/dist/cjs/useLoaderData.cjs.map +1 -1
  75. package/dist/cjs/useLoaderDeps.cjs +23 -11
  76. package/dist/cjs/useLoaderDeps.cjs.map +1 -1
  77. package/dist/cjs/useLocation.cjs +17 -7
  78. package/dist/cjs/useLocation.cjs.map +1 -1
  79. package/dist/cjs/useMatch.cjs +25 -44
  80. package/dist/cjs/useMatch.cjs.map +1 -1
  81. package/dist/cjs/useNavigate.cjs +53 -43
  82. package/dist/cjs/useNavigate.cjs.map +1 -1
  83. package/dist/cjs/useParams.cjs +27 -14
  84. package/dist/cjs/useParams.cjs.map +1 -1
  85. package/dist/cjs/useRouteContext.cjs +9 -8
  86. package/dist/cjs/useRouteContext.cjs.map +1 -1
  87. package/dist/cjs/useRouter.cjs +23 -29
  88. package/dist/cjs/useRouter.cjs.map +1 -1
  89. package/dist/cjs/useRouterState.cjs +40 -35
  90. package/dist/cjs/useRouterState.cjs.map +1 -1
  91. package/dist/cjs/useSearch.cjs +26 -13
  92. package/dist/cjs/useSearch.cjs.map +1 -1
  93. package/dist/cjs/utils.cjs +81 -51
  94. package/dist/cjs/utils.cjs.map +1 -1
  95. package/dist/esm/Asset.js +112 -156
  96. package/dist/esm/Asset.js.map +1 -1
  97. package/dist/esm/CatchBoundary.js +90 -92
  98. package/dist/esm/CatchBoundary.js.map +1 -1
  99. package/dist/esm/ClientOnly.js +45 -14
  100. package/dist/esm/ClientOnly.js.map +1 -1
  101. package/dist/esm/HeadContent.dev.js +31 -21
  102. package/dist/esm/HeadContent.dev.js.map +1 -1
  103. package/dist/esm/HeadContent.js +20 -11
  104. package/dist/esm/HeadContent.js.map +1 -1
  105. package/dist/esm/Match.js +181 -226
  106. package/dist/esm/Match.js.map +1 -1
  107. package/dist/esm/Matches.js +125 -103
  108. package/dist/esm/Matches.js.map +1 -1
  109. package/dist/esm/RouterProvider.js +41 -28
  110. package/dist/esm/RouterProvider.js.map +1 -1
  111. package/dist/esm/SafeFragment.js +8 -6
  112. package/dist/esm/SafeFragment.js.map +1 -1
  113. package/dist/esm/ScriptOnce.js +15 -18
  114. package/dist/esm/ScriptOnce.js.map +1 -1
  115. package/dist/esm/Scripts.js +55 -54
  116. package/dist/esm/Scripts.js.map +1 -1
  117. package/dist/esm/ScrollRestoration.js +25 -31
  118. package/dist/esm/ScrollRestoration.js.map +1 -1
  119. package/dist/esm/Transitioner.js +106 -98
  120. package/dist/esm/Transitioner.js.map +1 -1
  121. package/dist/esm/awaited.js +26 -27
  122. package/dist/esm/awaited.js.map +1 -1
  123. package/dist/esm/fileRoute.js +127 -96
  124. package/dist/esm/fileRoute.js.map +1 -1
  125. package/dist/esm/headContentUtils.js +141 -163
  126. package/dist/esm/headContentUtils.js.map +1 -1
  127. package/dist/esm/index.dev.js +16 -117
  128. package/dist/esm/index.js +18 -118
  129. package/dist/esm/lazyRouteComponent.js +50 -50
  130. package/dist/esm/lazyRouteComponent.js.map +1 -1
  131. package/dist/esm/link.js +459 -541
  132. package/dist/esm/link.js.map +1 -1
  133. package/dist/esm/matchContext.js +8 -10
  134. package/dist/esm/matchContext.js.map +1 -1
  135. package/dist/esm/not-found.js +22 -32
  136. package/dist/esm/not-found.js.map +1 -1
  137. package/dist/esm/renderRouteNotFound.js +21 -18
  138. package/dist/esm/renderRouteNotFound.js.map +1 -1
  139. package/dist/esm/route.js +249 -180
  140. package/dist/esm/route.js.map +1 -1
  141. package/dist/esm/router.js +28 -17
  142. package/dist/esm/router.js.map +1 -1
  143. package/dist/esm/routerContext.js +7 -6
  144. package/dist/esm/routerContext.js.map +1 -1
  145. package/dist/esm/scroll-restoration.js +21 -35
  146. package/dist/esm/scroll-restoration.js.map +1 -1
  147. package/dist/esm/ssr/RouterClient.js +14 -21
  148. package/dist/esm/ssr/RouterClient.js.map +1 -1
  149. package/dist/esm/ssr/RouterServer.js +8 -6
  150. package/dist/esm/ssr/RouterServer.js.map +1 -1
  151. package/dist/esm/ssr/client.js +1 -4
  152. package/dist/esm/ssr/defaultRenderHandler.js +12 -13
  153. package/dist/esm/ssr/defaultRenderHandler.js.map +1 -1
  154. package/dist/esm/ssr/defaultStreamHandler.js +13 -14
  155. package/dist/esm/ssr/defaultStreamHandler.js.map +1 -1
  156. package/dist/esm/ssr/renderRouterToStream.js +48 -70
  157. package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
  158. package/dist/esm/ssr/renderRouterToString.js +24 -29
  159. package/dist/esm/ssr/renderRouterToString.js.map +1 -1
  160. package/dist/esm/ssr/server.js +3 -10
  161. package/dist/esm/useBlocker.js +124 -146
  162. package/dist/esm/useBlocker.js.map +1 -1
  163. package/dist/esm/useCanGoBack.js +6 -5
  164. package/dist/esm/useCanGoBack.js.map +1 -1
  165. package/dist/esm/useLoaderData.js +24 -12
  166. package/dist/esm/useLoaderData.js.map +1 -1
  167. package/dist/esm/useLoaderDeps.js +23 -11
  168. package/dist/esm/useLoaderDeps.js.map +1 -1
  169. package/dist/esm/useLocation.js +17 -7
  170. package/dist/esm/useLocation.js.map +1 -1
  171. package/dist/esm/useMatch.js +21 -26
  172. package/dist/esm/useMatch.js.map +1 -1
  173. package/dist/esm/useNavigate.js +50 -26
  174. package/dist/esm/useNavigate.js.map +1 -1
  175. package/dist/esm/useParams.js +27 -14
  176. package/dist/esm/useParams.js.map +1 -1
  177. package/dist/esm/useRouteContext.js +9 -8
  178. package/dist/esm/useRouteContext.js.map +1 -1
  179. package/dist/esm/useRouter.js +20 -12
  180. package/dist/esm/useRouter.js.map +1 -1
  181. package/dist/esm/useRouterState.js +38 -34
  182. package/dist/esm/useRouterState.js.map +1 -1
  183. package/dist/esm/useSearch.js +26 -13
  184. package/dist/esm/useSearch.js.map +1 -1
  185. package/dist/esm/utils.js +80 -39
  186. package/dist/esm/utils.js.map +1 -1
  187. package/package.json +5 -5
  188. package/dist/cjs/index.cjs.map +0 -1
  189. package/dist/cjs/index.dev.cjs.map +0 -1
  190. package/dist/cjs/ssr/client.cjs.map +0 -1
  191. package/dist/cjs/ssr/server.cjs.map +0 -1
  192. package/dist/esm/index.dev.js.map +0 -1
  193. package/dist/esm/index.js.map +0 -1
  194. package/dist/esm/ssr/client.js.map +0 -1
  195. package/dist/esm/ssr/server.js.map +0 -1
@@ -1,254 +1,197 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const invariant = require("tiny-invariant");
6
- const warning = require("tiny-warning");
7
- const routerCore = require("@tanstack/router-core");
8
- const isServer = require("@tanstack/router-core/isServer");
9
- const CatchBoundary = require("./CatchBoundary.cjs");
10
- const useRouterState = require("./useRouterState.cjs");
11
- const useRouter = require("./useRouter.cjs");
12
- const notFound = require("./not-found.cjs");
13
- const matchContext = require("./matchContext.cjs");
14
- const SafeFragment = require("./SafeFragment.cjs");
15
- const renderRouteNotFound = require("./renderRouteNotFound.cjs");
16
- const scrollRestoration = require("./scroll-restoration.cjs");
17
- const ClientOnly = require("./ClientOnly.cjs");
18
- function _interopNamespaceDefault(e) {
19
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
20
- if (e) {
21
- for (const k in e) {
22
- if (k !== "default") {
23
- const d = Object.getOwnPropertyDescriptor(e, k);
24
- Object.defineProperty(n, k, d.get ? d : {
25
- enumerable: true,
26
- get: () => e[k]
27
- });
28
- }
29
- }
30
- }
31
- n.default = e;
32
- return Object.freeze(n);
33
- }
34
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
35
- const Match = React__namespace.memo(function MatchImpl({
36
- matchId
37
- }) {
38
- const router = useRouter.useRouter();
39
- const matchState = useRouterState.useRouterState({
40
- select: (s) => {
41
- const matchIndex = s.matches.findIndex((d) => d.id === matchId);
42
- const match = s.matches[matchIndex];
43
- invariant(
44
- match,
45
- `Could not find match for matchId "${matchId}". Please file an issue!`
46
- );
47
- return {
48
- routeId: match.routeId,
49
- ssr: match.ssr,
50
- _displayPending: match._displayPending,
51
- resetKey: s.loadedAt,
52
- parentRouteId: s.matches[matchIndex - 1]?.routeId
53
- };
54
- },
55
- structuralSharing: true
56
- });
57
- const route = router.routesById[matchState.routeId];
58
- const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent;
59
- const pendingElement = PendingComponent ? /* @__PURE__ */ jsxRuntime.jsx(PendingComponent, {}) : null;
60
- const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent;
61
- const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch;
62
- const routeNotFoundComponent = route.isRoot ? (
63
- // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component
64
- route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component
65
- ) : route.options.notFoundComponent;
66
- const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only";
67
- const ResolvedSuspenseBoundary = (
68
- // If we're on the root route, allow forcefully wrapping in suspense
69
- (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && (route.options.wrapInSuspense ?? PendingComponent ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? React__namespace.Suspense : SafeFragment.SafeFragment
70
- );
71
- const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary.CatchBoundary : SafeFragment.SafeFragment;
72
- const ResolvedNotFoundBoundary = routeNotFoundComponent ? notFound.CatchNotFound : SafeFragment.SafeFragment;
73
- const ShellComponent = route.isRoot ? route.options.shellComponent ?? SafeFragment.SafeFragment : SafeFragment.SafeFragment;
74
- return /* @__PURE__ */ jsxRuntime.jsxs(ShellComponent, { children: [
75
- /* @__PURE__ */ jsxRuntime.jsx(matchContext.matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsxRuntime.jsx(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntime.jsx(
76
- ResolvedCatchBoundary,
77
- {
78
- getResetKey: () => matchState.resetKey,
79
- errorComponent: routeErrorComponent || CatchBoundary.ErrorComponent,
80
- onCatch: (error, errorInfo) => {
81
- if (routerCore.isNotFound(error)) throw error;
82
- warning(false, `Error in route match: ${matchId}`);
83
- routeOnCatch?.(error, errorInfo);
84
- },
85
- children: /* @__PURE__ */ jsxRuntime.jsx(
86
- ResolvedNotFoundBoundary,
87
- {
88
- fallback: (error) => {
89
- if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot)
90
- throw error;
91
- return React__namespace.createElement(routeNotFoundComponent, error);
92
- },
93
- children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ jsxRuntime.jsx(ClientOnly.ClientOnly, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntime.jsx(MatchInner, { matchId }) }) : /* @__PURE__ */ jsxRuntime.jsx(MatchInner, { matchId })
94
- }
95
- )
96
- }
97
- ) }) }),
98
- matchState.parentRouteId === routerCore.rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
99
- /* @__PURE__ */ jsxRuntime.jsx(OnRendered, {}),
100
- /* @__PURE__ */ jsxRuntime.jsx(scrollRestoration.ScrollRestoration, {})
101
- ] }) : null
102
- ] });
1
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
+ const require_CatchBoundary = require("./CatchBoundary.cjs");
3
+ const require_ClientOnly = require("./ClientOnly.cjs");
4
+ const require_useRouter = require("./useRouter.cjs");
5
+ const require_useRouterState = require("./useRouterState.cjs");
6
+ const require_matchContext = require("./matchContext.cjs");
7
+ const require_not_found = require("./not-found.cjs");
8
+ const require_SafeFragment = require("./SafeFragment.cjs");
9
+ const require_renderRouteNotFound = require("./renderRouteNotFound.cjs");
10
+ const require_scroll_restoration = require("./scroll-restoration.cjs");
11
+ let _tanstack_router_core = require("@tanstack/router-core");
12
+ let react = require("react");
13
+ react = require_runtime.__toESM(react);
14
+ let react_jsx_runtime = require("react/jsx-runtime");
15
+ let tiny_warning = require("tiny-warning");
16
+ tiny_warning = require_runtime.__toESM(tiny_warning);
17
+ let tiny_invariant = require("tiny-invariant");
18
+ tiny_invariant = require_runtime.__toESM(tiny_invariant);
19
+ let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
20
+ //#region src/Match.tsx
21
+ var Match = react.memo(function MatchImpl({ matchId }) {
22
+ const router = require_useRouter.useRouter();
23
+ const matchState = require_useRouterState.useRouterState({
24
+ select: (s) => {
25
+ const matchIndex = s.matches.findIndex((d) => d.id === matchId);
26
+ const match = s.matches[matchIndex];
27
+ (0, tiny_invariant.default)(match, `Could not find match for matchId "${matchId}". Please file an issue!`);
28
+ return {
29
+ routeId: match.routeId,
30
+ ssr: match.ssr,
31
+ _displayPending: match._displayPending,
32
+ resetKey: s.loadedAt,
33
+ parentRouteId: s.matches[matchIndex - 1]?.routeId
34
+ };
35
+ },
36
+ structuralSharing: true
37
+ });
38
+ const route = router.routesById[matchState.routeId];
39
+ const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent;
40
+ const pendingElement = PendingComponent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PendingComponent, {}) : null;
41
+ const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent;
42
+ const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch;
43
+ const routeNotFoundComponent = route.isRoot ? route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component : route.options.notFoundComponent;
44
+ const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only";
45
+ const ResolvedSuspenseBoundary = (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && (route.options.wrapInSuspense ?? PendingComponent ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? react.Suspense : require_SafeFragment.SafeFragment;
46
+ const ResolvedCatchBoundary = routeErrorComponent ? require_CatchBoundary.CatchBoundary : require_SafeFragment.SafeFragment;
47
+ const ResolvedNotFoundBoundary = routeNotFoundComponent ? require_not_found.CatchNotFound : require_SafeFragment.SafeFragment;
48
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(route.isRoot ? route.options.shellComponent ?? require_SafeFragment.SafeFragment : require_SafeFragment.SafeFragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_matchContext.matchContext.Provider, {
49
+ value: matchId,
50
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResolvedSuspenseBoundary, {
51
+ fallback: pendingElement,
52
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResolvedCatchBoundary, {
53
+ getResetKey: () => matchState.resetKey,
54
+ errorComponent: routeErrorComponent || require_CatchBoundary.ErrorComponent,
55
+ onCatch: (error, errorInfo) => {
56
+ if ((0, _tanstack_router_core.isNotFound)(error)) throw error;
57
+ (0, tiny_warning.default)(false, `Error in route match: ${matchId}`);
58
+ routeOnCatch?.(error, errorInfo);
59
+ },
60
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResolvedNotFoundBoundary, {
61
+ fallback: (error) => {
62
+ if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot) throw error;
63
+ return react.createElement(routeNotFoundComponent, error);
64
+ },
65
+ children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ClientOnly.ClientOnly, {
66
+ fallback: pendingElement,
67
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MatchInner, { matchId })
68
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MatchInner, { matchId })
69
+ })
70
+ })
71
+ })
72
+ }), matchState.parentRouteId === _tanstack_router_core.rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OnRendered, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_scroll_restoration.ScrollRestoration, {})] }) : null] });
103
73
  });
104
74
  function OnRendered() {
105
- const router = useRouter.useRouter();
106
- const prevLocationRef = React__namespace.useRef(
107
- void 0
108
- );
109
- return /* @__PURE__ */ jsxRuntime.jsx(
110
- "script",
111
- {
112
- suppressHydrationWarning: true,
113
- ref: (el) => {
114
- if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router.latestLocation.href)) {
115
- router.emit({
116
- type: "onRendered",
117
- ...routerCore.getLocationChangeInfo(router.state)
118
- });
119
- prevLocationRef.current = router.latestLocation;
120
- }
121
- }
122
- },
123
- router.latestLocation.state.__TSR_key
124
- );
75
+ const router = require_useRouter.useRouter();
76
+ const prevLocationRef = react.useRef(void 0);
77
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
78
+ suppressHydrationWarning: true,
79
+ ref: (el) => {
80
+ if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router.latestLocation.href)) {
81
+ router.emit({
82
+ type: "onRendered",
83
+ ...(0, _tanstack_router_core.getLocationChangeInfo)(router.state)
84
+ });
85
+ prevLocationRef.current = router.latestLocation;
86
+ }
87
+ }
88
+ }, router.latestLocation.state.__TSR_key);
125
89
  }
126
- const MatchInner = React__namespace.memo(function MatchInnerImpl({
127
- matchId
128
- }) {
129
- const router = useRouter.useRouter();
130
- const { match, key, routeId } = useRouterState.useRouterState({
131
- select: (s) => {
132
- const match2 = s.matches.find((d) => d.id === matchId);
133
- const routeId2 = match2.routeId;
134
- const remountFn = router.routesById[routeId2].options.remountDeps ?? router.options.defaultRemountDeps;
135
- const remountDeps = remountFn?.({
136
- routeId: routeId2,
137
- loaderDeps: match2.loaderDeps,
138
- params: match2._strictParams,
139
- search: match2._strictSearch
140
- });
141
- const key2 = remountDeps ? JSON.stringify(remountDeps) : void 0;
142
- return {
143
- key: key2,
144
- routeId: routeId2,
145
- match: {
146
- id: match2.id,
147
- status: match2.status,
148
- error: match2.error,
149
- _forcePending: match2._forcePending,
150
- _displayPending: match2._displayPending
151
- }
152
- };
153
- },
154
- structuralSharing: true
155
- });
156
- const route = router.routesById[routeId];
157
- const out = React__namespace.useMemo(() => {
158
- const Comp = route.options.component ?? router.options.defaultComponent;
159
- if (Comp) {
160
- return /* @__PURE__ */ jsxRuntime.jsx(Comp, {}, key);
161
- }
162
- return /* @__PURE__ */ jsxRuntime.jsx(Outlet, {});
163
- }, [key, route.options.component, router.options.defaultComponent]);
164
- if (match._displayPending) {
165
- throw router.getMatch(match.id)?._nonReactive.displayPendingPromise;
166
- }
167
- if (match._forcePending) {
168
- throw router.getMatch(match.id)?._nonReactive.minPendingPromise;
169
- }
170
- if (match.status === "pending") {
171
- const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs;
172
- if (pendingMinMs) {
173
- const routerMatch = router.getMatch(match.id);
174
- if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {
175
- if (!(isServer.isServer ?? router.isServer)) {
176
- const minPendingPromise = routerCore.createControlledPromise();
177
- routerMatch._nonReactive.minPendingPromise = minPendingPromise;
178
- setTimeout(() => {
179
- minPendingPromise.resolve();
180
- routerMatch._nonReactive.minPendingPromise = void 0;
181
- }, pendingMinMs);
182
- }
183
- }
184
- }
185
- throw router.getMatch(match.id)?._nonReactive.loadPromise;
186
- }
187
- if (match.status === "notFound") {
188
- invariant(routerCore.isNotFound(match.error), "Expected a notFound error");
189
- return renderRouteNotFound.renderRouteNotFound(router, route, match.error);
190
- }
191
- if (match.status === "redirected") {
192
- invariant(routerCore.isRedirect(match.error), "Expected a redirect error");
193
- throw router.getMatch(match.id)?._nonReactive.loadPromise;
194
- }
195
- if (match.status === "error") {
196
- if (isServer.isServer ?? router.isServer) {
197
- const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || CatchBoundary.ErrorComponent;
198
- return /* @__PURE__ */ jsxRuntime.jsx(
199
- RouteErrorComponent,
200
- {
201
- error: match.error,
202
- reset: void 0,
203
- info: {
204
- componentStack: ""
205
- }
206
- }
207
- );
208
- }
209
- throw match.error;
210
- }
211
- return out;
90
+ var MatchInner = react.memo(function MatchInnerImpl({ matchId }) {
91
+ const router = require_useRouter.useRouter();
92
+ const { match, key, routeId } = require_useRouterState.useRouterState({
93
+ select: (s) => {
94
+ const match = s.matches.find((d) => d.id === matchId);
95
+ const routeId = match.routeId;
96
+ const remountDeps = (router.routesById[routeId].options.remountDeps ?? router.options.defaultRemountDeps)?.({
97
+ routeId,
98
+ loaderDeps: match.loaderDeps,
99
+ params: match._strictParams,
100
+ search: match._strictSearch
101
+ });
102
+ return {
103
+ key: remountDeps ? JSON.stringify(remountDeps) : void 0,
104
+ routeId,
105
+ match: {
106
+ id: match.id,
107
+ status: match.status,
108
+ error: match.error,
109
+ _forcePending: match._forcePending,
110
+ _displayPending: match._displayPending
111
+ }
112
+ };
113
+ },
114
+ structuralSharing: true
115
+ });
116
+ const route = router.routesById[routeId];
117
+ const out = react.useMemo(() => {
118
+ const Comp = route.options.component ?? router.options.defaultComponent;
119
+ if (Comp) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {}, key);
120
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Outlet, {});
121
+ }, [
122
+ key,
123
+ route.options.component,
124
+ router.options.defaultComponent
125
+ ]);
126
+ if (match._displayPending) throw router.getMatch(match.id)?._nonReactive.displayPendingPromise;
127
+ if (match._forcePending) throw router.getMatch(match.id)?._nonReactive.minPendingPromise;
128
+ if (match.status === "pending") {
129
+ const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs;
130
+ if (pendingMinMs) {
131
+ const routerMatch = router.getMatch(match.id);
132
+ if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {
133
+ if (!(_tanstack_router_core_isServer.isServer ?? router.isServer)) {
134
+ const minPendingPromise = (0, _tanstack_router_core.createControlledPromise)();
135
+ routerMatch._nonReactive.minPendingPromise = minPendingPromise;
136
+ setTimeout(() => {
137
+ minPendingPromise.resolve();
138
+ routerMatch._nonReactive.minPendingPromise = void 0;
139
+ }, pendingMinMs);
140
+ }
141
+ }
142
+ }
143
+ throw router.getMatch(match.id)?._nonReactive.loadPromise;
144
+ }
145
+ if (match.status === "notFound") {
146
+ (0, tiny_invariant.default)((0, _tanstack_router_core.isNotFound)(match.error), "Expected a notFound error");
147
+ return require_renderRouteNotFound.renderRouteNotFound(router, route, match.error);
148
+ }
149
+ if (match.status === "redirected") {
150
+ (0, tiny_invariant.default)((0, _tanstack_router_core.isRedirect)(match.error), "Expected a redirect error");
151
+ throw router.getMatch(match.id)?._nonReactive.loadPromise;
152
+ }
153
+ if (match.status === "error") {
154
+ if (_tanstack_router_core_isServer.isServer ?? router.isServer) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)((route.options.errorComponent ?? router.options.defaultErrorComponent) || require_CatchBoundary.ErrorComponent, {
155
+ error: match.error,
156
+ reset: void 0,
157
+ info: { componentStack: "" }
158
+ });
159
+ throw match.error;
160
+ }
161
+ return out;
212
162
  });
213
- const Outlet = React__namespace.memo(function OutletImpl() {
214
- const router = useRouter.useRouter();
215
- const matchId = React__namespace.useContext(matchContext.matchContext);
216
- const routeId = useRouterState.useRouterState({
217
- select: (s) => s.matches.find((d) => d.id === matchId)?.routeId
218
- });
219
- const route = router.routesById[routeId];
220
- const parentGlobalNotFound = useRouterState.useRouterState({
221
- select: (s) => {
222
- const matches = s.matches;
223
- const parentMatch = matches.find((d) => d.id === matchId);
224
- invariant(
225
- parentMatch,
226
- `Could not find parent match for matchId "${matchId}"`
227
- );
228
- return parentMatch.globalNotFound;
229
- }
230
- });
231
- const childMatchId = useRouterState.useRouterState({
232
- select: (s) => {
233
- const matches = s.matches;
234
- const index = matches.findIndex((d) => d.id === matchId);
235
- return matches[index + 1]?.id;
236
- }
237
- });
238
- const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsxRuntime.jsx(router.options.defaultPendingComponent, {}) : null;
239
- if (parentGlobalNotFound) {
240
- return renderRouteNotFound.renderRouteNotFound(router, route, void 0);
241
- }
242
- if (!childMatchId) {
243
- return null;
244
- }
245
- const nextMatch = /* @__PURE__ */ jsxRuntime.jsx(Match, { matchId: childMatchId });
246
- if (routeId === routerCore.rootRouteId) {
247
- return /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Suspense, { fallback: pendingElement, children: nextMatch });
248
- }
249
- return nextMatch;
163
+ /**
164
+ * Render the next child match in the route tree. Typically used inside
165
+ * a route component to render nested routes.
166
+ *
167
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent
168
+ */
169
+ var Outlet = react.memo(function OutletImpl() {
170
+ const router = require_useRouter.useRouter();
171
+ const matchId = react.useContext(require_matchContext.matchContext);
172
+ const routeId = require_useRouterState.useRouterState({ select: (s) => s.matches.find((d) => d.id === matchId)?.routeId });
173
+ const route = router.routesById[routeId];
174
+ const parentGlobalNotFound = require_useRouterState.useRouterState({ select: (s) => {
175
+ const parentMatch = s.matches.find((d) => d.id === matchId);
176
+ (0, tiny_invariant.default)(parentMatch, `Could not find parent match for matchId "${matchId}"`);
177
+ return parentMatch.globalNotFound;
178
+ } });
179
+ const childMatchId = require_useRouterState.useRouterState({ select: (s) => {
180
+ const matches = s.matches;
181
+ return matches[matches.findIndex((d) => d.id === matchId) + 1]?.id;
182
+ } });
183
+ const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(router.options.defaultPendingComponent, {}) : null;
184
+ if (parentGlobalNotFound) return require_renderRouteNotFound.renderRouteNotFound(router, route, void 0);
185
+ if (!childMatchId) return null;
186
+ const nextMatch = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Match, { matchId: childMatchId });
187
+ if (routeId === _tanstack_router_core.rootRouteId) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
188
+ fallback: pendingElement,
189
+ children: nextMatch
190
+ });
191
+ return nextMatch;
250
192
  });
193
+ //#endregion
251
194
  exports.Match = Match;
252
- exports.MatchInner = MatchInner;
253
195
  exports.Outlet = Outlet;
254
- //# sourceMappingURL=Match.cjs.map
196
+
197
+ //# sourceMappingURL=Match.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Match.cjs","sources":["../../src/Match.tsx"],"sourcesContent":["import * as React from 'react'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { matchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport type {\n AnyRoute,\n ParsedLocation,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\nexport const Match = React.memo(function MatchImpl({\n matchId,\n}: {\n matchId: string\n}) {\n const router = useRouter()\n const matchState = useRouterState({\n select: (s) => {\n const matchIndex = s.matches.findIndex((d) => d.id === matchId)\n const match = s.matches[matchIndex]\n invariant(\n match,\n `Could not find match for matchId \"${matchId}\". Please file an issue!`,\n )\n return {\n routeId: match.routeId,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n resetKey: s.loadedAt,\n parentRouteId: s.matches[matchIndex - 1]?.routeId as string,\n }\n },\n structuralSharing: true as any,\n })\n\n const route: AnyRoute = router.routesById[matchState.routeId]\n\n const PendingComponent =\n route.options.pendingComponent ?? router.options.defaultPendingComponent\n\n const pendingElement = PendingComponent ? <PendingComponent /> : null\n\n const routeErrorComponent =\n route.options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = route.isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route.options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route.options.notFoundComponent\n\n const resolvedNoSsr =\n matchState.ssr === false || matchState.ssr === 'data-only'\n const ResolvedSuspenseBoundary =\n // If we're on the root route, allow forcefully wrapping in suspense\n (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) &&\n (route.options.wrapInSuspense ??\n PendingComponent ??\n ((route.options.errorComponent as any)?.preload || resolvedNoSsr))\n ? React.Suspense\n : SafeFragment\n\n const ResolvedCatchBoundary = routeErrorComponent\n ? CatchBoundary\n : SafeFragment\n\n const ResolvedNotFoundBoundary = routeNotFoundComponent\n ? CatchNotFound\n : SafeFragment\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n return (\n <ShellComponent>\n <matchContext.Provider value={matchId}>\n <ResolvedSuspenseBoundary fallback={pendingElement}>\n <ResolvedCatchBoundary\n getResetKey={() => matchState.resetKey}\n errorComponent={routeErrorComponent || ErrorComponent}\n onCatch={(error, errorInfo) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n warning(false, `Error in route match: ${matchId}`)\n routeOnCatch?.(error, errorInfo)\n }}\n >\n <ResolvedNotFoundBoundary\n fallback={(error) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent ||\n (error.routeId && error.routeId !== matchState.routeId) ||\n (!error.routeId && !route.isRoot)\n )\n throw error\n\n return React.createElement(routeNotFoundComponent, error as any)\n }}\n >\n {resolvedNoSsr || matchState._displayPending ? (\n <ClientOnly fallback={pendingElement}>\n <MatchInner matchId={matchId} />\n </ClientOnly>\n ) : (\n <MatchInner matchId={matchId} />\n )}\n </ResolvedNotFoundBoundary>\n </ResolvedCatchBoundary>\n </ResolvedSuspenseBoundary>\n </matchContext.Provider>\n {matchState.parentRouteId === rootRouteId &&\n router.options.scrollRestoration ? (\n <>\n <OnRendered />\n <ScrollRestoration />\n </>\n ) : null}\n </ShellComponent>\n )\n})\n\n// On Rendered can't happen above the root layout because it actually\n// renders a dummy dom element to track the rendered state of the app.\n// We render a script tag with a key that changes based on the current\n// location state.__TSR_key. Also, because it's below the root layout, it\n// allows us to fire onRendered events even after a hydration mismatch\n// error that occurred above the root layout (like bad head/link tags,\n// which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const prevLocationRef = React.useRef<undefined | ParsedLocation<{}>>(\n undefined,\n )\n\n return (\n <script\n key={router.latestLocation.state.__TSR_key}\n suppressHydrationWarning\n ref={(el) => {\n if (\n el &&\n (prevLocationRef.current === undefined ||\n prevLocationRef.current.href !== router.latestLocation.href)\n ) {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(router.state),\n })\n prevLocationRef.current = router.latestLocation\n }\n }}\n />\n )\n}\n\nexport const MatchInner = React.memo(function MatchInnerImpl({\n matchId,\n}: {\n matchId: string\n}): any {\n const router = useRouter()\n\n const { match, key, routeId } = useRouterState({\n select: (s) => {\n const match = s.matches.find((d) => d.id === matchId)!\n const routeId = match.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: match.id,\n status: match.status,\n error: match.error,\n _forcePending: match._forcePending,\n _displayPending: match._displayPending,\n },\n }\n },\n structuralSharing: true as any,\n })\n\n const route = router.routesById[routeId] as AnyRoute\n\n const out = React.useMemo(() => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp key={key} />\n }\n return <Outlet />\n }, [key, route.options.component, router.options.defaultComponent])\n\n if (match._displayPending) {\n throw router.getMatch(match.id)?._nonReactive.displayPendingPromise\n }\n\n if (match._forcePending) {\n throw router.getMatch(match.id)?._nonReactive.minPendingPromise\n }\n\n // see also hydrate() in packages/router-core/src/ssr/ssr-client.ts\n if (match.status === 'pending') {\n // We're pending, and if we have a minPendingMs, we need to wait for it\n const pendingMinMs =\n route.options.pendingMinMs ?? router.options.defaultPendingMinMs\n if (pendingMinMs) {\n const routerMatch = router.getMatch(match.id)\n if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise = minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n throw router.getMatch(match.id)?._nonReactive.loadPromise\n }\n\n if (match.status === 'notFound') {\n invariant(isNotFound(match.error), 'Expected a notFound error')\n return renderRouteNotFound(router, route, match.error)\n }\n\n if (match.status === 'redirected') {\n // Redirects should be handled by the router transition. If we happen to\n // encounter a redirect here, it's a bug. Let's warn, but render nothing.\n invariant(isRedirect(match.error), 'Expected a redirect error')\n\n // warning(\n // false,\n // 'Tried to render a redirected route match! This is a weird circumstance, please file an issue!',\n // )\n throw router.getMatch(match.id)?._nonReactive.loadPromise\n }\n\n if (match.status === 'error') {\n // If we're on the server, we need to use React's new and super\n // wonky api for throwing errors from a server side render inside\n // of a suspense boundary. This is the only way to get\n // renderToPipeableStream to not hang indefinitely.\n // We'll serialize the error and rethrow it on the client.\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n return (\n <RouteErrorComponent\n error={match.error as any}\n reset={undefined as any}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw match.error\n }\n\n return out\n})\n\n/**\n * Render the next child match in the route tree. Typically used inside\n * a route component to render nested routes.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent\n */\nexport const Outlet = React.memo(function OutletImpl() {\n const router = useRouter()\n const matchId = React.useContext(matchContext)\n const routeId = useRouterState({\n select: (s) => s.matches.find((d) => d.id === matchId)?.routeId as string,\n })\n\n const route = router.routesById[routeId]!\n\n const parentGlobalNotFound = useRouterState({\n select: (s) => {\n const matches = s.matches\n const parentMatch = matches.find((d) => d.id === matchId)\n invariant(\n parentMatch,\n `Could not find parent match for matchId \"${matchId}\"`,\n )\n return parentMatch.globalNotFound\n },\n })\n\n const childMatchId = useRouterState({\n select: (s) => {\n const matches = s.matches\n const index = matches.findIndex((d) => d.id === matchId)\n return matches[index + 1]?.id\n },\n })\n\n const pendingElement = router.options.defaultPendingComponent ? (\n <router.options.defaultPendingComponent />\n ) : null\n\n if (parentGlobalNotFound) {\n return renderRouteNotFound(router, route, undefined)\n }\n\n if (!childMatchId) {\n return null\n }\n\n const nextMatch = <Match matchId={childMatchId} />\n\n if (routeId === rootRouteId) {\n return (\n <React.Suspense fallback={pendingElement}>{nextMatch}</React.Suspense>\n )\n }\n\n return nextMatch\n})\n"],"names":["React","useRouter","useRouterState","jsx","SafeFragment","CatchBoundary","CatchNotFound","matchContext","ErrorComponent","isNotFound","ClientOnly","rootRouteId","jsxs","Fragment","ScrollRestoration","getLocationChangeInfo","match","routeId","key","isServer","createControlledPromise","renderRouteNotFound","isRedirect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,QAAQA,iBAAM,KAAK,SAAS,UAAU;AAAA,EACjD;AACF,GAEG;AACD,QAAM,SAASC,UAAAA,UAAA;AACf,QAAM,aAAaC,eAAAA,eAAe;AAAA,IAChC,QAAQ,CAAC,MAAM;AACb,YAAM,aAAa,EAAE,QAAQ,UAAU,CAAC,MAAM,EAAE,OAAO,OAAO;AAC9D,YAAM,QAAQ,EAAE,QAAQ,UAAU;AAClC;AAAA,QACE;AAAA,QACA,qCAAqC,OAAO;AAAA,MAAA;AAE9C,aAAO;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;AAEA,SAAO;AACT,CAAC;;;;"}
1
+ {"version":3,"file":"Match.cjs","names":[],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as React from 'react'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { matchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport type {\n AnyRoute,\n ParsedLocation,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\nexport const Match = React.memo(function MatchImpl({\n matchId,\n}: {\n matchId: string\n}) {\n const router = useRouter()\n const matchState = useRouterState({\n select: (s) => {\n const matchIndex = s.matches.findIndex((d) => d.id === matchId)\n const match = s.matches[matchIndex]\n invariant(\n match,\n `Could not find match for matchId \"${matchId}\". Please file an issue!`,\n )\n return {\n routeId: match.routeId,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n resetKey: s.loadedAt,\n parentRouteId: s.matches[matchIndex - 1]?.routeId as string,\n }\n },\n structuralSharing: true as any,\n })\n\n const route: AnyRoute = router.routesById[matchState.routeId]\n\n const PendingComponent =\n route.options.pendingComponent ?? router.options.defaultPendingComponent\n\n const pendingElement = PendingComponent ? <PendingComponent /> : null\n\n const routeErrorComponent =\n route.options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = route.isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route.options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route.options.notFoundComponent\n\n const resolvedNoSsr =\n matchState.ssr === false || matchState.ssr === 'data-only'\n const ResolvedSuspenseBoundary =\n // If we're on the root route, allow forcefully wrapping in suspense\n (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) &&\n (route.options.wrapInSuspense ??\n PendingComponent ??\n ((route.options.errorComponent as any)?.preload || resolvedNoSsr))\n ? React.Suspense\n : SafeFragment\n\n const ResolvedCatchBoundary = routeErrorComponent\n ? CatchBoundary\n : SafeFragment\n\n const ResolvedNotFoundBoundary = routeNotFoundComponent\n ? CatchNotFound\n : SafeFragment\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n return (\n <ShellComponent>\n <matchContext.Provider value={matchId}>\n <ResolvedSuspenseBoundary fallback={pendingElement}>\n <ResolvedCatchBoundary\n getResetKey={() => matchState.resetKey}\n errorComponent={routeErrorComponent || ErrorComponent}\n onCatch={(error, errorInfo) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n warning(false, `Error in route match: ${matchId}`)\n routeOnCatch?.(error, errorInfo)\n }}\n >\n <ResolvedNotFoundBoundary\n fallback={(error) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent ||\n (error.routeId && error.routeId !== matchState.routeId) ||\n (!error.routeId && !route.isRoot)\n )\n throw error\n\n return React.createElement(routeNotFoundComponent, error as any)\n }}\n >\n {resolvedNoSsr || matchState._displayPending ? (\n <ClientOnly fallback={pendingElement}>\n <MatchInner matchId={matchId} />\n </ClientOnly>\n ) : (\n <MatchInner matchId={matchId} />\n )}\n </ResolvedNotFoundBoundary>\n </ResolvedCatchBoundary>\n </ResolvedSuspenseBoundary>\n </matchContext.Provider>\n {matchState.parentRouteId === rootRouteId &&\n router.options.scrollRestoration ? (\n <>\n <OnRendered />\n <ScrollRestoration />\n </>\n ) : null}\n </ShellComponent>\n )\n})\n\n// On Rendered can't happen above the root layout because it actually\n// renders a dummy dom element to track the rendered state of the app.\n// We render a script tag with a key that changes based on the current\n// location state.__TSR_key. Also, because it's below the root layout, it\n// allows us to fire onRendered events even after a hydration mismatch\n// error that occurred above the root layout (like bad head/link tags,\n// which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const prevLocationRef = React.useRef<undefined | ParsedLocation<{}>>(\n undefined,\n )\n\n return (\n <script\n key={router.latestLocation.state.__TSR_key}\n suppressHydrationWarning\n ref={(el) => {\n if (\n el &&\n (prevLocationRef.current === undefined ||\n prevLocationRef.current.href !== router.latestLocation.href)\n ) {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(router.state),\n })\n prevLocationRef.current = router.latestLocation\n }\n }}\n />\n )\n}\n\nexport const MatchInner = React.memo(function MatchInnerImpl({\n matchId,\n}: {\n matchId: string\n}): any {\n const router = useRouter()\n\n const { match, key, routeId } = useRouterState({\n select: (s) => {\n const match = s.matches.find((d) => d.id === matchId)!\n const routeId = match.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: match.id,\n status: match.status,\n error: match.error,\n _forcePending: match._forcePending,\n _displayPending: match._displayPending,\n },\n }\n },\n structuralSharing: true as any,\n })\n\n const route = router.routesById[routeId] as AnyRoute\n\n const out = React.useMemo(() => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp key={key} />\n }\n return <Outlet />\n }, [key, route.options.component, router.options.defaultComponent])\n\n if (match._displayPending) {\n throw router.getMatch(match.id)?._nonReactive.displayPendingPromise\n }\n\n if (match._forcePending) {\n throw router.getMatch(match.id)?._nonReactive.minPendingPromise\n }\n\n // see also hydrate() in packages/router-core/src/ssr/ssr-client.ts\n if (match.status === 'pending') {\n // We're pending, and if we have a minPendingMs, we need to wait for it\n const pendingMinMs =\n route.options.pendingMinMs ?? router.options.defaultPendingMinMs\n if (pendingMinMs) {\n const routerMatch = router.getMatch(match.id)\n if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise = minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n throw router.getMatch(match.id)?._nonReactive.loadPromise\n }\n\n if (match.status === 'notFound') {\n invariant(isNotFound(match.error), 'Expected a notFound error')\n return renderRouteNotFound(router, route, match.error)\n }\n\n if (match.status === 'redirected') {\n // Redirects should be handled by the router transition. If we happen to\n // encounter a redirect here, it's a bug. Let's warn, but render nothing.\n invariant(isRedirect(match.error), 'Expected a redirect error')\n\n // warning(\n // false,\n // 'Tried to render a redirected route match! This is a weird circumstance, please file an issue!',\n // )\n throw router.getMatch(match.id)?._nonReactive.loadPromise\n }\n\n if (match.status === 'error') {\n // If we're on the server, we need to use React's new and super\n // wonky api for throwing errors from a server side render inside\n // of a suspense boundary. This is the only way to get\n // renderToPipeableStream to not hang indefinitely.\n // We'll serialize the error and rethrow it on the client.\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n return (\n <RouteErrorComponent\n error={match.error as any}\n reset={undefined as any}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw match.error\n }\n\n return out\n})\n\n/**\n * Render the next child match in the route tree. Typically used inside\n * a route component to render nested routes.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent\n */\nexport const Outlet = React.memo(function OutletImpl() {\n const router = useRouter()\n const matchId = React.useContext(matchContext)\n const routeId = useRouterState({\n select: (s) => s.matches.find((d) => d.id === matchId)?.routeId as string,\n })\n\n const route = router.routesById[routeId]!\n\n const parentGlobalNotFound = useRouterState({\n select: (s) => {\n const matches = s.matches\n const parentMatch = matches.find((d) => d.id === matchId)\n invariant(\n parentMatch,\n `Could not find parent match for matchId \"${matchId}\"`,\n )\n return parentMatch.globalNotFound\n },\n })\n\n const childMatchId = useRouterState({\n select: (s) => {\n const matches = s.matches\n const index = matches.findIndex((d) => d.id === matchId)\n return matches[index + 1]?.id\n },\n })\n\n const pendingElement = router.options.defaultPendingComponent ? (\n <router.options.defaultPendingComponent />\n ) : null\n\n if (parentGlobalNotFound) {\n return renderRouteNotFound(router, route, undefined)\n }\n\n if (!childMatchId) {\n return null\n }\n\n const nextMatch = <Match matchId={childMatchId} />\n\n if (routeId === rootRouteId) {\n return (\n <React.Suspense fallback={pendingElement}>{nextMatch}</React.Suspense>\n )\n }\n\n return nextMatch\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,QAAQ,MAAM,KAAK,SAAS,UAAU,EACjD,WAGC;CACD,MAAM,SAAS,kBAAA,WAAW;CAC1B,MAAM,aAAa,uBAAA,eAAe;EAChC,SAAS,MAAM;GACb,MAAM,aAAa,EAAE,QAAQ,WAAW,MAAM,EAAE,OAAO,QAAQ;GAC/D,MAAM,QAAQ,EAAE,QAAQ;AACxB,IAAA,GAAA,eAAA,SACE,OACA,qCAAqC,QAAQ,0BAC9C;AACD,UAAO;IACL,SAAS,MAAM;IACf,KAAK,MAAM;IACX,iBAAiB,MAAM;IACvB,UAAU,EAAE;IACZ,eAAe,EAAE,QAAQ,aAAa,IAAI;IAC3C;;EAEH,mBAAmB;EACpB,CAAC;CAEF,MAAM,QAAkB,OAAO,WAAW,WAAW;CAErD,MAAM,mBACJ,MAAM,QAAQ,oBAAoB,OAAO,QAAQ;CAEnD,MAAM,iBAAiB,mBAAmB,iBAAA,GAAA,kBAAA,KAAC,kBAAD,EAAoB,CAAA,GAAG;CAEjE,MAAM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