@tanstack/react-router 0.0.1-beta.224 → 0.0.1-beta.225

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 (59) hide show
  1. package/build/cjs/CatchBoundary.js +3 -6
  2. package/build/cjs/CatchBoundary.js.map +1 -1
  3. package/build/cjs/Matches.js +8 -15
  4. package/build/cjs/Matches.js.map +1 -1
  5. package/build/cjs/RouterProvider.js +5 -10
  6. package/build/cjs/RouterProvider.js.map +1 -1
  7. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -3
  8. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  9. package/build/cjs/awaited.js +0 -2
  10. package/build/cjs/awaited.js.map +1 -1
  11. package/build/cjs/defer.js +0 -2
  12. package/build/cjs/defer.js.map +1 -1
  13. package/build/cjs/fileRoute.js +0 -2
  14. package/build/cjs/fileRoute.js.map +1 -1
  15. package/build/cjs/index.js +3 -16
  16. package/build/cjs/index.js.map +1 -1
  17. package/build/cjs/lazyRouteComponent.js +3 -6
  18. package/build/cjs/lazyRouteComponent.js.map +1 -1
  19. package/build/cjs/link.js +4 -7
  20. package/build/cjs/link.js.map +1 -1
  21. package/build/cjs/path.js +0 -2
  22. package/build/cjs/path.js.map +1 -1
  23. package/build/cjs/qss.js +0 -2
  24. package/build/cjs/qss.js.map +1 -1
  25. package/build/cjs/redirects.js +0 -2
  26. package/build/cjs/redirects.js.map +1 -1
  27. package/build/cjs/route.js +2 -7
  28. package/build/cjs/route.js.map +1 -1
  29. package/build/cjs/router.js +4 -11
  30. package/build/cjs/router.js.map +1 -1
  31. package/build/cjs/scroll-restoration.js +3 -6
  32. package/build/cjs/scroll-restoration.js.map +1 -1
  33. package/build/cjs/searchParams.js +0 -2
  34. package/build/cjs/searchParams.js.map +1 -1
  35. package/build/cjs/useBlocker.js +3 -6
  36. package/build/cjs/useBlocker.js.map +1 -1
  37. package/build/cjs/useNavigate.js +3 -6
  38. package/build/cjs/useNavigate.js.map +1 -1
  39. package/build/cjs/useParams.js +0 -2
  40. package/build/cjs/useParams.js.map +1 -1
  41. package/build/cjs/useSearch.js +0 -2
  42. package/build/cjs/useSearch.js.map +1 -1
  43. package/build/cjs/utils.js +9 -6
  44. package/build/cjs/utils.js.map +1 -1
  45. package/build/esm/index.js +8 -0
  46. package/build/esm/index.js.map +1 -1
  47. package/build/stats-html.html +3494 -2700
  48. package/build/stats-react.json +286 -286
  49. package/build/types/CatchBoundary.d.ts +2 -2
  50. package/build/types/Matches.d.ts +3 -3
  51. package/build/types/RouterProvider.d.ts +1 -1
  52. package/build/types/awaited.d.ts +1 -0
  53. package/build/types/fileRoute.d.ts +3 -2
  54. package/build/umd/index.development.js +11 -6
  55. package/build/umd/index.development.js.map +1 -1
  56. package/build/umd/index.production.js +2 -2
  57. package/build/umd/index.production.js.map +1 -1
  58. package/package.json +2 -2
  59. package/src/route.ts +1 -0
@@ -4,7 +4,7 @@ export declare function CatchBoundary(props: {
4
4
  children: any;
5
5
  errorComponent?: any;
6
6
  onCatch: (error: any) => void;
7
- }): JSX.Element;
7
+ }): React.JSX.Element;
8
8
  export declare class CatchBoundaryImpl extends React.Component<{
9
9
  resetKey: string;
10
10
  children: (props: {
@@ -30,4 +30,4 @@ export declare class CatchBoundaryImpl extends React.Component<{
30
30
  }
31
31
  export declare function ErrorComponent({ error }: {
32
32
  error: any;
33
- }): JSX.Element;
33
+ }): React.JSX.Element;
@@ -28,11 +28,11 @@ export interface RouteMatch<TRouteTree extends AnyRoute = AnyRoute, TRouteId ext
28
28
  cause: 'enter' | 'stay';
29
29
  }
30
30
  export type AnyRouteMatch = RouteMatch<any>;
31
- export declare function Matches(): JSX.Element;
31
+ export declare function Matches(): React.JSX.Element;
32
32
  export declare function Match({ matches }: {
33
33
  matches: RouteMatch[];
34
- }): JSX.Element;
35
- export declare function Outlet(): JSX.Element | null;
34
+ }): React.JSX.Element;
35
+ export declare function Outlet(): React.JSX.Element | null;
36
36
  export interface MatchRouteOptions {
37
37
  pending?: boolean;
38
38
  caseSensitive?: boolean;
@@ -34,7 +34,7 @@ export declare class SearchParamError extends Error {
34
34
  export declare class PathParamError extends Error {
35
35
  }
36
36
  export declare function getInitialRouterState(location: ParsedLocation): RouterState<any>;
37
- export declare function RouterProvider<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouteTree, TDehydrated>): JSX.Element;
37
+ export declare function RouterProvider<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouteTree, TDehydrated>): React.JSX.Element;
38
38
  export declare function getRouteMatch<TRouteTree extends AnyRoute>(state: RouterState<TRouteTree>, id: string): undefined | RouteMatch<TRouteTree>;
39
39
  export declare function useRouterState<TSelected = RouterState<RegisteredRouter['routeTree']>>(opts?: {
40
40
  select: (state: RouterState<RegisteredRouter['routeTree']>) => TSelected;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DeferredPromise } from './defer';
2
3
  export type AwaitOptions<T> = {
3
4
  promise: DeferredPromise<T>;
@@ -1,4 +1,5 @@
1
- import { AnyRoute, ResolveFullPath, RouteContext, AnyContext, RouteOptions, UpdatableRouteOptions, Route, AnyPathParams, RootRouteId, TrimPathLeft, RouteConstraints } from './route';
1
+ import { ParsePathParams } from './link';
2
+ import { AnyRoute, ResolveFullPath, ResolveFullSearchSchema, MergeFromFromParent, RouteContext, AnyContext, RouteOptions, UpdatableRouteOptions, Route, AnyPathParams, RootRouteId, TrimPathLeft, RouteConstraints } from './route';
2
3
  import { Assign, Expand, IsAny } from './utils';
3
4
  export interface FileRoutesByPath {
4
5
  }
@@ -12,7 +13,7 @@ export type FileRoutePath<TParentRoute extends AnyRoute, TFilePath extends strin
12
13
  export declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = TFilePath, TPath extends RouteConstraints['TPath'] = FileRoutePath<TParentRoute, TFilePath>, TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, RemoveUnderScores<TPath>>> {
13
14
  path: TFilePath;
14
15
  constructor(path: TFilePath);
15
- createRoute: <TSearchSchema extends import("./route").AnySearchSchema = {}, TFullSearchSchema extends import("./route").AnySearchSchema = Expand<Assign<import("./route").InferFullSearchSchema<TParentRoute>, TSearchSchema>>, TParams extends Record<string, any> = (TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never) extends never ? AnyPathParams : Record<TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<import("./link").Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never, string>, TAllParams extends Record<string, any> = IsAny<TParentRoute["types"]["allParams"], TParams, TParentRoute["types"]["allParams"] & TParams>, TRouteContext extends RouteContext = RouteContext, TContext extends Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}, TParentRoute["types"]["allContext"]>, TRouteContext>>, TRouterContext extends AnyContext = AnyContext, TLoaderData extends unknown = unknown, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options?: (Omit<RouteOptions<TParentRoute, string, string, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TLoaderData>, "path" | "id" | "getParentRoute"> & {
16
+ createRoute: <TSearchSchema extends import("./route").AnySearchSchema = {}, TFullSearchSchema extends import("./route").AnySearchSchema = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends Record<string, any> = ParsePathParams<TPath> extends never ? AnyPathParams : Record<ParsePathParams<TPath>, string>, TAllParams extends Record<string, any> = MergeFromFromParent<TParentRoute["types"]["allParams"], TParams>, TRouteContext extends RouteContext = RouteContext, TContext extends Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}>, TRouteContext>> = Expand<Assign<IsAny<TParentRoute["types"]["allContext"], {}>, TRouteContext>>, TRouterContext extends AnyContext = AnyContext, TLoaderData extends unknown = unknown, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options?: (Omit<RouteOptions<TParentRoute, string, string, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TRouteContext, TContext, TLoaderData>, "path" | "id" | "getParentRoute"> & {
16
17
  meta?: import("./route").RouteMeta | undefined;
17
18
  } & {
18
19
  caseSensitive?: boolean | undefined;
@@ -14,8 +14,7 @@
14
14
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouter = {}, global.React));
15
15
  })(this, (function (exports, React) { 'use strict';
16
16
 
17
- function _interopNamespace(e) {
18
- if (e && e.__esModule) return e;
17
+ function _interopNamespaceDefault(e) {
19
18
  var n = Object.create(null);
20
19
  if (e) {
21
20
  Object.keys(e).forEach(function (k) {
@@ -28,11 +27,11 @@
28
27
  }
29
28
  });
30
29
  }
31
- n["default"] = e;
30
+ n.default = e;
32
31
  return Object.freeze(n);
33
32
  }
34
33
 
35
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
34
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
36
35
 
37
36
  /**
38
37
  * @tanstack/history/src/index.ts
@@ -446,6 +445,7 @@
446
445
  // : never
447
446
  // }
448
447
  // >
448
+
449
449
  // // Sample types to merge
450
450
  // type TypeA = {
451
451
  // shared: string
@@ -456,6 +456,7 @@
456
456
  // }
457
457
  // array: string[]
458
458
  // }
459
+
459
460
  // type TypeB = {
460
461
  // shared: number
461
462
  // onlyInB: number
@@ -465,6 +466,7 @@
465
466
  // }
466
467
  // array: number[]
467
468
  // }
469
+
468
470
  // type TypeC = {
469
471
  // shared: boolean
470
472
  // onlyInC: boolean
@@ -474,9 +476,12 @@
474
476
  // }
475
477
  // array: boolean[]
476
478
  // }
479
+
477
480
  // type Test = Expand<Assign<TypeA, TypeB>>
481
+
478
482
  // // Using DeepMerge to merge TypeA and TypeB
479
483
  // type MergedType = Expand<AssignAll<[TypeA, TypeB, TypeC]>>
484
+
480
485
  //
481
486
 
482
487
  const isServer = typeof document === 'undefined';
@@ -832,6 +837,7 @@
832
837
  this.options = options || {};
833
838
  this.isRoot = !options?.getParentRoute;
834
839
  Route.__onInit(this);
840
+ this.$$typeof = Symbol.for('react.memo');
835
841
  }
836
842
  init = opts => {
837
843
  this.originalIndex = opts.originalIndex;
@@ -1130,6 +1136,7 @@
1130
1136
  // ) => () => void
1131
1137
  // hydrateData: <T>(key: any) => T | undefined
1132
1138
  // }
1139
+
1133
1140
  const routerContext = /*#__PURE__*/React__namespace.createContext(null);
1134
1141
  if (typeof document !== 'undefined') {
1135
1142
  window.__TSR_ROUTER_CONTEXT__ = routerContext;
@@ -2887,7 +2894,5 @@
2887
2894
  exports.useStableCallback = useStableCallback;
2888
2895
  exports.warning = warning;
2889
2896
 
2890
- Object.defineProperty(exports, '__esModule', { value: true });
2891
-
2892
2897
  }));
2893
2898
  //# sourceMappingURL=index.development.js.map