@tanstack/solid-router 2.0.0-beta.16 → 2.0.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/cjs/Asset.cjs.map +1 -1
  2. package/dist/cjs/Asset.d.cts +1 -1
  3. package/dist/cjs/CatchBoundary.cjs.map +1 -1
  4. package/dist/cjs/CatchBoundary.d.cts +4 -3
  5. package/dist/cjs/ClientOnly.cjs.map +1 -1
  6. package/dist/cjs/ClientOnly.d.cts +4 -3
  7. package/dist/cjs/HeadContent.d.cts +1 -1
  8. package/dist/cjs/HeadContent.dev.d.cts +1 -1
  9. package/dist/cjs/Match.d.cts +2 -3
  10. package/dist/cjs/Matches.cjs.map +1 -1
  11. package/dist/cjs/Matches.d.cts +8 -7
  12. package/dist/cjs/RouterProvider.cjs.map +1 -1
  13. package/dist/cjs/RouterProvider.d.cts +4 -4
  14. package/dist/cjs/SafeFragment.d.cts +1 -1
  15. package/dist/cjs/ScriptOnce.d.cts +1 -1
  16. package/dist/cjs/Scripts.d.cts +1 -2
  17. package/dist/cjs/awaited.d.cts +1 -2
  18. package/dist/cjs/link.cjs.map +1 -1
  19. package/dist/cjs/link.d.cts +10 -10
  20. package/dist/cjs/not-found.cjs.map +1 -1
  21. package/dist/cjs/not-found.d.cts +5 -5
  22. package/dist/cjs/renderRouteNotFound.d.cts +1 -1
  23. package/dist/cjs/route.cjs.map +1 -1
  24. package/dist/cjs/route.d.cts +5 -5
  25. package/dist/cjs/router.cjs.map +1 -1
  26. package/dist/cjs/router.d.cts +1 -1
  27. package/dist/cjs/scroll-restoration.d.cts +1 -1
  28. package/dist/cjs/ssr/RouterClient.d.cts +1 -1
  29. package/dist/cjs/ssr/RouterServer.d.cts +1 -1
  30. package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -1
  31. package/dist/cjs/ssr/renderRouterToStream.d.cts +2 -2
  32. package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -1
  33. package/dist/cjs/ssr/renderRouterToString.d.cts +2 -2
  34. package/dist/esm/Asset.d.ts +1 -1
  35. package/dist/esm/Asset.js.map +1 -1
  36. package/dist/esm/CatchBoundary.d.ts +4 -3
  37. package/dist/esm/CatchBoundary.js.map +1 -1
  38. package/dist/esm/ClientOnly.d.ts +4 -3
  39. package/dist/esm/ClientOnly.js.map +1 -1
  40. package/dist/esm/HeadContent.d.ts +1 -1
  41. package/dist/esm/HeadContent.dev.d.ts +1 -1
  42. package/dist/esm/Match.d.ts +2 -3
  43. package/dist/esm/Matches.d.ts +8 -7
  44. package/dist/esm/Matches.js.map +1 -1
  45. package/dist/esm/RouterProvider.d.ts +4 -4
  46. package/dist/esm/RouterProvider.js.map +1 -1
  47. package/dist/esm/SafeFragment.d.ts +1 -1
  48. package/dist/esm/ScriptOnce.d.ts +1 -1
  49. package/dist/esm/Scripts.d.ts +1 -2
  50. package/dist/esm/awaited.d.ts +1 -2
  51. package/dist/esm/link.d.ts +10 -10
  52. package/dist/esm/link.js.map +1 -1
  53. package/dist/esm/not-found.d.ts +5 -5
  54. package/dist/esm/not-found.js.map +1 -1
  55. package/dist/esm/renderRouteNotFound.d.ts +1 -1
  56. package/dist/esm/route.d.ts +5 -5
  57. package/dist/esm/route.js.map +1 -1
  58. package/dist/esm/router.d.ts +1 -1
  59. package/dist/esm/router.js.map +1 -1
  60. package/dist/esm/scroll-restoration.d.ts +1 -1
  61. package/dist/esm/ssr/RouterClient.d.ts +1 -1
  62. package/dist/esm/ssr/RouterServer.d.ts +1 -1
  63. package/dist/esm/ssr/renderRouterToStream.d.ts +2 -2
  64. package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
  65. package/dist/esm/ssr/renderRouterToString.d.ts +2 -2
  66. package/dist/esm/ssr/renderRouterToString.js.map +1 -1
  67. package/dist/source/Asset.d.ts +1 -1
  68. package/dist/source/CatchBoundary.d.ts +4 -3
  69. package/dist/source/CatchBoundary.jsx.map +1 -1
  70. package/dist/source/ClientOnly.d.ts +4 -3
  71. package/dist/source/ClientOnly.jsx.map +1 -1
  72. package/dist/source/HeadContent.d.ts +1 -1
  73. package/dist/source/HeadContent.dev.d.ts +1 -1
  74. package/dist/source/Match.d.ts +2 -3
  75. package/dist/source/Matches.d.ts +8 -7
  76. package/dist/source/Matches.jsx.map +1 -1
  77. package/dist/source/RouterProvider.d.ts +4 -4
  78. package/dist/source/RouterProvider.jsx.map +1 -1
  79. package/dist/source/SafeFragment.d.ts +1 -1
  80. package/dist/source/ScriptOnce.d.ts +1 -1
  81. package/dist/source/Scripts.d.ts +1 -2
  82. package/dist/source/awaited.d.ts +1 -2
  83. package/dist/source/link.d.ts +10 -10
  84. package/dist/source/link.jsx.map +1 -1
  85. package/dist/source/not-found.d.ts +5 -5
  86. package/dist/source/not-found.jsx.map +1 -1
  87. package/dist/source/renderRouteNotFound.d.ts +1 -1
  88. package/dist/source/route.d.ts +5 -5
  89. package/dist/source/route.jsx.map +1 -1
  90. package/dist/source/router.d.ts +1 -1
  91. package/dist/source/scroll-restoration.d.ts +1 -1
  92. package/dist/source/ssr/RouterClient.d.ts +1 -1
  93. package/dist/source/ssr/RouterServer.d.ts +1 -1
  94. package/dist/source/ssr/renderRouterToStream.d.ts +2 -2
  95. package/dist/source/ssr/renderRouterToString.d.ts +2 -2
  96. package/package.json +8 -8
  97. package/src/Asset.tsx +1 -1
  98. package/src/CatchBoundary.tsx +2 -1
  99. package/src/ClientOnly.tsx +3 -2
  100. package/src/Matches.tsx +8 -7
  101. package/src/RouterProvider.tsx +2 -1
  102. package/src/link.tsx +16 -20
  103. package/src/not-found.tsx +3 -2
  104. package/src/route.tsx +3 -7
  105. package/src/router.ts +1 -1
  106. package/src/ssr/renderRouterToStream.tsx +2 -2
  107. package/src/ssr/renderRouterToString.tsx +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","JSX","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgBK,YACdC,OACoD;AACpD,MAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOA;AAGT,MAAA,GAAA,sBAAA,YAAgBA,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMM,SAASb,kBAAAA,WAAW;CAE1B,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUR,UAAU;GAClB,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACFf,OAAMI,UAAUW,cAAc;OAE9B,OAAMnB;;EAGVoB,iBAAiB,EAAEpB,YAAY;GAC7B,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACF,QAAOf,MAAMC,WAAWc,cAAc;OAEtC,OAAMnB;;EAET,IAAAS,WAAA;AAAA,UAEAL,MAAMK;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
1
+ {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","JSX","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AASA,SAAgBM,YACdC,OACoD;AACpD,MAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOA;AAGT,MAAA,GAAA,sBAAA,YAAgBA,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMK,SAASb,kBAAAA,WAAW;CAE1B,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUP,UAAU;GAClB,MAAMkB,gBAAgBnB,YAAYC,MAAM;AAExC,OAAIkB,cACFd,OAAMG,UAAUW,cAAc;OAE9B,OAAMlB;;EAGVmB,iBAAiB,EAAEnB,YAAY;GAC7B,MAAMkB,gBAAgBnB,YAAYC,MAAM;AAExC,OAAIkB,cACF,QAAOd,MAAMC,WAAWa,cAAc;OAEtC,OAAMlB;;EAET,IAAAQ,WAAA;AAAA,UAEAJ,MAAMI;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
@@ -1,11 +1,11 @@
1
1
  import { NotFoundError } from '@tanstack/router-core';
2
- import * as Solid from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare function getNotFound(error: unknown): (NotFoundError & {
4
4
  isNotFound: true;
5
5
  }) | undefined;
6
6
  export declare function CatchNotFound(props: {
7
- fallback?: (error: NotFoundError) => Solid.JSX.Element;
7
+ fallback?: (error: NotFoundError) => JSX.Element;
8
8
  onCatch?: (error: NotFoundError) => void;
9
- children: Solid.JSX.Element;
10
- }): Solid.JSX.Element;
11
- export declare function DefaultGlobalNotFound(): Solid.JSX.Element;
9
+ children: JSX.Element;
10
+ }): JSX.Element;
11
+ export declare function DefaultGlobalNotFound(): JSX.Element;
@@ -7,4 +7,4 @@ import { AnyRoute, AnyRouter } from '@tanstack/router-core';
7
7
  * @param data - Additional data to pass to the not found component
8
8
  * @returns The rendered not found component or a default fallback component
9
9
  */
10
- export declare function renderRouteNotFound(router: AnyRouter, route: AnyRoute, data: any): import("solid-js").JSX.Element;
10
+ export declare function renderRouteNotFound(router: AnyRouter, route: AnyRoute, data: any): import("solid-js/web").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"route.cjs","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","Solid","UseRouteContextRoute","LinkComponentRoute","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","JSX","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"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 { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\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 useRouteContext({ ...(opts as any), from: this.id as any }) 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 TRegister = unknown,\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 in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\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 useRouteContext({ ...(opts as any), from: this.id }) 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 TRegister = unknown,\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 TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\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 TSSR,\n THandlers\n >,\n): Route<\n TRegister,\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 TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\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 TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\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 in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\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 useRouteContext({ ...(opts as any), from: this.id }) 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 TRegister,\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 TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\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 TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\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 TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;;AAiFA,SAAgB+D,YAGdC,IAA2D;AAC3D,QAAO,IAAIE,SAAuB,EAAEF,IAAI,CAAC;;AAG3C,IAAaE,WAAb,cAGUhE,sBAAAA,aAA2B;;;;CAInCiE,YAAY,EAAEH,MAAmB;AAC/B,QAAM,EAAEA,IAAI,CAAC;mBAGiBI,SAAS;AACvC,UAAO1D,iBAAAA,SAAS;IACd2D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;0BAGmCI,SAAS;AACrD,UAAOzD,wBAAAA,gBAAgB;IAAE,GAAIyD;IAAcE,MAAM,KAAKN;IAAW,CAAC;;oBAGlCI,SAAS;A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BAGPI,SAAS;AACzD,UAAO/D,sBAAAA,cAAc;IAAE,GAAG+D;IAAME,MAAM,KAAKN;IAAI,CAAQ;;2BAGb;AAC1C,UAAOvD,oBAAAA,YAAY,EAAE6D,MAAM,KAAKI,UAAU,CAAC;;gBAGXE,UAAU;GAAA,MAAA2B,UAAA;AAC1C,WAAA,GAAA,aAAA,iBAAQnG,aAAAA,OAAAA,GAAAA,aAAAA,YAAI,EAAA,IAACkE,OAAI;AAAA,WAAEiC,QAAK7B;MAAQ,EAAOE,MAAY,CAAA;;;;AAIvD,SAAgB4B,gBAKdpC,MAGuB;AACvB,QAAOA;;AAoBT,IAAagD,gBAAb,cAYUtF,MAiBR;CACAqC,YACE6B,SAyBA;AACA,QAAM;GACJ,GAAIA;GACJhC,IAAI;GACL,CAAC;;;AAIN,SAAgBqC,gBAWdL,SAuBA;AACA,QAAO,IAAIvE,UAYTuE,QAAQ"}
1
+ {"version":3,"file":"route.cjs","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","UseRouteContextRoute","LinkComponentRoute","JSX","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"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 { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\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 { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\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?: ({ children }: { children: JSX.Element }) => 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 useRouteContext({ ...(opts as any), from: this.id as any }) 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 TRegister = unknown,\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 in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\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 TSSR,\n TMiddlewares,\n THandlers\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 useRouteContext({ ...(opts as any), from: this.id }) 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 TRegister = unknown,\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 TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\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 TSSR,\n THandlers\n >,\n): Route<\n TRegister,\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 TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\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 TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\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 in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\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 useRouteContext({ ...(opts as any), from: this.id }) 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 = 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 TRegister,\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 TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\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 TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\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 TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;;AA6EA,SAAgB8D,YAGdC,IAA2D;AAC3D,QAAO,IAAIE,SAAuB,EAAEF,IAAI,CAAC;;AAG3C,IAAaE,WAAb,cAGU/D,sBAAAA,aAA2B;;;;CAInCgE,YAAY,EAAEH,MAAmB;AAC/B,QAAM,EAAEA,IAAI,CAAC;mBAGiBI,SAAS;AACvC,UAAOzD,iBAAAA,SAAS;IACd0D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;0BAGmCI,SAAS;AACrD,UAAOxD,wBAAAA,gBAAgB;IAAE,GAAIwD;IAAcE,MAAM,KAAKN;IAAW,CAAC;;oBAGlCI,SAAS;AACzC,UAAO3D,kBAAAA,UAAU;IACf4D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;oBAGuBI,SAAS;AACzC,UAAO5D,kBAAAA,UAAU;IACf6D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;wBAG+BI,SAAS;AACjD,UAAO7D,sBAAAA,cAAc;IAAE,GAAG6D;IAAME,MAAM,KAAKN;IAAIO,QAAQ;IAAO,CAAQ;;wBAG9BH,SAAS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K7B;MAAQ,EAAOE,MAAY,CAAA;;;;AAIvD,SAAgB4B,gBAKdpC,MAGuB;AACvB,QAAOA;;AAoBT,IAAagD,gBAAb,cAYUrF,MAiBR;CACAoC,YACE6B,SAyBA;AACA,QAAM;GACJ,GAAIA;GACJhC,IAAI;GACL,CAAC;;;AAIN,SAAgBqC,gBAWdL,SAuBA;AACA,QAAO,IAAItE,UAYTsE,QAAQ"}
@@ -6,7 +6,7 @@ import { UseParamsRoute } from './useParams.cjs';
6
6
  import { UseSearchRoute } from './useSearch.cjs';
7
7
  import { UseRouteContextRoute } from './useRouteContext.cjs';
8
8
  import { LinkComponentRoute } from './link.cjs';
9
- import type * as Solid from 'solid-js';
9
+ import { JSX } from '@solidjs/web';
10
10
  declare module '@tanstack/router-core' {
11
11
  interface UpdatableRouteOptionsExtensions {
12
12
  component?: RouteComponent;
@@ -15,9 +15,9 @@ declare module '@tanstack/router-core' {
15
15
  pendingComponent?: RouteComponent;
16
16
  }
17
17
  interface RootRouteOptionsExtensions {
18
- shellComponent?: ({ children, }: {
19
- children: Solid.JSX.Element;
20
- }) => Solid.JSX.Element;
18
+ shellComponent?: ({ children }: {
19
+ children: JSX.Element;
20
+ }) => JSX.Element;
21
21
  }
22
22
  interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
23
23
  useMatch: UseMatchRoute<TId>;
@@ -86,7 +86,7 @@ export declare class RootRoute<in out TRegister = Register, in out TSearchValida
86
86
  export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
87
87
  routeTree: TRouteTree;
88
88
  } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>): RouteMask<TRouteTree>;
89
- export type SolidNode = Solid.JSX.Element;
89
+ export type SolidNode = JSX.Element;
90
90
  export interface DefaultRouteTypes<TProps> {
91
91
  component: (props: TProps) => any;
92
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs","names":[],"sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { getStoreFactory } from './routerStores'\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, getStoreFactory)\n }\n}\n"],"mappings":";;;;AA2EA,IAAa,gBAAgC,YAAY;AACvD,QAAO,IAAI,OAAO,QAAQ;;AAG5B,IAAa,SAAb,cAMU,sBAAA,WAMR;CACA,YACE,SAOA;AACA,QAAM,SAAS,qBAAA,gBAAgB"}
1
+ {"version":3,"file":"router.cjs","names":[],"sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { getStoreFactory } from './routerStores'\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 '@solidjs/web'\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, getStoreFactory)\n }\n}\n"],"mappings":";;;;AA2EA,IAAa,gBAAgC,YAAY;AACvD,QAAO,IAAI,OAAO,QAAQ;;AAG5B,IAAa,SAAb,cAMU,sBAAA,WAMR;CACA,YACE,SAOA;AACA,QAAM,SAAS,qBAAA,gBAAgB"}
@@ -1,7 +1,7 @@
1
1
  import { RouterCore, AnyRoute, CreateRouterFn, RouterConstructorOptions, TrailingSlashOption } from '@tanstack/router-core';
2
2
  import { RouterHistory } from '@tanstack/history';
3
3
  import { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent } from './route.cjs';
4
- import { JSX } from 'solid-js';
4
+ import { JSX } from '@solidjs/web';
5
5
  declare module '@tanstack/router-core' {
6
6
  interface RouterOptionsExtensions {
7
7
  /**
@@ -1 +1 @@
1
- export declare function ScrollRestoration(): import("solid-js").JSX.Element;
1
+ export declare function ScrollRestoration(): import("solid-js/web").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
2
  export declare function RouterClient(props: {
3
3
  router: AnyRouter;
4
- }): import("solid-js").JSX.Element;
4
+ }): import("solid-js/web").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
2
  export declare function RouterServer<TRouter extends AnyRouter>(props: {
3
3
  router: TRouter;
4
- }): import("solid-js").JSX.Element;
4
+ }): import("solid-js/web").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"renderRouterToStream.cjs","names":["Solid","isbot","transformReadableStreamWithRouter","makeSsrSerovalPlugin","JSXElement","ReadableStream","AnyRouter","renderRouterToStream","request","router","responseHeaders","children","Request","Headers","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","headers","get","pipeTo","responseStream","Response","status","stores","statusCode","state"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { JSXElement } from 'solid-js'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSXElement\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n\n if (isbot(request.headers.get('User-Agent'))) {\n await stream\n }\n stream.pipeTo(writable)\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n )\n return new Response(responseStream as any, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n}\n"],"mappings":";;;;;;;AAQA,IAAaO,uBAAuB,OAAO,EACzCC,SACAC,QACAC,iBACAC,eAMI;CACJ,MAAM,EAAEG,UAAUC,aAAa,IAAIC,iBAAiB;CAKpD,MAAMI,kBAFHX,OAAOS,SAAiBD,yBACxBR,OAAOS,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,UAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;GAE/D;CAEF,MAAMC,SAASzB,aAAM0B,qBAAqBf,UAAU;EAClDgB,OAAOlB,OAAOS,QAAQC,KAAKQ;EAC3BC,SAASR;EACV,CAAQ;AAET,MAAA,GAAA,MAAA,OAAUZ,QAAQqB,QAAQC,IAAI,aAAa,CAAC,CAC1C,OAAML;AAERA,QAAOM,OAAOjB,SAAS;CAEvB,MAAMkB,kBAAAA,GAAAA,iCAAAA,mCACJvB,QACAM,SACD;AACD,QAAO,IAAIkB,SAASD,gBAAuB;EACzCE,QAAQzB,OAAO0B,OAAOC,WAAWC;EACjCR,SAASnB;EACV,CAAC"}
1
+ {"version":3,"file":"renderRouterToStream.cjs","names":["Solid","isbot","transformReadableStreamWithRouter","makeSsrSerovalPlugin","ReadableStream","AnyRouter","JSX","renderRouterToStream","request","router","responseHeaders","children","Request","Headers","Element","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","headers","get","pipeTo","responseStream","Response","status","stores","statusCode","state"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n\n if (isbot(request.headers.get('User-Agent'))) {\n await stream\n }\n stream.pipeTo(writable)\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n )\n return new Response(responseStream as any, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n}\n"],"mappings":";;;;;;;AAQA,IAAaO,uBAAuB,OAAO,EACzCC,SACAC,QACAC,iBACAC,eAMI;CACJ,MAAM,EAAEI,UAAUC,aAAa,IAAIC,iBAAiB;CAKpD,MAAMI,kBAFHZ,OAAOU,SAAiBD,yBACxBT,OAAOU,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,UAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;GAE/D;CAEF,MAAMC,SAAS1B,aAAM2B,qBAAqBhB,UAAU;EAClDiB,OAAOnB,OAAOU,QAAQC,KAAKQ;EAC3BC,SAASR;EACV,CAAQ;AAET,MAAA,GAAA,MAAA,OAAUb,QAAQsB,QAAQC,IAAI,aAAa,CAAC,CAC1C,OAAML;AAERA,QAAOM,OAAOjB,SAAS;CAEvB,MAAMkB,kBAAAA,GAAAA,iCAAAA,mCACJxB,QACAO,SACD;AACD,QAAO,IAAIkB,SAASD,gBAAuB;EACzCE,QAAQ1B,OAAO2B,OAAOC,WAAWC;EACjCR,SAASpB;EACV,CAAC"}
@@ -1,8 +1,8 @@
1
- import { JSXElement } from 'solid-js';
2
1
  import { AnyRouter } from '@tanstack/router-core';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare const renderRouterToStream: ({ request, router, responseHeaders, children, }: {
4
4
  request: Request;
5
5
  router: AnyRouter;
6
6
  responseHeaders: Headers;
7
- children: () => JSXElement;
7
+ children: () => JSX.Element;
8
8
  }) => Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"renderRouterToString.cjs","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSXElement","renderRouterToString","router","responseHeaders","children","Headers","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","state","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSXElement } from 'solid-js'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSXElement\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,eAKI;AACJ,KAAI;EAIF,MAAMK,kBAFHP,OAAOK,SAAiBD,yBACxBJ,OAAOK,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,WAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;IAE/D;EAEF,IAAIC,OAAOjB,aAAMkB,eAAeX,UAAU;GACxCY,OAAOd,OAAOK,QAAQC,KAAKQ;GAC3BC,SAASR;GACV,CAAQ;AACTP,SAAOgB,UAAWC,mBAAmB;EAErC,MAAMC,eAAelB,OAAOgB,UAAWG,kBAAkB;AACzD,MAAID,aACFN,QAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,SAAU;AAEhE,SAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQtB,OAAOuB,OAAOC,WAAWC;GACjCC,SAASzB;GACV,CAAC;UACK0B,OAAO;AACdC,UAAQD,MAAM,2BAA2BA,MAAM;AAC/C,SAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAASzB;GACV,CAAC;WACM;AACRD,SAAOgB,WAAWa,SAAS"}
1
+ {"version":3,"file":"renderRouterToString.cjs","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSX","renderRouterToString","router","responseHeaders","children","Headers","Element","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","state","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,eAKI;AACJ,KAAI;EAIF,MAAMM,kBAFHR,OAAOM,SAAiBD,yBACxBL,OAAOM,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,WAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;IAE/D;EAEF,IAAIC,OAAOlB,aAAMmB,eAAeZ,UAAU;GACxCa,OAAOf,OAAOM,QAAQC,KAAKQ;GAC3BC,SAASR;GACV,CAAQ;AACTR,SAAOiB,UAAWC,mBAAmB;EAErC,MAAMC,eAAenB,OAAOiB,UAAWG,kBAAkB;AACzD,MAAID,aACFN,QAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,SAAU;AAEhE,SAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQvB,OAAOwB,OAAOC,WAAWC;GACjCC,SAAS1B;GACV,CAAC;UACK2B,OAAO;AACdC,UAAQD,MAAM,2BAA2BA,MAAM;AAC/C,SAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAAS1B;GACV,CAAC;WACM;AACRD,SAAOiB,WAAWa,SAAS"}
@@ -1,7 +1,7 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
- import { JSXElement } from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare const renderRouterToString: ({ router, responseHeaders, children, }: {
4
4
  router: AnyRouter;
5
5
  responseHeaders: Headers;
6
- children: () => JSXElement;
6
+ children: () => JSX.Element;
7
7
  }) => Response;
@@ -1,3 +1,3 @@
1
1
  import { RouterManagedTag } from '@tanstack/router-core';
2
- import { JSX } from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare function Asset({ tag, attrs, children, }: RouterManagedTag): JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Asset.js","names":["isServer","createEffect","useRouter","RouterManagedTag","JSX","Asset","tag","attrs","children","Element","_$createComponent","Title","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_el$3","_tmpl$3","_$mergeProps","_el$4","Script","props","Record","router","_el$5","_tmpl$4","_$insert","titleText","document","title","_el$6","dataScript","type","src","_el$7","_tmpl$5","_el$8","_el$9","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","el","createElement","key","value","Object","entries","undefined","setAttribute","String","head","appendChild","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce","textContent","parentNode","removeChild"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from 'solid-js'\n\nexport function Asset({\n tag,\n attrs,\n children,\n}: RouterManagedTag): JSX.Element | null {\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <meta {...attrs} />\n case 'link':\n return <link {...attrs} />\n case 'style':\n if (typeof children === 'string') {\n return <style {...attrs} innerHTML={children} />\n }\n return <style {...attrs} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n // Server: render <title> normally\n if (isServer ?? router.isServer) {\n return <title {...attrs}>{children as string}</title>\n }\n\n // Client: imperatively set document.title so it updates during\n // client-side navigation (JSX <title> in <head> doesn't reliably\n // update the browser's document.title).\n createEffect(\n () => children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n // Still render the <title> element in the DOM for consistency,\n // but the imperative assignment above is what actually drives the update.\n return <title {...attrs}>{children as string}</title>\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,SAAgBK,MAAM,EACpBC,KACAC,OACAC,YACuC;AACvC,SAAQF,KAAR;EACE,KAAK,QACH,QAAAI,gBAAQC,OAAK;GAAQJ;GAAiBC;GAAQ,CAAA;EAChD,KAAK,OACH,eAAA;GAAA,IAAAI,OAAAC,QAAA;AAAAC,UAAAF,MAAiBL,OAAK,MAAA;AAAA,UAAAK;MAAA;EACxB,KAAK,OACH,eAAA;GAAA,IAAAG,QAAAC,SAAA;AAAAF,UAAAC,OAAiBR,OAAK,MAAA;AAAA,UAAAQ;MAAA;EACxB,KAAK;AACH,OAAI,OAAOP,aAAa,SACtB,eAAA;IAAA,IAAAS,QAAAC,SAAA;AAAAJ,WAAAG,OAAAE,WAAkBZ,OAAK,EAAA,aAAaC,UAAQ,CAAA,EAAA,MAAA;AAAA,WAAAS;OAAA;AAE9C,iBAAA;I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WACEN,GAAGiB,gBAAgB/D,YACnB4D,UAAUH,YACVK,WAAWJ;KAEb,CAGA;AAGF1B,YAASX,SAAS0B,cAAc,SAAS;AACzCf,UAAO+B,cAAc/D;AAErB,OAAID;SACG,MAAM,CAACiD,KAAKC,UAAUC,OAAOC,QAAQpD,MAAM,CAC9C,KAAIkD,UAAUG,KAAAA,KAAaH,UAAU,MACnCjB,QAAOqB,aACLL,KACA,OAAOC,UAAU,YAAY,KAAKK,OAAOL,MAC3C,CAAC;;AAKP5B,YAASkC,KAAKC,YAAYxB,OAAO;;AAGnC,eAAa;AACX,OAAIA,QAAQgC,WACVhC,QAAOgC,WAAWC,YAAYjC,OAAO;;GAI5C;AAED,QAAO"}
1
+ {"version":3,"file":"Asset.js","names":["isServer","createEffect","useRouter","RouterManagedTag","JSX","Asset","tag","attrs","children","Element","_$createComponent","Title","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_el$3","_tmpl$3","_$mergeProps","_el$4","Script","props","Record","router","_el$5","_tmpl$4","_$insert","titleText","document","title","_el$6","dataScript","type","src","_el$7","_tmpl$5","_el$8","_el$9","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","el","createElement","key","value","Object","entries","undefined","setAttribute","String","head","appendChild","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce","textContent","parentNode","removeChild"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport function Asset({\n tag,\n attrs,\n children,\n}: RouterManagedTag): JSX.Element | null {\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <meta {...attrs} />\n case 'link':\n return <link {...attrs} />\n case 'style':\n if (typeof children === 'string') {\n return <style {...attrs} innerHTML={children} />\n }\n return <style {...attrs} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n // Server: render <title> normally\n if (isServer ?? router.isServer) {\n return <title {...attrs}>{children as string}</title>\n }\n\n // Client: imperatively set document.title so it updates during\n // client-side navigation (JSX <title> in <head> doesn't reliably\n // update the browser's document.title).\n createEffect(\n () => children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n // Still render the <title> element in the DOM for consistency,\n // but the imperative assignment above is what actually drives the update.\n return <title {...attrs}>{children as string}</title>\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,SAAgBK,MAAM,EACpBC,KACAC,OACAC,YACuC;AACvC,SAAQF,KAAR;EACE,KAAK,QACH,QAAAI,gBAAQC,OAAK;GAAQJ;GAAiBC;GAAQ,CAAA;EAChD,KAAK,OACH,eAAA;GAAA,IAAAI,OAAAC,QAAA;AAAAC,UAAAF,MAAiBL,OAAK,MAAA;AAAA,UAAAK;MAAA;EACxB,KAAK,OACH,eAAA;GAAA,IAAAG,QAAAC,SAAA;AAAAF,UAAAC,OAAiBR,OAAK,MAAA;AAAA,UAAAQ;MAAA;EACxB,KAAK;AACH,OAAI,OAAOP,aAAa,SACtB,eAAA;IAAA,IAAAS,QAAAC,SAAA;AAAAJ,WAAAG,OAAAE,WAAkBZ,OAAK,EAAA,aAAaC,UAAQ,CAAA,EAAA,MAAA;AAAA,WAAAS;OAAA;AAE9C,iBAAA;IAAA,IAAAG,QAAAF,S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B/D,YACnB4D,UAAUH,YACVK,WAAWJ;KAEb,CAGA;AAGF1B,YAASX,SAAS0B,cAAc,SAAS;AACzCf,UAAO+B,cAAc/D;AAErB,OAAID;SACG,MAAM,CAACiD,KAAKC,UAAUC,OAAOC,QAAQpD,MAAM,CAC9C,KAAIkD,UAAUG,KAAAA,KAAaH,UAAU,MACnCjB,QAAOqB,aACLL,KACA,OAAOC,UAAU,YAAY,KAAKK,OAAOL,MAC3C,CAAC;;AAKP5B,YAASkC,KAAKC,YAAYxB,OAAO;;AAGnC,eAAa;AACX,OAAIA,QAAQgC,WACVhC,QAAOgC,WAAWC,YAAYjC,OAAO;;GAI5C;AAED,QAAO"}
@@ -1,11 +1,12 @@
1
1
  import { ErrorRouteComponent } from './route.js';
2
+ import { JSX } from '@solidjs/web';
2
3
  import * as Solid from 'solid-js';
3
4
  export declare function CatchBoundary(props: {
4
5
  getResetKey: () => number | string;
5
- children: Solid.JSX.Element;
6
+ children: JSX.Element;
6
7
  errorComponent?: ErrorRouteComponent;
7
8
  onCatch?: (error: Error) => void;
8
- } & Solid.ParentProps): Solid.JSX.Element;
9
+ } & Solid.ParentProps): JSX.Element;
9
10
  export declare function ErrorComponent({ error }: {
10
11
  error: any;
11
- }): Solid.JSX.Element;
12
+ }): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;AAIA,SAAgBG,cACdC,OAMA;AACA,QAAAU,gBACGd,MAAMe,SAAO;EACZC,WAAWL,OAAOM,UAAU;AAC1Bb,SAAMM,UAAUC,MAAM;AAEtBX,SAAMkB,aAAad,MAAMC,mBAAmB;AAG1CY,WAAO;KACP;AAEF,UAAAH,gBACGb,SAAO;IAAA,IACNkB,YAAS;AAAA,YAAEf,MAAMK,kBAAkBW;;IAC5BT;IACAM;IAAK,CAAA;;EAGjB,IAAAX,WAAA;AAAA,UAEAF,MAAME;;EAAQ,CAAA;;AAKrB,SAAgBc,eAAe,EAAET,SAAyB;CACxD,MAAM,CAACU,MAAMC,WAAWtB,MAAMuB,aAAAA,QAAAA,IAAAA,aACH,aAC1B;AAED,eAAA;EAAA,IAAAI,OAAAC,QAAA,EAAAC,QAAAF,KAAAG,YAAAI,QAAAL,MAAAC,WAAAG,YAAAA;AAAAJ,QAAAI;AAAAC,QAAAE,gBAauBd,SAASe,MAAM,CAACA,EAAE;AAAAC,SAAAJ,aAEhCb,MAAM,GAAG,eAAe,aAAY;AAAAiB,SAAAX,aAAA;GAAA,IAAAY,MAAAC,WAAA,CAAA,CAIxCnB,MAAM,CAAA;AAAA,gBAANkB,KAAA,UAAA;IAAA,IAAAE,QAAAC,SAAA,EAAAC,QAAAF,MAAAX;AAAAQ,WAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM7B,MAAMkC,QAAO;AAAA,kBAAbD,MAAA,UAAA;MAAA,IAAAE,QAAAC,SAAA;AAAAT,aAAAQ,aAAuBnC,MAAMkC,QAAO;AAAA,aAAAC;SAAA,GAAW;QAAI,CAAA;AAAA,WAAAL;OAAA,GAGtD;MAAI,EAAA,KAAA;AAAA,SAAAd;KAAA;;AAGbqB,eAAA,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","JSX","CatchBoundary","props","getResetKey","children","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;AAKA,SAAgBI,cACdC,OAMA;AACA,QAAAS,gBACGd,MAAMe,SAAO;EACZC,WAAWL,OAAOM,UAAU;AAC1BZ,SAAMK,UAAUC,MAAM;AAEtBX,SAAMkB,aAAab,MAAMC,mBAAmB;AAG1CW,WAAO;KACP;AAEF,UAAAH,gBACGb,SAAO;IAAA,IACNkB,YAAS;AAAA,YAAEd,MAAMI,kBAAkBW;;IAC5BT;IACAM;IAAK,CAAA;;EAGjB,IAAAV,WAAA;AAAA,UAEAF,MAAME;;EAAQ,CAAA;;AAKrB,SAAgBa,eAAe,EAAET,SAAyB;CACxD,MAAM,CAACU,MAAMC,WAAWtB,MAAMuB,aAAAA,QAAAA,IAAAA,aACH,aAC1B;AAED,eAAA;EAAA,IAAAI,OAAAC,QAAA,EAAAC,QAAAF,KAAAG,YAAAI,QAAAL,MAAAC,WAAAG,YAAAA;AAAAJ,QAAAI;AAAAC,QAAAE,gBAauBd,SAASe,MAAM,CAACA,EAAE;AAAAC,SAAAJ,aAEhCb,MAAM,GAAG,eAAe,aAAY;AAAAiB,SAAAX,aAAA;GAAA,IAAAY,MAAAC,WAAA,CAAA,CAIxCnB,MAAM,CAAA;AAAA,gBAANkB,KAAA,UAAA;IAAA,IAAAE,QAAAC,SAAA,EAAAC,QAAAF,MAAAX;AAAAQ,WAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM7B,MAAMkC,QAAO;AAAA,kBAAbD,MAAA,UAAA;MAAA,IAAAE,QAAAC,SAAA;AAAAT,aAAAQ,aAAuBnC,MAAMkC,QAAO;AAAA,aAAAC;SAAA,GAAW;QAAI,CAAA;AAAA,WAAAL;OAAA,GAGtD;MAAI,EAAA,KAAA;AAAA,SAAAd;KAAA;;AAGbqB,eAAA,CAAA,QAAA,CAAA"}
@@ -1,13 +1,14 @@
1
+ import { JSX } from '@solidjs/web';
1
2
  import * as Solid from 'solid-js';
2
3
  export interface ClientOnlyProps {
3
4
  /**
4
5
  * The children to render when the JS is loaded.
5
6
  */
6
- children: Solid.JSX.Element;
7
+ children: JSX.Element;
7
8
  /**
8
9
  * The fallback component to render if the JS is not yet loaded.
9
10
  */
10
- fallback?: Solid.JSX.Element;
11
+ fallback?: JSX.Element;
11
12
  }
12
13
  /**
13
14
  * Render the children only after the JS has loaded client-side. Use an optional
@@ -26,7 +27,7 @@ export interface ClientOnlyProps {
26
27
  * )
27
28
  * ```
28
29
  */
29
- export declare function ClientOnly(props: ClientOnlyProps): Solid.JSX.Element;
30
+ export declare function ClientOnly(props: ClientOnlyProps): JSX.Element;
30
31
  /**
31
32
  * Return a boolean indicating if the JS has been hydrated already.
32
33
  * When doing Server-Side Rendering, the result will always be false.
@@ -1 +1 @@
1
- {"version":3,"file":"ClientOnly.js","names":["Solid","ClientOnlyProps","children","JSX","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: Solid.JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: Solid.JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(false)\n\n Solid.createEffect(\n () => true,\n () => {\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,aAAa;AAC9B,QAAAC,gBACGV,MAAMW,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEJ,UAAU;;EAAA,IAAEH,WAAQ;AAAA,UAAEE,MAAMF,YAAY;;EAAI,IAAAH,WAAA;AAAA,UAAAW,WACzDN,MAAML,SAAQ;;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AAwBvB,SAAgBO,cAAuC;CACrD,MAAM,CAACD,UAAUO,eAAef,MAAMgB,aAAa,MAAM;AAEzDhB,OAAMiB,mBACE,YACA;AACJF,cAAY,KAAK;GAEpB;AAED,QAAOP"}
1
+ {"version":3,"file":"ClientOnly.js","names":["Solid","JSX","ClientOnlyProps","children","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(false)\n\n Solid.createEffect(\n () => true,\n () => {\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,aAAa;AAC9B,QAAAC,gBACGV,MAAMW,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEJ,UAAU;;EAAA,IAAEH,WAAQ;AAAA,UAAEE,MAAMF,YAAY;;EAAI,IAAAF,WAAA;AAAA,UAAAU,WACzDN,MAAMJ,SAAQ;;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AAwBvB,SAAgBM,cAAuC;CACrD,MAAM,CAACD,UAAUO,eAAef,MAAMgB,aAAa,MAAM;AAEzDhB,OAAMiB,mBACE,YACA;AACJF,cAAY,KAAK;GAEpB;AAED,QAAOP"}
@@ -8,4 +8,4 @@ export interface HeadContentProps {
8
8
  * to ensure it's part of the reactive tree and updates correctly during client-side navigation.
9
9
  * The component uses portals internally to render content into the `<head>` element.
10
10
  */
11
- export declare function HeadContent(props: HeadContentProps): import("solid-js").JSX.Element;
11
+ export declare function HeadContent(props: HeadContentProps): import("solid-js/web").JSX.Element;
@@ -8,4 +8,4 @@ import { HeadContentProps } from './HeadContent.js';
8
8
  * Development version: filters out dev styles link after hydration and
9
9
  * includes a fallback cleanup effect for hydration mismatch cases.
10
10
  */
11
- export declare function HeadContent(props: HeadContentProps): import("solid-js").JSX.Element;
11
+ export declare function HeadContent(props: HeadContentProps): import("solid-js/web").JSX.Element;
@@ -1,6 +1,5 @@
1
- import * as Solid from 'solid-js';
2
1
  export declare const Match: (props: {
3
2
  matchId: string;
4
- }) => Solid.JSX.Element;
3
+ }) => import("solid-js/web").JSX.Element;
5
4
  export declare const MatchInner: () => any;
6
- export declare const Outlet: () => Solid.JSX.Element;
5
+ export declare const Outlet: () => import("solid-js/web").JSX.Element;
@@ -1,19 +1,20 @@
1
1
  import { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, NoInfer, RegisteredRouter, ResolveRelativePath, ResolveRoute, RouteByPath, ToSubOptionsProps } from '@tanstack/router-core';
2
+ import { JSX } from '@solidjs/web';
2
3
  import * as Solid from 'solid-js';
3
4
  declare module '@tanstack/router-core' {
4
5
  interface RouteMatchExtensions {
5
- meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>;
6
- links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>;
7
- scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>;
8
- styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>;
9
- headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>;
6
+ meta?: Array<JSX.IntrinsicElements['meta'] | undefined>;
7
+ links?: Array<JSX.IntrinsicElements['link'] | undefined>;
8
+ scripts?: Array<JSX.IntrinsicElements['script'] | undefined>;
9
+ styles?: Array<JSX.IntrinsicElements['style'] | undefined>;
10
+ headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>;
10
11
  }
11
12
  }
12
- export declare function Matches(): Solid.JSX.Element;
13
+ export declare function Matches(): JSX.Element;
13
14
  export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = ToSubOptionsProps<TRouter, TFrom, TTo> & DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> & DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> & MaskOptions<TRouter, TMaskFrom, TMaskTo> & MatchRouteOptions;
14
15
  export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = "">(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.Accessor<false | Expand<ResolveRoute<TRouter, TFrom, TTo>["types"]["allParams"]>>;
15
16
  export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
16
- children?: ((params?: RouteByPath<TRouter['routeTree'], ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => Solid.JSX.Element) | Solid.JSX.Element;
17
+ children?: ((params?: RouteByPath<TRouter['routeTree'], ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => JSX.Element) | JSX.Element;
17
18
  };
18
19
  export declare function MatchRoute<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any;
19
20
  export interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {
@@ -1 +1 @@
1
- {"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","NoInfer","RegisteredRouter","ResolveRelativePath","ResolveRoute","RouteByPath","ToSubOptionsProps","NearestMatchContext","Component","value","children","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","options","disableGlobalCatchBoundary","document","ssr","Loading","rootRoute","routesById","PendingComponent","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchContent","Show","when","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","_$memo","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n NoInfer,\n RegisteredRouter,\n ResolveRelativePath,\n ResolveRoute,\n RouteByPath,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouter['routeTree'],\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AA2BA,IAAM0B,sBAAsBlB;AAe5B,SAAgB+B,UAAU;CACxB,MAAMC,SAASlC,WAAW;CAK1B,MAAMmC,mBACJD,OAAOE,QAAQC,+BACdxC,cAAYqC,OAAOrC,aACnB,OAAOyC,aAAa,eAAeJ,OAAOK,MACvCpC,eACAT,MAAM8C;CAEZ,MAAMC,kBAAkCP,OAAOQ,WAAW9C;CAC1D,MAAM+C,mBACJF,WAAW,CAACL,QAAQQ,oBACpBV,OAAOE,QAAQS;AAIjB,QAAAG,gBAFwBd,OAAOE,QAAQW,aAAa5C,cAGlC,EAAA,IAAAoB,WAAA;AAAA,SAAAyB,gBACbb,kBAAgB;GAAA,IACfc,WAAQ;AAAA,WAAEN,mBAAgBK,gBAAIL,kBAAgB,EAAA,CAAA,GAAM;;GAAI,IAAApB,WAAA;AAAA,WAAA,CAAAyB,gBAEvD/C,cAAY,EAAA,CAAA,EAAA+C,gBACZE,cAAY,EAAA,CAAA,CAAA;;GAAA,CAAA;IAAA,CAAA;;AAMrB,SAASA,e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OAAOL,gBAAgB,CAAC,GAAG,EACvD;AACD,SAAO7B,MAAMoB,SAASpB,KAAKoB,OAAOC,QAAQ,GAAGA;IAEhD,CAAQ"}
1
+ {"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","NoInfer","RegisteredRouter","ResolveRelativePath","ResolveRoute","RouteByPath","ToSubOptionsProps","JSX","NearestMatchContext","Component","value","children","RouteMatchExtensions","meta","Array","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","options","disableGlobalCatchBoundary","document","ssr","Loading","rootRoute","routesById","PendingComponent","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchContent","Show","when","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","_$memo","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n NoInfer,\n RegisteredRouter,\n ResolveRelativePath,\n ResolveRoute,\n RouteByPath,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouter['routeTree'],\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => JSX.Element)\n | JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAM2B,sBAAsBnB;AAe5B,SAAgB+B,UAAU;CACxB,MAAMC,SAASlC,WAAW;CAK1B,MAAMmC,mBACJD,OAAOE,QAAQC,+BACdxC,cAAYqC,OAAOrC,aACnB,OAAOyC,aAAa,eAAeJ,OAAOK,MACvCpC,eACAT,MAAM8C;CAEZ,MAAMC,kBAAkCP,OAAOQ,WAAW9C;CAC1D,MAAM+C,mBACJF,WAAW,CAACL,QAAQQ,oBACpBV,OAAOE,QAAQS;AAIjB,QAAAG,gBAFwBd,OA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