@tanstack/solid-router 1.132.0-alpha.1 → 1.132.0-alpha.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.js","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n ;[...routeMeta()].reverse().forEach((metas) => {\n ;[...metas].reverse().forEach((m) => {\n if (!m) return\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n return\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n })\n })\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","reverse","forEach","metas","m","tag","children","attribute","name","property","push","attrs","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA;AAEf,QAAMC,YAAYC,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IACjE;AAAA,EAAA,CACD;AAED,QAAMF,OAAgDG,MAAMC,WAAW,MAAM;AAC3E,UAAMC,aAAsC,CAAA;AAC5C,UAAMC,kBAAwC,CAAA;AAC9C,QAAIC;AACH,KAAC,GAAGd,UAAAA,CAAW,EAAEe,QAAAA,EAAUC,QAASC,CAAAA,UAAU;AAC5C,OAAC,GAAGA,KAAK,EAAEF,QAAAA,EAAUC,QAASE,CAAAA,MAAM;AACnC,YAAI,CAACA,EAAG;AAER,YAAIA,EAAEJ,OAAO;AACX,cAAI,CAACA,OAAO;AACVA,oBAAQ;AAAA,cACNK,KAAK;AAAA,cACLC,UAAUF,EAAEJ;AAAAA,YAAAA;AAAAA,UAEhB;AAAA,QACF,OAAO;AACL,gBAAMO,YAAYH,EAAEI,QAAQJ,EAAEK;AAC9B,cAAIF,WAAW;AACb,gBAAIR,gBAAgBQ,SAAS,GAAG;AAC9B;AAAA,YACF,OAAO;AACLR,8BAAgBQ,SAAS,IAAI;AAAA,YAC/B;AAAA,UACF;AAEAT,qBAAWY,KAAK;AAAA,YACdL,KAAK;AAAA,YACLM,OAAO;AAAA,cACL,GAAGP;AAAAA,YAAAA;AAAAA,UACL,CACD;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,QAAIJ,OAAO;AACTF,iBAAWY,KAAKV,KAAK;AAAA,IACvB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GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;"}
1
+ {"version":3,"file":"HeadContent.js","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { MetaProvider } from '@solidjs/meta'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useRouterState } from './useRouterState'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\nexport const useTags = () => {\n const router = useRouter()\n\n const routeMeta = useRouterState({\n select: (state) => {\n return state.matches.map((match) => match.meta!).filter(Boolean)\n },\n })\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = useRouterState({\n select: (state) => {\n const constructed = state.matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n // These are the assets extracted from the ViteManifest\n // using the `startManifestPlugin`\n const assets = state.matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: asset.attrs,\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n },\n })\n\n const preloadMeta = useRouterState({\n select: (state) => {\n const preloadMeta: Array<RouterManagedTag> = []\n\n state.matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadMeta.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n },\n })\n }),\n )\n\n return preloadMeta\n },\n })\n\n const styles = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n },\n children,\n })),\n })\n\n const headScripts = useRouterState({\n select: (state) =>\n (\n state.matches\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n },\n children,\n })),\n })\n\n return () =>\n uniqBy(\n [\n ...meta(),\n ...preloadMeta(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n (d) => {\n return JSON.stringify(d)\n },\n )\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * It should be rendered in the `<head>` of your document.\n */\nexport function HeadContent() {\n const tags = useTags()\n return (\n <MetaProvider>\n {tags().map((tag) => (\n <Asset {...tag} />\n ))}\n </MetaProvider>\n )\n}\n\nfunction uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"names":["useTags","router","useRouter","routeMeta","useRouterState","select","state","matches","map","match","meta","filter","Boolean","Solid","createMemo","resultMeta","metaByAttribute","title","routeMetasArray","i","length","metas","j","m","tag","children","attribute","name","property","push","attrs","reverse","links","constructed","flat","link","manifest","ssr","assets","routes","routeId","asset","preloadMeta","looseRoutesById","forEach","route","id","preloads","preload","rel","href","styles","style","headScripts","script","uniqBy","d","JSON","stringify","HeadContent","tags","_$createComponent","MetaProvider","Asset","arr","fn","seen","Set","item","key","has","add"],"mappings":";;;;;;AAOO,MAAMA,UAAUA,MAAM;AAC3B,QAAMC,SAASC,UAAAA;AAEf,QAAMC,YAAYC,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IACjE;AAAA,EAAA,CACD;AAED,QAAMF,OAAgDG,MAAMC,WAAW,MAAM;AAC3E,UAAMC,aAAsC,CAAA;AAC5C,UAAMC,kBAAwC,CAAA;AAC9C,QAAIC;AACJ,UAAMC,kBAAkBf,UAAAA;AACxB,aAASgB,IAAID,gBAAgBE,SAAS,GAAGD,KAAK,GAAGA,KAAK;AACpD,YAAME,QAAQH,gBAAgBC,CAAC;AAC/B,eAASG,IAAID,MAAMD,SAAS,GAAGE,KAAK,GAAGA,KAAK;AAC1C,cAAMC,IAAIF,MAAMC,CAAC;AACjB,YAAI,CAACC,EAAG;AAER,YAAIA,EAAEN,OAAO;AACX,cAAI,CAACA,OAAO;AACVA,oBAAQ;AAAA,cACNO,KAAK;AAAA,cACLC,UAAUF,EAAEN;AAAAA,YAAAA;AAAAA,UAEhB;AAAA,QACF,OAAO;AACL,gBAAMS,YAAYH,EAAEI,QAAQJ,EAAEK;AAC9B,cAAIF,WAAW;AACb,gBAAIV,gBAAgBU,SAAS,GAAG;AAC9B;AAAA,YACF,OAAO;AACLV,8BAAgBU,SAAS,IAAI;AAAA,YAC/B;AAAA,UACF;AAEAX,qBAAWc,KAAK;AAAA,YACdL,KAAK;AAAA,YACLM,OA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AAA,CAAA;AAGR;AAEA,SAAS+B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIrD,OAAQyD,CAAAA,SAAS;AAC1B,UAAMC,MAAMJ,GAAGG,IAAI;AACnB,QAAIF,KAAKI,IAAID,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACAH,SAAKK,IAAIF,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACH;"}
package/dist/esm/Match.js CHANGED
@@ -2,7 +2,7 @@ import { createComponent, memo, Dynamic, mergeProps } from "solid-js/web";
2
2
  import * as Solid from "solid-js";
3
3
  import invariant from "tiny-invariant";
4
4
  import warning from "tiny-warning";
5
- import { isNotFound, rootRouteId, pick, createControlledPromise, isRedirect, getLocationChangeInfo } from "@tanstack/router-core";
5
+ import { isNotFound, rootRouteId, createControlledPromise, isRedirect, getLocationChangeInfo } from "@tanstack/router-core";
6
6
  import { ErrorComponent, CatchBoundary } from "./CatchBoundary.js";
7
7
  import { useRouterState } from "./useRouterState.js";
8
8
  import { useRouter } from "./useRouter.js";
@@ -17,7 +17,11 @@ const Match = (props) => {
17
17
  select: (s) => {
18
18
  const match = s.matches.find((d) => d.id === props.matchId);
19
19
  invariant(match, `Could not find match for matchId "${props.matchId}". Please file an issue!`);
20
- return pick(match, ["routeId", "ssr", "_displayPending"]);
20
+ return {
21
+ routeId: match.routeId,
22
+ ssr: match.ssr,
23
+ _displayPending: match._displayPending
24
+ };
21
25
  }
22
26
  });
23
27
  const route = () => router.routesById[matchState().routeId];
@@ -156,8 +160,7 @@ const MatchInner = (props) => {
156
160
  const router = useRouter();
157
161
  const matchState = useRouterState({
158
162
  select: (s) => {
159
- const matchIndex = s.matches.findIndex((d) => d.id === props.matchId);
160
- const match2 = s.matches[matchIndex];
163
+ const match2 = s.matches.find((d) => d.id === props.matchId);
161
164
  const routeId = match2.routeId;
162
165
  const remountFn = router.routesById[routeId].options.remountDeps ?? router.options.defaultRemountDeps;
163
166
  const remountDeps = remountFn?.({
@@ -170,7 +173,13 @@ const MatchInner = (props) => {
170
173
  return {
171
174
  key,
172
175
  routeId,
173
- match: pick(match2, ["id", "status", "error", "_forcePending", "_displayPending"])
176
+ match: {
177
+ id: match2.id,
178
+ status: match2.status,
179
+ error: match2.error,
180
+ _forcePending: match2._forcePending,
181
+ _displayPending: match2._displayPending
182
+ }
174
183
  };
175
184
  }
176
185
  });
@@ -179,10 +188,9 @@ const MatchInner = (props) => {
179
188
  const out = () => {
180
189
  const Comp = route().options.component ?? router.options.defaultComponent;
181
190
  if (Comp) {
191
+ const key = matchState().key ?? matchState().match.id;
182
192
  return createComponent(Solid.Show, {
183
- get when() {
184
- return matchState().match.id;
185
- },
193
+ when: key,
186
194
  keyed: true,
187
195
  get children() {
188
196
  return createComponent(Comp, {});
@@ -198,7 +206,7 @@ const MatchInner = (props) => {
198
206
  return match()._displayPending;
199
207
  },
200
208
  children: (_) => {
201
- const [displayPendingResult] = Solid.createResource(() => router.getMatch(match().id)?.displayPendingPromise);
209
+ const [displayPendingResult] = Solid.createResource(() => router.getMatch(match().id)?._nonReactive.displayPendingPromise);
202
210
  return memo(displayPendingResult);
203
211
  }
204
212
  }), createComponent(Solid.Match, {
@@ -206,7 +214,7 @@ const MatchInner = (props) => {
206
214
  return match()._forcePending;
207
215
  },
208
216
  children: (_) => {
209
- const [minPendingResult] = Solid.createResource(() => router.getMatch(match().id)?.minPendingPromise);
217
+ const [minPendingResult] = Solid.createResource(() => router.getMatch(match().id)?._nonReactive.minPendingPromise);
210
218
  return memo(minPendingResult);
211
219
  }
212
220
  }), createComponent(Solid.Match, {
@@ -215,27 +223,22 @@ const MatchInner = (props) => {
215
223
  },
216
224
  children: (_) => {
217
225
  const pendingMinMs = route().options.pendingMinMs ?? router.options.defaultPendingMinMs;
218
- if (pendingMinMs && !router.getMatch(match().id)?.minPendingPromise) {
219
- if (!router.isServer) {
220
- const minPendingPromise = createControlledPromise();
221
- Promise.resolve().then(() => {
222
- router.updateMatch(match().id, (prev) => ({
223
- ...prev,
224
- minPendingPromise
225
- }));
226
- });
227
- setTimeout(() => {
228
- minPendingPromise.resolve();
229
- router.updateMatch(match().id, (prev) => ({
230
- ...prev,
231
- minPendingPromise: void 0
232
- }));
233
- }, pendingMinMs);
226
+ if (pendingMinMs) {
227
+ const routerMatch = router.getMatch(match().id);
228
+ if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {
229
+ if (!router.isServer) {
230
+ const minPendingPromise = createControlledPromise();
231
+ routerMatch._nonReactive.minPendingPromise = minPendingPromise;
232
+ setTimeout(() => {
233
+ minPendingPromise.resolve();
234
+ routerMatch._nonReactive.minPendingPromise = void 0;
235
+ }, pendingMinMs);
236
+ }
234
237
  }
235
238
  }
236
239
  const [loaderResult] = Solid.createResource(async () => {
237
240
  await new Promise((r) => setTimeout(r, 0));
238
- return router.getMatch(match().id)?.loadPromise;
241
+ return router.getMatch(match().id)?._nonReactive.loadPromise;
239
242
  });
240
243
  return memo(loaderResult);
241
244
  }
@@ -255,7 +258,7 @@ const MatchInner = (props) => {
255
258
  invariant(isRedirect(match().error), "Expected a redirect error");
256
259
  const [loaderResult] = Solid.createResource(async () => {
257
260
  await new Promise((r) => setTimeout(r, 0));
258
- return router.getMatch(match().id)?.loadPromise;
261
+ return router.getMatch(match().id)?._nonReactive.loadPromise;
259
262
  });
260
263
  return memo(loaderResult);
261
264
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Match.js","sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n isNotFound,\n isRedirect,\n pick,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { Dynamic } from 'solid-js/web'\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 type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n const matchState = useRouterState({\n select: (s) => {\n const match = s.matches.find((d) => d.id === props.matchId)\n\n invariant(\n match,\n `Could not find match for matchId \"${props.matchId}\". Please file an issue!`,\n )\n return pick(match, ['routeId', 'ssr', '_displayPending'])\n },\n })\n\n const route: () => AnyRoute = () => router.routesById[matchState().routeId]\n\n const PendingComponent = () =>\n route().options.pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n 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\n const ResolvedSuspenseBoundary = () =>\n // If we're on the root route, allow forcefully wrapping in suspense\n (!route().isRoot ||\n route().options.wrapInSuspense ||\n resolvedNoSsr ||\n matchState()._displayPending) &&\n (route().options.wrapInSuspense ??\n PendingComponent() ??\n ((route().options.errorComponent as any)?.preload || resolvedNoSsr))\n ? Solid.Suspense\n : SafeFragment\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const resetKey = useRouterState({\n select: (s) => s.loadedAt,\n })\n\n const parentRouteId = useRouterState({\n select: (s) => {\n const index = s.matches.findIndex((d) => d.id === props.matchId)\n return s.matches[index - 1]?.routeId as string\n },\n })\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <matchContext.Provider value={() => props.matchId}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={<Dynamic component={PendingComponent()} />}\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => resetKey()}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\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: ${props.matchId}`)\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\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 (\n <Dynamic component={routeNotFoundComponent()} {...error} />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!router.isServer}\n fallback={<Dynamic component={PendingComponent()} />}\n >\n <MatchInner matchId={props.matchId} />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner matchId={props.matchId} />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </matchContext.Provider>\n\n {parentRouteId() === rootRouteId ? (\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 location = useRouterState({\n select: (s) => {\n return s.resolvedLocation?.state.__TSR_key\n },\n })\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(router.state),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (props: { matchId: string }): any => {\n const router = useRouter()\n\n const matchState = useRouterState({\n select: (s) => {\n const matchIndex = s.matches.findIndex((d) => d.id === props.matchId)\n const match = s.matches[matchIndex]!\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: pick(match, [\n 'id',\n 'status',\n 'error',\n '_forcePending',\n '_displayPending',\n ]),\n }\n },\n })\n\n const route = () => router.routesById[matchState().routeId]!\n\n const match = () => matchState().match\n\n const out = () => {\n const Comp = route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return (\n <Solid.Show when={matchState().match.id} keyed>\n <Comp />\n </Solid.Show>\n )\n }\n return <Outlet />\n }\n\n return (\n <Solid.Switch>\n <Solid.Match when={match()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () => router.getMatch(match().id)?.displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () => router.getMatch(match().id)?.minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ?? router.options.defaultPendingMinMs\n\n if (pendingMinMs && !router.getMatch(match().id)?.minPendingPromise) {\n // Create a promise that will resolve after the minPendingMs\n if (!router.isServer) {\n const minPendingPromise = createControlledPromise<void>()\n\n Promise.resolve().then(() => {\n router.updateMatch(match().id, (prev) => ({\n ...prev,\n minPendingPromise,\n }))\n })\n\n setTimeout(() => {\n minPendingPromise.resolve()\n\n // We've handled the minPendingPromise, so we can delete it\n router.updateMatch(match().id, (prev) => ({\n ...prev,\n minPendingPromise: undefined,\n }))\n }, pendingMinMs)\n }\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(match().id)?.loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'notFound'}>\n {(_) => {\n invariant(isNotFound(match().error), 'Expected a notFound error')\n\n return renderRouteNotFound(router, route(), match().error)\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'redirected'}>\n {(_) => {\n invariant(isRedirect(match().error), 'Expected a redirect error')\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(match().id)?.loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'error'}>\n {(_) => {\n if (router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={match().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw match().error\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'success'}>{out()}</Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const matchId = Solid.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 const v = matches[index + 1]?.id\n return v\n },\n })\n\n return (\n <Solid.Switch>\n <Solid.Match when={parentGlobalNotFound()}>\n {renderRouteNotFound(router, route(), undefined)}\n </Solid.Match>\n <Solid.Match when={childMatchId()}>\n {(matchId) => {\n // const nextMatch = <Match matchId={matchId()} />\n\n return (\n <Solid.Show\n when={matchId() === rootRouteId}\n fallback={<Match matchId={matchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={matchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n"],"names":["Match","props","router","useRouter","matchState","useRouterState","select","s","match","matches","find","d","id","matchId","invariant","pick","route","routesById","routeId","PendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ssr","ResolvedSuspenseBoundary","wrapInSuspense","_displayPending","preload","Solid","Suspense","SafeFragment","ResolvedCatchBoundary","CatchBoundary","ResolvedNotFoundBoundary","CatchNotFound","resetKey","loadedAt","parentRouteId","index","findIndex","ShellComponent","shellComponent","_$createComponent","children","matchContext","Provider","value","Dynamic","fallback","getResetKey","ErrorComponent","error","isNotFound","warning","_$mergeProps","Switch","when","Show","isServer","MatchInner","_$memo","rootRouteId","OnRendered","ScrollRestoration","location","resolvedLocation","state","__TSR_key","createEffect","on","emit","type","getLocationChangeInfo","matchIndex","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","undefined","out","Comp","defaultComponent","keyed","Outlet","_","displayPendingResult","createResource","getMatch","displayPendingPromise","_forcePending","minPendingResult","minPendingPromise","status","pendingMinMs","defaultPendingMinMs","createControlledPromise","Promise","resolve","then","updateMatch","prev","setTimeout","loaderResult","r","loadPromise","renderRouteNotFound","isRedirect","RouteErrorComponent","info","componentStack","useContext","parentGlobalNotFound","parentMatch","globalNotFound","childMatchId","v"],"mappings":";;;;;;;;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E,oBAAoB1H,QAAQc,MAAAA,GAASiF,MAAS;AAAA,QAAC;AAAA,MAAA,CAAA,GAAA3C,gBAEjDd,MAAMxC,OAAK;AAAA,QAAA,IAACoE,OAAI;AAAA,iBAAEiE,aAAAA;AAAAA,QAAc;AAAA,QAAA9E,UAC7B1C,CAAAA,aAAY;AAGZ,iBAAAyC,gBACGd,MAAM6B,MAAI;AAAA,YAAA,IACTD,OAAI;AAAA,qBAAEvD,eAAc4D;AAAAA,YAAW;AAAA,YAAA,IAC/Bb,WAAQ;AAAA,qBAAAN,gBAAGtD,OAAK;AAAA,gBAAA,IAACa,UAAO;AAAA,yBAAEA,SAAAA;AAAAA,gBAAS;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,YAAA,IAAA0C,WAAA;AAAA,qBAAAD,gBAElCd,MAAMC,UAAQ;AAAA,gBAAA,IACbmB,WAAQ;AAAA,yBAAAN,gBACLK,SAAO;AAAA,oBAAA,IAAC1B,YAAS;AAAA,6BAAE/B,OAAOkB,QAAQE;AAAAA,oBAAuB;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,gBAAA,IAAAiC,WAAA;AAAA,yBAAAD,gBAG3DtD,OAAK;AAAA,oBAAA,IAACa,UAAO;AAAA,6BAAEA,SAAAA;AAAAA,oBAAS;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA;AAAA,QAIjC;AAAA,MAAA,CAAC,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAIT;"}
1
+ {"version":3,"file":"Match.js","sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\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 { Dynamic } from 'solid-js/web'\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 type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n const matchState = useRouterState({\n select: (s) => {\n const match = s.matches.find((d) => d.id === props.matchId)\n\n invariant(\n match,\n `Could not find match for matchId \"${props.matchId}\". Please file an issue!`,\n )\n return {\n routeId: match.routeId,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n }\n },\n })\n\n const route: () => AnyRoute = () => router.routesById[matchState().routeId]\n\n const PendingComponent = () =>\n route().options.pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n 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\n const ResolvedSuspenseBoundary = () =>\n // If we're on the root route, allow forcefully wrapping in suspense\n (!route().isRoot ||\n route().options.wrapInSuspense ||\n resolvedNoSsr ||\n matchState()._displayPending) &&\n (route().options.wrapInSuspense ??\n PendingComponent() ??\n ((route().options.errorComponent as any)?.preload || resolvedNoSsr))\n ? Solid.Suspense\n : SafeFragment\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const resetKey = useRouterState({\n select: (s) => s.loadedAt,\n })\n\n const parentRouteId = useRouterState({\n select: (s) => {\n const index = s.matches.findIndex((d) => d.id === props.matchId)\n return s.matches[index - 1]?.routeId as string\n },\n })\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <matchContext.Provider value={() => props.matchId}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={<Dynamic component={PendingComponent()} />}\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => resetKey()}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\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: ${props.matchId}`)\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\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 (\n <Dynamic component={routeNotFoundComponent()} {...error} />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!router.isServer}\n fallback={<Dynamic component={PendingComponent()} />}\n >\n <MatchInner matchId={props.matchId} />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner matchId={props.matchId} />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </matchContext.Provider>\n\n {parentRouteId() === rootRouteId ? (\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 location = useRouterState({\n select: (s) => {\n return s.resolvedLocation?.state.__TSR_key\n },\n })\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(router.state),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (props: { matchId: string }): any => {\n const router = useRouter()\n\n const matchState = useRouterState({\n select: (s) => {\n const match = s.matches.find((d) => d.id === props.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 })\n\n const route = () => router.routesById[matchState().routeId]!\n\n const match = () => matchState().match\n\n const out = () => {\n const Comp = route().options.component ?? router.options.defaultComponent\n if (Comp) {\n const key = matchState().key ?? matchState().match.id\n return (\n <Solid.Show when={key} keyed>\n <Comp />\n </Solid.Show>\n )\n }\n return <Outlet />\n }\n\n return (\n <Solid.Switch>\n <Solid.Match when={match()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(match().id)?._nonReactive.displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () => router.getMatch(match().id)?._nonReactive.minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ?? router.options.defaultPendingMinMs\n\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 (!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\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(match().id)?._nonReactive.loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'notFound'}>\n {(_) => {\n invariant(isNotFound(match().error), 'Expected a notFound error')\n\n return renderRouteNotFound(router, route(), match().error)\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'redirected'}>\n {(_) => {\n invariant(isRedirect(match().error), 'Expected a redirect error')\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(match().id)?._nonReactive.loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'error'}>\n {(_) => {\n if (router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={match().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw match().error\n }}\n </Solid.Match>\n <Solid.Match when={match().status === 'success'}>{out()}</Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const matchId = Solid.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 const v = matches[index + 1]?.id\n return v\n },\n })\n\n return (\n <Solid.Switch>\n <Solid.Match when={parentGlobalNotFound()}>\n {renderRouteNotFound(router, route(), undefined)}\n </Solid.Match>\n <Solid.Match when={childMatchId()}>\n {(matchId) => {\n // const nextMatch = <Match matchId={matchId()} />\n\n return (\n <Solid.Show\n when={matchId() === rootRouteId}\n fallback={<Match matchId={matchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={matchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n"],"names":["Match","props","router","useRouter","matchState","useRouterState","select","s","match","matches","find","d","id","matchId","invariant","routeId","ssr","_displayPending","route","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","wrapInSuspense","preload","Solid","Suspense","SafeFragment","ResolvedCatchBoundary","CatchBoundary","ResolvedNotFoundBoundary","CatchNotFound","resetKey","loadedAt","parentRouteId","index","findIndex","ShellComponent","shellComponent","_$createComponent","children","matchContext","Provider","value","Dynamic","fallback","getResetKey","ErrorComponent","error","isNotFound","warning","_$mergeProps","Switch","when","Show","isServer","MatchInner","_$memo","rootRouteId","OnRendered","ScrollRestoration","location","resolvedLocation","state","__TSR_key","createEffect","on","emit","type","getLocationChangeInfo","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","undefined","status","_forcePending","out","Comp","defaultComponent","keyed","Outlet","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","createControlledPromise","setTimeout","resolve","loaderResult","Promise","r","loadPromise","renderRouteNotFound","isRedirect","RouteErrorComponent","info","componentStack","useContext","parentGlobalNotFound","parentMatch","globalNotFound","childMatchId","v"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,QAAQA,CAACC,UAA+B;AACnD,QAAMC,SAASC,UAAAA;AACf,QAAMC,aAAaC,eAAe;AAAA,IAChCC,QAASC,CAAAA,MAAM;AACb,YAAMC,QAAQD,EAAEE,QAAQC,KAAMC,OAAMA,EAAEC,OAAOX,MAAMY,OAAO;AAE1DC,gBACEN,OACA,qCAAqCP,MAAMY,OAAO,0BACpD;AACA,aAAO;AAAA,QACLE,SAASP,MAAMO;AAAAA,QACfC,KAAKR,MAAMQ;AAAAA,QACXC,iBAAiBT,MAAMS;AAAAA,MAAAA;AAAAA,IAE3B;AAAA,EAAA,CACD;AAED,QAAMC,QAAwBA,MAAMhB,OAAOiB,WAAWf,WAAAA,EAAaW,OAAO;AAE1E,QAAMK,mBAAmBA,MACvBF,MAAAA,EAAQG,QAAQC,oBAAoBpB,OAAOmB,QAAQE;AAErD,QAAMC,sBAAsBA,MAC1BN,MAAAA,EAAQG,QAAQI,kBAAkBvB,OAAOmB,QAAQK;AAEnD,QAAMC,eAAeA,MACnBT,MAAAA,EAAQG,QAAQO,WAAW1B,OAAOmB,QAAQQ;AAE5C,QAAMC,yBAAyBA,MAC7BZ,MAAAA,EAAQa;AAAAA;AAAAA,IAEHb,QAAQG,QAAQW,qBACjB9B,OAAOmB,QAAQY,eAAeZ,QAAQa;AAAAA,MACtChB,MAAAA,EAAQG,QAAQW;AAEtB,QAAMG,gBACJ/B,aAAaY,QAAQ,SAASZ,WAAAA,EAAaY,QAAQ;AAErD,QAAMoB,2BAA2BA;AAAAA;AAAAA,KAE9B,CAAClB,MAAAA,EAAQa,UACRb,MAAAA,EAAQG,QAAQgB,kBAChBF,iBACA/B,WAAAA,EAAaa,qBACdC,QAAQG,QAAQgB,kBACfjB,uBACEF,MAAAA,EAAQG,QAAQI,gBAAwBa,WAAWH,kBACnDI,MA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,IAACmE,OAAI;AAAA,iBAAE4D,qBAAAA;AAAAA,QAAsB;AAAA,QAAA,IAAAzE,WAAA;AAAA,iBACtCmE,oBAAoBvH,QAAQgB,MAAAA,GAAS6E,MAAS;AAAA,QAAC;AAAA,MAAA,CAAA,GAAA1C,gBAEjDd,MAAMvC,OAAK;AAAA,QAAA,IAACmE,OAAI;AAAA,iBAAE+D,aAAAA;AAAAA,QAAc;AAAA,QAAA5E,UAC7BzC,CAAAA,aAAY;AAGZ,iBAAAwC,gBACGd,MAAM6B,MAAI;AAAA,YAAA,IACTD,OAAI;AAAA,qBAAEtD,eAAc2D;AAAAA,YAAW;AAAA,YAAA,IAC/Bb,WAAQ;AAAA,qBAAAN,gBAAGrD,OAAK;AAAA,gBAAA,IAACa,UAAO;AAAA,yBAAEA,SAAAA;AAAAA,gBAAS;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,YAAA,IAAAyC,WAAA;AAAA,qBAAAD,gBAElCd,MAAMC,UAAQ;AAAA,gBAAA,IACbmB,WAAQ;AAAA,yBAAAN,gBACLK,SAAO;AAAA,oBAAA,IAACxB,YAAS;AAAA,6BAAEhC,OAAOmB,QAAQE;AAAAA,oBAAuB;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,gBAAA,IAAA+B,WAAA;AAAA,yBAAAD,gBAG3DrD,OAAK;AAAA,oBAAA,IAACa,UAAO;AAAA,6BAAEA,SAAAA;AAAAA,oBAAS;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA;AAAA,QAIjC;AAAA,MAAA,CAAC,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAIT;"}
@@ -1,5 +1,5 @@
1
- export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
2
- export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, } from '@tanstack/router-core';
1
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, createControlledPromise, retainSearchParams, stripSearchParams, createSerializationAdapter, } from '@tanstack/router-core';
2
+ export type { DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, RedirectOptions, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, CreateFileRoute, CreateLazyFileRoute, Transformer, AnyTransformer, } from '@tanstack/router-core';
3
3
  export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
4
4
  export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
5
5
  export { useAwaited, Await } from './awaited.js';
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PathParamError, SearchParamError, TSR_DEFERRED_PROMISE, cleanPath, componentTypes, createControlledPromise, decode, deepEqual, defaultParseSearch, defaultSerializeError, defaultStringifySearch, defer, encode, functionalUpdate, getInitialRouterState, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, matchByPath, matchPathname, notFound, parsePathname, parseSearchWith, pick, redirect, removeBasepath, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
1
+ import { PathParamError, SearchParamError, TSR_DEFERRED_PROMISE, cleanPath, componentTypes, createControlledPromise, createSerializationAdapter, deepEqual, defaultParseSearch, defaultSerializeError, defaultStringifySearch, defer, functionalUpdate, getInitialRouterState, interpolatePath, isMatch, isNotFound, isPlainArray, isPlainObject, isRedirect, joinPaths, lazyFn, matchByPath, matchPathname, notFound, parsePathname, parseSearchWith, redirect, removeBasepath, replaceEqualDeep, resolvePath, retainSearchParams, rootRouteId, stringifySearchWith, stripSearchParams, trimPath, trimPathLeft, trimPathRight } from "@tanstack/router-core";
2
2
  import { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory } from "@tanstack/history";
3
3
  import { Await, useAwaited } from "./awaited.js";
4
4
  import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
@@ -80,13 +80,12 @@ export {
80
80
  createRoute,
81
81
  createRouteMask,
82
82
  createRouter,
83
- decode,
83
+ createSerializationAdapter,
84
84
  deepEqual,
85
85
  defaultParseSearch,
86
86
  defaultSerializeError,
87
87
  defaultStringifySearch,
88
88
  defer,
89
- encode,
90
89
  functionalUpdate,
91
90
  getInitialRouterState,
92
91
  getRouteApi,
@@ -107,7 +106,6 @@ export {
107
106
  notFound,
108
107
  parsePathname,
109
108
  parseSearchWith,
110
- pick,
111
109
  redirect,
112
110
  removeBasepath,
113
111
  replaceEqualDeep,
@@ -10,7 +10,7 @@ import type * as Solid from 'solid-js';
10
10
  declare module '@tanstack/router-core' {
11
11
  interface UpdatableRouteOptionsExtensions {
12
12
  component?: RouteComponent;
13
- errorComponent?: false | null | ErrorRouteComponent;
13
+ errorComponent?: false | null | undefined | ErrorRouteComponent;
14
14
  notFoundComponent?: NotFoundRouteComponent;
15
15
  pendingComponent?: RouteComponent;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"route.js","sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type * as Solid from 'solid-js'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({\n children,\n }: {\n children: Solid.JSX.Element\n }) => Solid.JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useMatch({\n from: this.id as any,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n >\n extends BaseRoute<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n implements\n RouteCore<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useMatch({\n ...opts,\n from: this.id,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n>(\n options: RouteOptions<\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n): Route<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown\n> {\n return new Route<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n >(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n ) => {\n return createRootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >(options as any)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n >\n extends BaseRootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n implements\n RootRouteCore<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useMatch({\n ...opts,\n from: this.id,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = Solid.JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n> extends Route<\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n>(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n): RootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown\n> {\n return new RootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >(options)\n}\n"],"names":["getRouteApi","id","RouteApi","BaseRouteApi","constructor","useMatch","opts","select","from","useRouteContext","d","context","useSearch","useParams","useLoaderDeps","strict","useLoaderData","useNavigate","router","useRouter","routesById","fullPath","notFound","routeId","Link","props","_$createComponent","_$mergeProps","Route","BaseRoute","options","_self$","createRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","RootRoute","BaseRootRoute","_self$2","createRouteMask","NotFoundRoute"],"mappings":";;;;;;;;;;AA+EO,SAASA,YAGdC,IAA2D;AAC3D,SAAO,IAAIC,SAAuB;AAAA,IAAED;AAAAA,EAAAA,CAAI;AAC1C;AAEO,MAAMC,iBAGHC,aAA2B;AAAA;AAAA;AAAA;AAAA,EAInCC,YAAY;AAAA,IAAEH;AAAAA,EAAAA,GAAmB;AAC/B,UAAM;AAAA,MAAEA;AAAAA,IAAAA,CAAI;AAGdI,SAAAA,WAAgCC,CAAAA,SAAS;AACvC,aAAOD,SAAS;AAAA,QACdE,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAQ,SAAAA,kBAA8CH,CAAAA,SAAS;AACrD,aAAOD,SAAS;AAAA,QACdG,MAAM,KAAKP;AAAAA,QACXM,QAASG,OAAOJ,MAAMC,SAASD,KAAKC,OAAOG,EAAEC,OAAO,IAAID,EAAEC;AAAAA,MAAAA,CAC3D;AAAA,IACH;AAEAC,SAAAA,YAAkCN,CAAAA,SAAS;AACzC,aAAOM,UAAU;AAAA,QACfL,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAY,SAAAA,YAA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AE8B,QAAKjB;AAAAA,QAAQ;AAAA,MAAA,GAAOI,KAAY,CAAA;AAAA,IACrD;AAAA,EA7CA;AA8CF;AAEO,SAASc,gBAKdjC,MAGuB;AACvB,SAAOA;AACT;AAmBO,MAAMkC,sBASHZ,MAcR;AAAA,EACAxB,YACE0B,SAsBA;AACA,UAAM;AAAA,MACJ,GAAIA;AAAAA,MACJ7B,IAAI;AAAA,IAAA,CACL;AAAA,EACH;AACF;AAEO,SAASiC,gBAQdJ,SAiBA;AACA,SAAO,IAAIM,UAOTN,OAAO;AACX;"}
1
+ {"version":3,"file":"route.js","sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type * as Solid from 'solid-js'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({\n children,\n }: {\n children: Solid.JSX.Element\n }) => Solid.JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useMatch({\n from: this.id as any,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n >\n extends BaseRoute<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n implements\n RouteCore<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useMatch({\n ...opts,\n from: this.id,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n>(\n options: RouteOptions<\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n): Route<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown\n> {\n return new Route<\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n >(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n ) => {\n return createRootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >(options as any)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n >\n extends BaseRootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n implements\n RootRouteCore<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useMatch({\n ...opts,\n from: this.id,\n select: (d) => (opts?.select ? opts.select(d.context) : d.context),\n }) as any\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = Solid.JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n> extends Route<\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n>(\n options?: RootRouteOptions<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >,\n): RootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown\n> {\n return new RootRoute<\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn\n >(options)\n}\n"],"names":["getRouteApi","id","RouteApi","BaseRouteApi","constructor","useMatch","opts","select","from","useRouteContext","d","context","useSearch","useParams","useLoaderDeps","strict","useLoaderData","useNavigate","router","useRouter","routesById","fullPath","notFound","routeId","Link","props","_$createComponent","_$mergeProps","Route","BaseRoute","options","_self$","createRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","RootRoute","BaseRootRoute","_self$2","createRouteMask","NotFoundRoute"],"mappings":";;;;;;;;;;AA+EO,SAASA,YAGdC,IAA2D;AAC3D,SAAO,IAAIC,SAAuB;AAAA,IAAED;AAAAA,EAAAA,CAAI;AAC1C;AAEO,MAAMC,iBAGHC,aAA2B;AAAA;AAAA;AAAA;AAAA,EAInCC,YAAY;AAAA,IAAEH;AAAAA,EAAAA,GAAmB;AAC/B,UAAM;AAAA,MAAEA;AAAAA,IAAAA,CAAI;AAGdI,SAAAA,WAAgCC,CAAAA,SAAS;AACvC,aAAOD,SAAS;AAAA,QACdE,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAQ,SAAAA,kBAA8CH,CAAAA,SAAS;AACrD,aAAOD,SAAS;AAAA,QACdG,MAAM,KAAKP;AAAAA,QACXM,QAASG,OAAOJ,MAAMC,SAASD,KAAKC,OAAOG,EAAEC,OAAO,IAAID,EAAEC;AAAAA,MAAAA,CAC3D;AAAA,IACH;AAEAC,SAAAA,YAAkCN,CAAAA,SAAS;AACzC,aAAOM,UAAU;AAAA,QACfL,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAY,SAAAA,YAAkCP,CAAAA,SAAS;AACzC,aAAOO,UAAU;AAAA,QACfN,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAa,SAAAA,gBAA0CR,CAAAA,SAAS;AACjD,aAAOQ,cAAc;AAAA,QAAE,GAAGR;AAAAA,QAAME,MAAM,KAAKP;AAAAA,QAAIc,QAAQ;AAAA,MAAA,CAAc;AAAA,IACvE;AAEAC,SAAAA,g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iC,gBAQdJ,SAiBA;AACA,SAAO,IAAIM,UAOTN,OAAO;AACX;"}
@@ -64,6 +64,6 @@ declare module '@tanstack/router-core' {
64
64
  }
65
65
  }
66
66
  export declare const createRouter: CreateRouterFn;
67
- export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated> {
68
- constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>);
67
+ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption = 'never', in out TDefaultStructuralSharingOption extends boolean = false, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TTransformerConfig = any> extends RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig> {
68
+ constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated, TTransformerConfig>);
69
69
  }
@@ -13,7 +13,7 @@ if (typeof globalThis !== "undefined") {
13
13
  globalThis.createLazyFileRoute = createLazyFileRoute;
14
14
  } else if (typeof window !== "undefined") {
15
15
  window.createFileRoute = createFileRoute;
16
- window.createFileRoute = createLazyFileRoute;
16
+ window.createLazyFileRoute = createLazyFileRoute;
17
17
  }
18
18
  export {
19
19
  Router,
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createFileRoute = createLazyFileRoute\n}\n"],"names":[],"mappings":";;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAMH,WAMR;AAAA,EACA,YACE,SAOA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkB;AACrC,aAAmB,sBAAsB;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkB;AACjC,SAAe,kBAAkB;AACrC;"}
1
+ {"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { createFileRoute, createLazyFileRoute } from './fileRoute'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n in out TTransformerConfig = any,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated,\n TTransformerConfig\n >,\n ) {\n super(options)\n }\n}\n\nif (typeof globalThis !== 'undefined') {\n ;(globalThis as any).createFileRoute = createFileRoute\n ;(globalThis as any).createLazyFileRoute = createLazyFileRoute\n} else if (typeof window !== 'undefined') {\n ;(window as any).createFileRoute = createFileRoute\n ;(window as any).createLazyFileRoute = createLazyFileRoute\n}\n"],"names":[],"mappings":";;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAOH,WAOR;AAAA,EACA,YACE,SAQA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkB;AACrC,aAAmB,sBAAsB;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkB;AACjC,SAAe,sBAAsB;AACzC;"}
@@ -14,11 +14,13 @@ export const useTags = () => {
14
14
  const resultMeta = [];
15
15
  const metaByAttribute = {};
16
16
  let title;
17
- [...routeMeta()].reverse().forEach((metas) => {
18
- ;
19
- [...metas].reverse().forEach((m) => {
17
+ const routeMetasArray = routeMeta();
18
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
19
+ const metas = routeMetasArray[i];
20
+ for (let j = metas.length - 1; j >= 0; j--) {
21
+ const m = metas[j];
20
22
  if (!m)
21
- return;
23
+ continue;
22
24
  if (m.title) {
23
25
  if (!title) {
24
26
  title = {
@@ -31,7 +33,7 @@ export const useTags = () => {
31
33
  const attribute = m.name ?? m.property;
32
34
  if (attribute) {
33
35
  if (metaByAttribute[attribute]) {
34
- return;
36
+ continue;
35
37
  }
36
38
  else {
37
39
  metaByAttribute[attribute] = true;
@@ -44,8 +46,8 @@ export const useTags = () => {
44
46
  },
45
47
  });
46
48
  }
47
- });
48
- });
49
+ }
50
+ }
49
51
  if (title) {
50
52
  resultMeta.push(title);
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.jsx","sourceRoot":"","sources":["../../src/HeadContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,SAAS,GAA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