@tanstack/react-router 0.0.1-beta.20 → 0.0.1-beta.200

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.
@@ -7,21 +7,63 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "877b-67",
11
- "name": "\u0000rollupPluginBabelHelpers.js"
10
+ "name": "node_modules/.pnpm",
11
+ "children": [
12
+ {
13
+ "name": "@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
14
+ "uid": "8228-193"
15
+ },
16
+ {
17
+ "name": "@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
18
+ "uid": "8228-195"
19
+ },
20
+ {
21
+ "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
22
+ "uid": "8228-199"
23
+ },
24
+ {
25
+ "name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
26
+ "uid": "8228-201"
27
+ }
28
+ ]
12
29
  },
13
30
  {
14
31
  "name": "packages",
15
32
  "children": [
33
+ {
34
+ "name": "history/build/esm/index.js",
35
+ "uid": "8228-197"
36
+ },
16
37
  {
17
38
  "name": "router-core/build/esm/index.js",
18
- "uid": "877b-69"
39
+ "uid": "8228-203"
19
40
  },
20
41
  {
21
- "name": "react-router/src/index.tsx",
22
- "uid": "877b-71"
42
+ "name": "react-router/src",
43
+ "children": [
44
+ {
45
+ "uid": "8228-207",
46
+ "name": "react.tsx"
47
+ },
48
+ {
49
+ "uid": "8228-209",
50
+ "name": "scroll-restoration.tsx"
51
+ },
52
+ {
53
+ "uid": "8228-211",
54
+ "name": "awaited.tsx"
55
+ },
56
+ {
57
+ "uid": "8228-213",
58
+ "name": "index.tsx"
59
+ }
60
+ ]
23
61
  }
24
62
  ]
63
+ },
64
+ {
65
+ "uid": "8228-205",
66
+ "name": "\u0000rollupPluginBabelHelpers.js"
25
67
  }
26
68
  ]
27
69
  }
@@ -29,97 +71,330 @@
29
71
  "isRoot": true
30
72
  },
31
73
  "nodeParts": {
32
- "877b-67": {
33
- "renderedLength": 798,
34
- "gzipLength": 366,
74
+ "8228-193": {
75
+ "renderedLength": 1843,
76
+ "gzipLength": 644,
35
77
  "brotliLength": 0,
36
- "mainUid": "877b-66"
78
+ "mainUid": "8228-192"
37
79
  },
38
- "877b-69": {
39
- "renderedLength": 75162,
40
- "gzipLength": 15777,
80
+ "8228-195": {
81
+ "renderedLength": 1006,
82
+ "gzipLength": 479,
41
83
  "brotliLength": 0,
42
- "mainUid": "877b-68"
84
+ "mainUid": "8228-194"
43
85
  },
44
- "877b-71": {
45
- "renderedLength": 12237,
46
- "gzipLength": 3143,
86
+ "8228-197": {
87
+ "renderedLength": 9148,
88
+ "gzipLength": 2726,
47
89
  "brotliLength": 0,
48
- "mainUid": "877b-70"
90
+ "mainUid": "8228-196"
91
+ },
92
+ "8228-199": {
93
+ "renderedLength": 181,
94
+ "gzipLength": 129,
95
+ "brotliLength": 0,
96
+ "mainUid": "8228-198"
97
+ },
98
+ "8228-201": {
99
+ "renderedLength": 44,
100
+ "gzipLength": 62,
101
+ "brotliLength": 0,
102
+ "mainUid": "8228-200"
103
+ },
104
+ "8228-203": {
105
+ "renderedLength": 62475,
106
+ "gzipLength": 14922,
107
+ "brotliLength": 0,
108
+ "mainUid": "8228-202"
109
+ },
110
+ "8228-205": {
111
+ "renderedLength": 429,
112
+ "gzipLength": 238,
113
+ "brotliLength": 0,
114
+ "mainUid": "8228-204"
115
+ },
116
+ "8228-207": {
117
+ "renderedLength": 17157,
118
+ "gzipLength": 3785,
119
+ "brotliLength": 0,
120
+ "mainUid": "8228-206"
121
+ },
122
+ "8228-209": {
123
+ "renderedLength": 466,
124
+ "gzipLength": 228,
125
+ "brotliLength": 0,
126
+ "mainUid": "8228-208"
127
+ },
128
+ "8228-211": {
129
+ "renderedLength": 641,
130
+ "gzipLength": 305,
131
+ "brotliLength": 0,
132
+ "mainUid": "8228-210"
133
+ },
134
+ "8228-213": {
135
+ "renderedLength": 0,
136
+ "gzipLength": 0,
137
+ "brotliLength": 0,
138
+ "mainUid": "8228-212"
49
139
  }
50
140
  },
51
141
  "nodeMetas": {
52
- "877b-66": {
53
- "id": "\u0000rollupPluginBabelHelpers.js",
142
+ "8228-192": {
143
+ "id": "/node_modules/.pnpm/@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
54
144
  "moduleParts": {
55
- "index.production.js": "877b-67"
145
+ "index.production.js": "8228-193"
56
146
  },
57
147
  "imported": [],
58
148
  "importedBy": [
59
149
  {
60
- "uid": "877b-70"
150
+ "uid": "8228-194"
151
+ },
152
+ {
153
+ "uid": "8228-202"
61
154
  }
62
155
  ]
63
156
  },
64
- "877b-68": {
157
+ "8228-194": {
158
+ "id": "/node_modules/.pnpm/@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
159
+ "moduleParts": {
160
+ "index.production.js": "8228-195"
161
+ },
162
+ "imported": [
163
+ {
164
+ "uid": "8228-214"
165
+ },
166
+ {
167
+ "uid": "8228-192"
168
+ }
169
+ ],
170
+ "importedBy": [
171
+ {
172
+ "uid": "8228-212"
173
+ },
174
+ {
175
+ "uid": "8228-206"
176
+ }
177
+ ]
178
+ },
179
+ "8228-196": {
180
+ "id": "/packages/history/build/esm/index.js",
181
+ "moduleParts": {
182
+ "index.production.js": "8228-197"
183
+ },
184
+ "imported": [],
185
+ "importedBy": [
186
+ {
187
+ "uid": "8228-202"
188
+ }
189
+ ]
190
+ },
191
+ "8228-198": {
192
+ "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
193
+ "moduleParts": {
194
+ "index.production.js": "8228-199"
195
+ },
196
+ "imported": [],
197
+ "importedBy": [
198
+ {
199
+ "uid": "8228-202"
200
+ },
201
+ {
202
+ "uid": "8228-206"
203
+ }
204
+ ]
205
+ },
206
+ "8228-200": {
207
+ "id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
208
+ "moduleParts": {
209
+ "index.production.js": "8228-201"
210
+ },
211
+ "imported": [],
212
+ "importedBy": [
213
+ {
214
+ "uid": "8228-202"
215
+ },
216
+ {
217
+ "uid": "8228-206"
218
+ }
219
+ ]
220
+ },
221
+ "8228-202": {
65
222
  "id": "/packages/router-core/build/esm/index.js",
66
223
  "moduleParts": {
67
- "index.production.js": "877b-69"
224
+ "index.production.js": "8228-203"
225
+ },
226
+ "imported": [
227
+ {
228
+ "uid": "8228-196"
229
+ },
230
+ {
231
+ "uid": "8228-198"
232
+ },
233
+ {
234
+ "uid": "8228-200"
235
+ },
236
+ {
237
+ "uid": "8228-192"
238
+ }
239
+ ],
240
+ "importedBy": [
241
+ {
242
+ "uid": "8228-212"
243
+ },
244
+ {
245
+ "uid": "8228-206"
246
+ },
247
+ {
248
+ "uid": "8228-208"
249
+ },
250
+ {
251
+ "uid": "8228-210"
252
+ }
253
+ ]
254
+ },
255
+ "8228-204": {
256
+ "id": "\u0000rollupPluginBabelHelpers.js",
257
+ "moduleParts": {
258
+ "index.production.js": "8228-205"
68
259
  },
69
260
  "imported": [],
70
261
  "importedBy": [
71
262
  {
72
- "uid": "877b-70"
263
+ "uid": "8228-206"
264
+ }
265
+ ]
266
+ },
267
+ "8228-206": {
268
+ "id": "/packages/react-router/src/react.tsx",
269
+ "moduleParts": {
270
+ "index.production.js": "8228-207"
271
+ },
272
+ "imported": [
273
+ {
274
+ "uid": "8228-204"
275
+ },
276
+ {
277
+ "uid": "8228-215"
278
+ },
279
+ {
280
+ "uid": "8228-194"
281
+ },
282
+ {
283
+ "uid": "8228-198"
284
+ },
285
+ {
286
+ "uid": "8228-200"
287
+ },
288
+ {
289
+ "uid": "8228-202"
290
+ }
291
+ ],
292
+ "importedBy": [
293
+ {
294
+ "uid": "8228-212"
295
+ },
296
+ {
297
+ "uid": "8228-208"
298
+ },
299
+ {
300
+ "uid": "8228-210"
301
+ }
302
+ ]
303
+ },
304
+ "8228-208": {
305
+ "id": "/packages/react-router/src/scroll-restoration.tsx",
306
+ "moduleParts": {
307
+ "index.production.js": "8228-209"
308
+ },
309
+ "imported": [
310
+ {
311
+ "uid": "8228-215"
312
+ },
313
+ {
314
+ "uid": "8228-202"
315
+ },
316
+ {
317
+ "uid": "8228-206"
318
+ }
319
+ ],
320
+ "importedBy": [
321
+ {
322
+ "uid": "8228-212"
323
+ }
324
+ ]
325
+ },
326
+ "8228-210": {
327
+ "id": "/packages/react-router/src/awaited.tsx",
328
+ "moduleParts": {
329
+ "index.production.js": "8228-211"
330
+ },
331
+ "imported": [
332
+ {
333
+ "uid": "8228-202"
334
+ },
335
+ {
336
+ "uid": "8228-206"
337
+ }
338
+ ],
339
+ "importedBy": [
340
+ {
341
+ "uid": "8228-212"
73
342
  }
74
343
  ]
75
344
  },
76
- "877b-70": {
345
+ "8228-212": {
77
346
  "id": "/packages/react-router/src/index.tsx",
78
347
  "moduleParts": {
79
- "index.production.js": "877b-71"
348
+ "index.production.js": "8228-213"
80
349
  },
81
350
  "imported": [
82
351
  {
83
- "uid": "877b-66"
352
+ "uid": "8228-194"
353
+ },
354
+ {
355
+ "uid": "8228-202"
84
356
  },
85
357
  {
86
- "uid": "877b-72"
358
+ "uid": "8228-206"
87
359
  },
88
360
  {
89
- "uid": "877b-73"
361
+ "uid": "8228-208"
90
362
  },
91
363
  {
92
- "uid": "877b-68"
364
+ "uid": "8228-210"
93
365
  }
94
366
  ],
95
367
  "importedBy": [],
96
368
  "isEntry": true
97
369
  },
98
- "877b-72": {
99
- "id": "react",
370
+ "8228-214": {
371
+ "id": "use-sync-external-store/shim/with-selector",
100
372
  "moduleParts": {},
101
373
  "imported": [],
102
374
  "importedBy": [
103
375
  {
104
- "uid": "877b-70"
376
+ "uid": "8228-194"
105
377
  }
106
378
  ],
107
379
  "isExternal": true
108
380
  },
109
- "877b-73": {
110
- "id": "use-sync-external-store/shim",
381
+ "8228-215": {
382
+ "id": "react",
111
383
  "moduleParts": {},
112
384
  "imported": [],
113
385
  "importedBy": [
114
386
  {
115
- "uid": "877b-70"
387
+ "uid": "8228-206"
388
+ },
389
+ {
390
+ "uid": "8228-208"
116
391
  }
117
392
  ],
118
393
  "isExternal": true
119
394
  }
120
395
  },
121
396
  "env": {
122
- "rollup": "2.77.2"
397
+ "rollup": "2.79.1"
123
398
  },
124
399
  "options": {
125
400
  "gzip": true,
@@ -0,0 +1,8 @@
1
+ import { DeferredPromise } from '@tanstack/router-core';
2
+ export type AwaitOptions<T> = {
3
+ promise: DeferredPromise<T>;
4
+ };
5
+ export declare function useAwaited<T>({ promise }: AwaitOptions<T>): [T];
6
+ export declare function Await<T>(props: AwaitOptions<T> & {
7
+ children: (result: T) => JSX.Element;
8
+ }): JSX.Element;
@@ -1,106 +1,5 @@
1
- /**
2
- * react-router
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- import * as React from 'react';
12
- import { AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, RouterState, RouteMatch, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, DefaultAllRouteInfo, AnyRouteInfo, RouteInfo, CheckId, ToIdOption, ValidFromPath, LinkOptions, Router, RouterOptions } from '@tanstack/router-core';
1
+ export { useStore } from '@tanstack/react-store';
13
2
  export * from '@tanstack/router-core';
14
-
15
- interface RegisterRouter {
16
- }
17
- type ResolvedRouter = RegisterRouter extends {
18
- router: Router<infer TRouteConfig, infer TAllRouteInfo>;
19
- } ? Router<TRouteConfig, TAllRouteInfo> : Router;
20
- type ResolvedAllRouteInfo = RegisterRouter extends {
21
- router: Router<infer TRouteConfig, infer TAllRouteInfo>;
22
- } ? TAllRouteInfo : AnyAllRouteInfo;
23
- type SyncRouteComponent = (props?: {}) => JSX.Element | React.ReactNode;
24
- type RouteComponent = SyncRouteComponent & {
25
- preload?: () => Promise<SyncRouteComponent>;
26
- };
27
- declare function lazy(importer: () => Promise<{
28
- default: SyncRouteComponent;
29
- }>): RouteComponent;
30
- declare module '@tanstack/router-core' {
31
- interface FrameworkGenerics {
32
- Component: RouteComponent;
33
- }
34
- interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> {
35
- useState: () => RouterState;
36
- useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(routeId: TId) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>;
37
- useMatch: <TId extends keyof TAllRouteInfo['routeInfoById'], TStrict extends true | false = true>(routeId: TId, opts?: {
38
- strict?: TStrict;
39
- }) => TStrict extends true ? RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]> : RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]> | undefined;
40
- linkProps: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.AnchorHTMLAttributes<HTMLAnchorElement>;
41
- Link: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
42
- children?: React.ReactNode | ((state: {
43
- isActive: boolean;
44
- }) => React.ReactNode);
45
- }) => JSX.Element;
46
- MatchRoute: <TTo extends string = '.'>(props: ToOptions<TAllRouteInfo, '/', TTo> & MatchRouteOptions & {
47
- children?: React.ReactNode | ((params: RouteInfoByPath<TAllRouteInfo, ResolveRelativePath<'/', NoInfer<TTo>>>['allParams']) => React.ReactNode);
48
- }) => JSX.Element;
49
- }
50
- interface Route<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> {
51
- useRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], NoInfer<TTo>>>(routeId: CheckId<TAllRouteInfo, TResolved, ToIdOption<TAllRouteInfo, TRouteInfo['id'], TTo>>, opts?: {
52
- strict?: boolean;
53
- }) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TResolved]>;
54
- linkProps: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.AnchorHTMLAttributes<HTMLAnchorElement>;
55
- Link: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
56
- children?: React.ReactNode | ((state: {
57
- isActive: boolean;
58
- }) => React.ReactNode);
59
- }) => JSX.Element;
60
- MatchRoute: <TTo extends string = '.'>(props: ToOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & MatchRouteOptions & {
61
- children?: React.ReactNode | ((params: RouteInfoByPath<TAllRouteInfo, ResolveRelativePath<TRouteInfo['fullPath'], NoInfer<TTo>>>['allParams']) => React.ReactNode);
62
- }) => JSX.Element;
63
- }
64
- }
65
- type LinkPropsOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = LinkOptions<TAllRouteInfo, TFrom, TTo> & {
66
- activeProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
67
- inactiveProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
68
- };
69
- type PromptProps = {
70
- message: string;
71
- when?: boolean | any;
72
- children?: React.ReactNode;
73
- };
74
- declare function Link<TTo extends string = '.'>(props: LinkPropsOptions<ResolvedAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
75
- children?: React.ReactNode | ((state: {
76
- isActive: boolean;
77
- }) => React.ReactNode);
78
- }): JSX.Element;
79
- declare const matchesContext: React.Context<RouteMatch<DefaultAllRouteInfo, RouteInfo<string, string, string, string, {}, {}, {}, unknown, unknown, {}, {}, {}, {}, Record<never, string>, {}>>[]>;
80
- declare const routerContext: React.Context<{
81
- router: ResolvedRouter;
82
- }>;
83
- type MatchesProviderProps = {
84
- value: RouteMatch[];
85
- children: React.ReactNode;
86
- };
87
- declare function MatchesProvider(props: MatchesProviderProps): JSX.Element;
88
- declare function createReactRouter<TRouteConfig extends AnyRouteConfig = RouteConfig>(opts: RouterOptions<TRouteConfig>): Router<TRouteConfig>;
89
- type RouterProps<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = RouterOptions<TRouteConfig> & {
90
- router: Router<TRouteConfig, TAllRouteInfo>;
91
- children?: React.ReactNode;
92
- };
93
- declare function RouterProvider<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo>({ children, router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo>): JSX.Element;
94
- declare function useRouter(): ResolvedRouter;
95
- declare function useMatches(): RouteMatch[];
96
- declare function useMatch<TId extends keyof ResolvedAllRouteInfo['routeInfoById'], TStrict extends true | false = true>(routeId: TId, opts?: {
97
- strict?: TStrict;
98
- }): TStrict extends true ? RouteMatch<ResolvedAllRouteInfo, ResolvedAllRouteInfo['routeInfoById'][TId]> : RouteMatch<ResolvedAllRouteInfo, ResolvedAllRouteInfo['routeInfoById'][TId]> | undefined;
99
- declare function Outlet(): JSX.Element | null;
100
- declare function DefaultErrorBoundary({ error }: {
101
- error: any;
102
- }): JSX.Element;
103
- declare function usePrompt(message: string, when: boolean | any): void;
104
- declare function Prompt({ message, when, children }: PromptProps): React.ReactNode;
105
-
106
- export { DefaultErrorBoundary, Link, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, RegisterRouter, ResolvedAllRouteInfo, ResolvedRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, createReactRouter, lazy, matchesContext, routerContext, useMatch, useMatches, usePrompt, useRouter };
3
+ export * from './react';
4
+ export * from './scroll-restoration';
5
+ export * from './awaited';