@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.
@@ -34,9 +34,12 @@ const useTags = () => {
34
34
  const resultMeta = [];
35
35
  const metaByAttribute = {};
36
36
  let title;
37
- [...routeMeta()].reverse().forEach((metas) => {
38
- [...metas].reverse().forEach((m) => {
39
- if (!m) return;
37
+ const routeMetasArray = routeMeta();
38
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
39
+ const metas = routeMetasArray[i];
40
+ for (let j = metas.length - 1; j >= 0; j--) {
41
+ const m = metas[j];
42
+ if (!m) continue;
40
43
  if (m.title) {
41
44
  if (!title) {
42
45
  title = {
@@ -48,7 +51,7 @@ const useTags = () => {
48
51
  const attribute = m.name ?? m.property;
49
52
  if (attribute) {
50
53
  if (metaByAttribute[attribute]) {
51
- return;
54
+ continue;
52
55
  } else {
53
56
  metaByAttribute[attribute] = true;
54
57
  }
@@ -60,8 +63,8 @@ const useTags = () => {
60
63
  }
61
64
  });
62
65
  }
63
- });
64
- });
66
+ }
67
+ }
65
68
  if (title) {
66
69
  resultMeta.push(title);
67
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.cjs","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,UAAAA;AAEf,QAAMC,YAAYC,eAAAA,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,QAAgDG,iBAAMC,WAAW,MAAM;AAC3E,UAAMC,aAAsC,CAAA;AAC5C,UAAMC,kBAAwC,CAAA;AAC9C,QAAIC;AACH,KAAC,GAAGd,UAAAA,CAAW,EAAEe,QA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AU,GAAG2B;AAAAA,IAAAA,OAAc;AAAA,MAClC5B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGsB;AAAAA,MAAAA;AAAAA,MAEL3B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL4B,OACE,CACE,GAAGzC,MAAAA,GACH,GAAG6B,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGkB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAOxD,QAAAA;AACb,SAAAyD,MAAAA,gBACGC,KAAAA,cAAY;AAAA,IAAA,IAAAnC,WAAA;AAAA,aACViC,OAAOhD,IAAKc,SAAGmC,sBACbE,MAAAA,OAAUrC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,CAAA;AAGR;AAEA,SAAS6B,OAAUS,KAAeC,IAAyB;AACzD,QAAMC,2BAAWC,IAAAA;AACjB,SAAOH,IAAIjD,OAAQqD,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;;;"}
1
+ {"version":3,"file":"HeadContent.cjs","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,UAAAA;AAEf,QAAMC,YAAYC,eAAAA,eAAe;AAAA,IAC/BC,QAASC,CAAAA,UAAU;AACjB,aAAOA,MAAMC,QAAQC,IAAKC,CAAAA,UAAUA,MAAMC,IAAK,EAAEC,OAAOC,OAAO;AAAA,IAC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,MAEL3B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,QAAM4B,cAAcjD,eAAAA,eAAe;AAAA,IACjCC,QAASC,CAAAA,UAELA,MAAMC,QACHC,IAAKC,WAAUA,MAAM4C,WAAY,EACjCnB,KAAK,CAAC,EACNvB,OAAOC,OAAO,EACjBJ,IAAI,CAAC;AAAA,MAAEiB;AAAAA,MAAU,GAAG6B;AAAAA,IAAAA,OAAc;AAAA,MAClC9B,KAAK;AAAA,MACLM,OAAO;AAAA,QACL,GAAGwB;AAAAA,MAAAA;AAAAA,MAEL7B;AAAAA,IAAAA,EACA;AAAA,EAAA,CACL;AAED,SAAO,MACL8B,OACE,CACE,GAAG7C,MAAAA,GACH,GAAGgC,YAAAA,GACH,GAAGV,MAAAA,GACH,GAAGmB,OAAAA,GACH,GAAGE,YAAAA,CAAa,GAEjBG,CAAAA,MAAM;AACL,WAAOC,KAAKC,UAAUF,CAAC;AAAA,EACzB,CACF;AACJ;AAMO,SAASG,cAAc;AAC5B,QAAMC,OAAO5D,QAAAA;AACb,SAAA6D,MAAAA,gBACGC,KAAAA,cAAY;AAAA,IAAA,IAAArC,WAAA;AAAA,aACVmC,OAAOpD,IAAKgB,SAAGqC,sBACbE,MAAAA,OAAUvC,GAAG,CACf;AAAA,IAAC;AAAA,EAAA,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;;;"}
@@ -36,7 +36,11 @@ const Match = (props) => {
36
36
  select: (s) => {
37
37
  const match = s.matches.find((d) => d.id === props.matchId);
38
38
  invariant(match, `Could not find match for matchId "${props.matchId}". Please file an issue!`);
39
- return routerCore.pick(match, ["routeId", "ssr", "_displayPending"]);
39
+ return {
40
+ routeId: match.routeId,
41
+ ssr: match.ssr,
42
+ _displayPending: match._displayPending
43
+ };
40
44
  }
41
45
  });
42
46
  const route = () => router.routesById[matchState().routeId];
@@ -175,8 +179,7 @@ const MatchInner = (props) => {
175
179
  const router = useRouter.useRouter();
176
180
  const matchState = useRouterState.useRouterState({
177
181
  select: (s) => {
178
- const matchIndex = s.matches.findIndex((d) => d.id === props.matchId);
179
- const match2 = s.matches[matchIndex];
182
+ const match2 = s.matches.find((d) => d.id === props.matchId);
180
183
  const routeId = match2.routeId;
181
184
  const remountFn = router.routesById[routeId].options.remountDeps ?? router.options.defaultRemountDeps;
182
185
  const remountDeps = remountFn?.({
@@ -189,7 +192,13 @@ const MatchInner = (props) => {
189
192
  return {
190
193
  key,
191
194
  routeId,
192
- match: routerCore.pick(match2, ["id", "status", "error", "_forcePending", "_displayPending"])
195
+ match: {
196
+ id: match2.id,
197
+ status: match2.status,
198
+ error: match2.error,
199
+ _forcePending: match2._forcePending,
200
+ _displayPending: match2._displayPending
201
+ }
193
202
  };
194
203
  }
195
204
  });
@@ -198,10 +207,9 @@ const MatchInner = (props) => {
198
207
  const out = () => {
199
208
  const Comp = route().options.component ?? router.options.defaultComponent;
200
209
  if (Comp) {
210
+ const key = matchState().key ?? matchState().match.id;
201
211
  return Solid.createComponent(Solid__namespace.Show, {
202
- get when() {
203
- return matchState().match.id;
204
- },
212
+ when: key,
205
213
  keyed: true,
206
214
  get children() {
207
215
  return Solid.createComponent(Comp, {});
@@ -217,7 +225,7 @@ const MatchInner = (props) => {
217
225
  return match()._displayPending;
218
226
  },
219
227
  children: (_) => {
220
- const [displayPendingResult] = Solid__namespace.createResource(() => router.getMatch(match().id)?.displayPendingPromise);
228
+ const [displayPendingResult] = Solid__namespace.createResource(() => router.getMatch(match().id)?._nonReactive.displayPendingPromise);
221
229
  return Solid.memo(displayPendingResult);
222
230
  }
223
231
  }), Solid.createComponent(Solid__namespace.Match, {
@@ -225,7 +233,7 @@ const MatchInner = (props) => {
225
233
  return match()._forcePending;
226
234
  },
227
235
  children: (_) => {
228
- const [minPendingResult] = Solid__namespace.createResource(() => router.getMatch(match().id)?.minPendingPromise);
236
+ const [minPendingResult] = Solid__namespace.createResource(() => router.getMatch(match().id)?._nonReactive.minPendingPromise);
229
237
  return Solid.memo(minPendingResult);
230
238
  }
231
239
  }), Solid.createComponent(Solid__namespace.Match, {
@@ -234,27 +242,22 @@ const MatchInner = (props) => {
234
242
  },
235
243
  children: (_) => {
236
244
  const pendingMinMs = route().options.pendingMinMs ?? router.options.defaultPendingMinMs;
237
- if (pendingMinMs && !router.getMatch(match().id)?.minPendingPromise) {
238
- if (!router.isServer) {
239
- const minPendingPromise = routerCore.createControlledPromise();
240
- Promise.resolve().then(() => {
241
- router.updateMatch(match().id, (prev) => ({
242
- ...prev,
243
- minPendingPromise
244
- }));
245
- });
246
- setTimeout(() => {
247
- minPendingPromise.resolve();
248
- router.updateMatch(match().id, (prev) => ({
249
- ...prev,
250
- minPendingPromise: void 0
251
- }));
252
- }, pendingMinMs);
245
+ if (pendingMinMs) {
246
+ const routerMatch = router.getMatch(match().id);
247
+ if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {
248
+ if (!router.isServer) {
249
+ const minPendingPromise = routerCore.createControlledPromise();
250
+ routerMatch._nonReactive.minPendingPromise = minPendingPromise;
251
+ setTimeout(() => {
252
+ minPendingPromise.resolve();
253
+ routerMatch._nonReactive.minPendingPromise = void 0;
254
+ }, pendingMinMs);
255
+ }
253
256
  }
254
257
  }
255
258
  const [loaderResult] = Solid__namespace.createResource(async () => {
256
259
  await new Promise((r) => setTimeout(r, 0));
257
- return router.getMatch(match().id)?.loadPromise;
260
+ return router.getMatch(match().id)?._nonReactive.loadPromise;
258
261
  });
259
262
  return Solid.memo(loaderResult);
260
263
  }
@@ -274,7 +277,7 @@ const MatchInner = (props) => {
274
277
  invariant(routerCore.isRedirect(match().error), "Expected a redirect error");
275
278
  const [loaderResult] = Solid__namespace.createResource(async () => {
276
279
  await new Promise((r) => setTimeout(r, 0));
277
- return router.getMatch(match().id)?.loadPromise;
280
+ return router.getMatch(match().id)?._nonReactive.loadPromise;
278
281
  });
279
282
  return Solid.memo(loaderResult);
280
283
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Match.cjs","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAMA,QAAQA,CAACC,UAA+B;AACnD,QAAMC,SAASC,UAAAA,UAAAA;AACf,QAAMC,aAAaC,eAAAA,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,aAAOE,WAAAA,KAAKP,OAAO,CAAC,WAAW,OAAO,iBAAiB,CAAC;AAAA,IAC1D;AAAA,EAAA,CACD;AAED,QAAMQ,QAAwBA,MAAMd,OAAOe,WAAWb,WAAAA,EAAac,OAAO;AAE1E,QAAMC,mBAAmBA,MACvBH,MAAAA,EAAQI,QAAQC,oBAAoBnB,OAAOkB,QAAQE;AAErD,QAAMC,sBAAsBA,MAC1BP,MAAAA,EAAQI,QAAQI,kBAAkBtB,OAAOkB,QAAQK;AAEnD,QAAMC,eAAeA,MACnBV,MAAAA,EAAQI,QAAQO,WAAWzB,OAAOkB,QAAQQ;AA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d,iBAAMxC,OAAK;AAAA,QAAA,IAACoE,OAAI;AAAA,iBAAEiE,aAAAA;AAAAA,QAAc;AAAA,QAAA9E,UAC7B1C,CAAAA,aAAY;AAGZ,iBAAAyC,MAAAA,gBACGd,iBAAM6B,MAAI;AAAA,YAAA,IACTD,OAAI;AAAA,qBAAEvD,eAAc4D,WAAAA;AAAAA,YAAW;AAAA,YAAA,IAC/Bb,WAAQ;AAAA,qBAAAN,MAAAA,gBAAGtD,OAAK;AAAA,gBAAA,IAACa,UAAO;AAAA,yBAAEA,SAAAA;AAAAA,gBAAS;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,YAAA,IAAA0C,WAAA;AAAA,qBAAAD,MAAAA,gBAElCd,iBAAMC,UAAQ;AAAA,gBAAA,IACbmB,WAAQ;AAAA,yBAAAN,MAAAA,gBACLK,MAAAA,SAAO;AAAA,oBAAA,IAAC1B,YAAS;AAAA,6BAAE/B,OAAOkB,QAAQE;AAAAA,oBAAuB;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,gBAAA,IAAAiC,WAAA;AAAA,yBAAAD,MAAAA,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.cjs","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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,yBAAAN,MAAAA,gBACLK,MAAAA,SAAO;AAAA,oBAAA,IAACxB,YAAS;AAAA,6BAAEhC,OAAOmB,QAAQE;AAAAA,oBAAuB;AAAA,kBAAA,CAAA;AAAA,gBAAA;AAAA,gBAAA,IAAA+B,WAAA;AAAA,yBAAAD,MAAAA,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;;;;"}
@@ -58,9 +58,9 @@ Object.defineProperty(exports, "createControlledPromise", {
58
58
  enumerable: true,
59
59
  get: () => routerCore.createControlledPromise
60
60
  });
61
- Object.defineProperty(exports, "decode", {
61
+ Object.defineProperty(exports, "createSerializationAdapter", {
62
62
  enumerable: true,
63
- get: () => routerCore.decode
63
+ get: () => routerCore.createSerializationAdapter
64
64
  });
65
65
  Object.defineProperty(exports, "deepEqual", {
66
66
  enumerable: true,
@@ -82,10 +82,6 @@ Object.defineProperty(exports, "defer", {
82
82
  enumerable: true,
83
83
  get: () => routerCore.defer
84
84
  });
85
- Object.defineProperty(exports, "encode", {
86
- enumerable: true,
87
- get: () => routerCore.encode
88
- });
89
85
  Object.defineProperty(exports, "functionalUpdate", {
90
86
  enumerable: true,
91
87
  get: () => routerCore.functionalUpdate
@@ -146,10 +142,6 @@ Object.defineProperty(exports, "parseSearchWith", {
146
142
  enumerable: true,
147
143
  get: () => routerCore.parseSearchWith
148
144
  });
149
- Object.defineProperty(exports, "pick", {
150
- enumerable: true,
151
- get: () => routerCore.pick
152
- });
153
145
  Object.defineProperty(exports, "redirect", {
154
146
  enumerable: true,
155
147
  get: () => routerCore.redirect
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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.cjs';
@@ -1 +1 @@
1
- {"version":3,"file":"route.cjs","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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'@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,WAAAA,aAA2B;AAAA;AAAA;AAAA;AAAA,EAInCC,YAAY;AAAA,IAAEH;AAAAA,EAAAA,GAAmB;AAC/B,UAAM;AAAA,MAAEA;AAAAA,IAAAA,C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,QAAQD,MAAMC;AAAAA,QACdC,MAAM,KAAKP;AAAAA,MAAAA,CACL;AAAA,IACV;AAEAa,SAAAA,gBAAkDR,CAAAA,SAAS;AACzD,aAAOQ,4BAAc;AAAA,QAAE,GAAGR;AAAAA,QAAME,MAAM,KAAKP;AAAAA,MAAAA,CAAW;AAAA,IACxD;AAEAe,SAAAA,gBAAkDV,CAAAA,SAAS;AACzD,aAAOU,4BAAc;AAAA,QAAE,GAAGV;AAAAA,QAAME,MAAM,KAAKP;AAAAA,MAAAA,CAAW;AAAA,IACxD;AAEAgB,SAAAA,cAAcA,MAA8B;AAC1C,aAAOA,wBAAY;AAAA,QAAET,MAAM,KAAKa;AAAAA,MAAAA,CAAU;AAAA,IAC5C;AAEAG,SAAAA,OAAkCC,CAAAA,UAAU;AAAA,YAAAa,UAAA;AAC1C,aAAAZ,MAAAA,gBAAQF,KAAAA,MAAIG,iBAAA;AAAA,QAAA,IAACnB,OAAI;AAAA,iBAAE8B,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;;;;;;;;;;;"}
@@ -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
  }
@@ -15,7 +15,7 @@ if (typeof globalThis !== "undefined") {
15
15
  globalThis.createLazyFileRoute = fileRoute.createLazyFileRoute;
16
16
  } else if (typeof window !== "undefined") {
17
17
  window.createFileRoute = fileRoute.createFileRoute;
18
- window.createFileRoute = fileRoute.createLazyFileRoute;
18
+ window.createLazyFileRoute = fileRoute.createLazyFileRoute;
19
19
  }
20
20
  exports.Router = Router;
21
21
  exports.createRouter = createRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs","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":["RouterCore","createFileRoute","createLazyFileRoute"],"mappings":";;;;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAMHA,WAAAA,WAMR;AAAA,EACA,YACE,SAOA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkBC,UAAAA;AACrC,aAAmB,sBAAsBC,UAAAA;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkBD,UAAAA;AACjC,SAAe,kBAAkBC,UAAAA;AACrC;;;"}
1
+ {"version":3,"file":"router.cjs","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":["RouterCore","createFileRoute","createLazyFileRoute"],"mappings":";;;;AA2EO,MAAM,eAA+B,CAAC,YAAY;AACvD,SAAO,IAAI,OAAO,OAAO;AAC3B;AAEO,MAAM,eAOHA,WAAAA,WAOR;AAAA,EACA,YACE,SAQA;AACA,UAAM,OAAO;AAAA,EACf;AACF;AAEA,IAAI,OAAO,eAAe,aAAa;AACnC,aAAmB,kBAAkBC,UAAAA;AACrC,aAAmB,sBAAsBC,UAAAA;AAC7C,WAAW,OAAO,WAAW,aAAa;AACtC,SAAe,kBAAkBD,UAAAA;AACjC,SAAe,sBAAsBC,UAAAA;AACzC;;;"}
@@ -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
  }
@@ -15,9 +15,12 @@ const useTags = () => {
15
15
  const resultMeta = [];
16
16
  const metaByAttribute = {};
17
17
  let title;
18
- [...routeMeta()].reverse().forEach((metas) => {
19
- [...metas].reverse().forEach((m) => {
20
- if (!m) return;
18
+ const routeMetasArray = routeMeta();
19
+ for (let i = routeMetasArray.length - 1; i >= 0; i--) {
20
+ const metas = routeMetasArray[i];
21
+ for (let j = metas.length - 1; j >= 0; j--) {
22
+ const m = metas[j];
23
+ if (!m) continue;
21
24
  if (m.title) {
22
25
  if (!title) {
23
26
  title = {
@@ -29,7 +32,7 @@ const useTags = () => {
29
32
  const attribute = m.name ?? m.property;
30
33
  if (attribute) {
31
34
  if (metaByAttribute[attribute]) {
32
- return;
35
+ continue;
33
36
  } else {
34
37
  metaByAttribute[attribute] = true;
35
38
  }
@@ -41,8 +44,8 @@ const useTags = () => {
41
44
  }
42
45
  });
43
46
  }
44
- });
45
- });
47
+ }
48
+ }
46
49
  if (title) {
47
50
  resultMeta.push(title);
48
51
  }