@tanstack/react-router 0.0.1-beta.165 → 0.0.1-beta.167

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,7 +7,7 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "06a4-173",
10
+ "uid": "0688-179",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
@@ -15,25 +15,29 @@
15
15
  "children": [
16
16
  {
17
17
  "name": "store/build/esm/index.js",
18
- "uid": "06a4-175"
18
+ "uid": "0688-181"
19
19
  },
20
20
  {
21
21
  "name": "react-store/build/esm/index.js",
22
- "uid": "06a4-177"
22
+ "uid": "0688-183"
23
23
  },
24
24
  {
25
25
  "name": "router-core/build/esm/index.js",
26
- "uid": "06a4-183"
26
+ "uid": "0688-189"
27
27
  },
28
28
  {
29
29
  "name": "react-router/src",
30
30
  "children": [
31
31
  {
32
- "uid": "06a4-185",
32
+ "uid": "0688-191",
33
33
  "name": "scroll-restoration.tsx"
34
34
  },
35
35
  {
36
- "uid": "06a4-187",
36
+ "uid": "0688-193",
37
+ "name": "deferred.tsx"
38
+ },
39
+ {
40
+ "uid": "0688-195",
37
41
  "name": "index.tsx"
38
42
  }
39
43
  ]
@@ -45,11 +49,11 @@
45
49
  "children": [
46
50
  {
47
51
  "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
48
- "uid": "06a4-179"
52
+ "uid": "0688-185"
49
53
  },
50
54
  {
51
55
  "name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
52
- "uid": "06a4-181"
56
+ "uid": "0688-187"
53
57
  }
54
58
  ]
55
59
  }
@@ -59,235 +63,269 @@
59
63
  "isRoot": true
60
64
  },
61
65
  "nodeParts": {
62
- "06a4-173": {
66
+ "0688-179": {
63
67
  "renderedLength": 429,
64
68
  "gzipLength": 238,
65
69
  "brotliLength": 0,
66
- "mainUid": "06a4-172"
70
+ "mainUid": "0688-178"
67
71
  },
68
- "06a4-175": {
72
+ "0688-181": {
69
73
  "renderedLength": 1843,
70
74
  "gzipLength": 644,
71
75
  "brotliLength": 0,
72
- "mainUid": "06a4-174"
76
+ "mainUid": "0688-180"
73
77
  },
74
- "06a4-177": {
78
+ "0688-183": {
75
79
  "renderedLength": 1006,
76
80
  "gzipLength": 479,
77
81
  "brotliLength": 0,
78
- "mainUid": "06a4-176"
82
+ "mainUid": "0688-182"
79
83
  },
80
- "06a4-179": {
84
+ "0688-185": {
81
85
  "renderedLength": 181,
82
86
  "gzipLength": 129,
83
87
  "brotliLength": 0,
84
- "mainUid": "06a4-178"
88
+ "mainUid": "0688-184"
85
89
  },
86
- "06a4-181": {
90
+ "0688-187": {
87
91
  "renderedLength": 44,
88
92
  "gzipLength": 62,
89
93
  "brotliLength": 0,
90
- "mainUid": "06a4-180"
94
+ "mainUid": "0688-186"
91
95
  },
92
- "06a4-183": {
93
- "renderedLength": 61314,
94
- "gzipLength": 14436,
96
+ "0688-189": {
97
+ "renderedLength": 62814,
98
+ "gzipLength": 14835,
95
99
  "brotliLength": 0,
96
- "mainUid": "06a4-182"
100
+ "mainUid": "0688-188"
97
101
  },
98
- "06a4-185": {
102
+ "0688-191": {
99
103
  "renderedLength": 466,
100
104
  "gzipLength": 228,
101
105
  "brotliLength": 0,
102
- "mainUid": "06a4-184"
106
+ "mainUid": "0688-190"
107
+ },
108
+ "0688-193": {
109
+ "renderedLength": 646,
110
+ "gzipLength": 299,
111
+ "brotliLength": 0,
112
+ "mainUid": "0688-192"
103
113
  },
104
- "06a4-187": {
105
- "renderedLength": 17058,
106
- "gzipLength": 3802,
114
+ "0688-195": {
115
+ "renderedLength": 17226,
116
+ "gzipLength": 3829,
107
117
  "brotliLength": 0,
108
- "mainUid": "06a4-186"
118
+ "mainUid": "0688-194"
109
119
  }
110
120
  },
111
121
  "nodeMetas": {
112
- "06a4-172": {
122
+ "0688-178": {
113
123
  "id": "\u0000rollupPluginBabelHelpers.js",
114
124
  "moduleParts": {
115
- "index.production.js": "06a4-173"
125
+ "index.production.js": "0688-179"
116
126
  },
117
127
  "imported": [],
118
128
  "importedBy": [
119
129
  {
120
- "uid": "06a4-186"
130
+ "uid": "0688-194"
121
131
  }
122
132
  ]
123
133
  },
124
- "06a4-174": {
134
+ "0688-180": {
125
135
  "id": "/packages/store/build/esm/index.js",
126
136
  "moduleParts": {
127
- "index.production.js": "06a4-175"
137
+ "index.production.js": "0688-181"
128
138
  },
129
139
  "imported": [],
130
140
  "importedBy": [
131
141
  {
132
- "uid": "06a4-176"
142
+ "uid": "0688-182"
133
143
  }
134
144
  ]
135
145
  },
136
- "06a4-176": {
146
+ "0688-182": {
137
147
  "id": "/packages/react-store/build/esm/index.js",
138
148
  "moduleParts": {
139
- "index.production.js": "06a4-177"
149
+ "index.production.js": "0688-183"
140
150
  },
141
151
  "imported": [
142
152
  {
143
- "uid": "06a4-189"
153
+ "uid": "0688-197"
144
154
  },
145
155
  {
146
- "uid": "06a4-174"
156
+ "uid": "0688-180"
147
157
  }
148
158
  ],
149
159
  "importedBy": [
150
160
  {
151
- "uid": "06a4-186"
161
+ "uid": "0688-194"
152
162
  },
153
163
  {
154
- "uid": "06a4-182"
164
+ "uid": "0688-188"
155
165
  }
156
166
  ]
157
167
  },
158
- "06a4-178": {
168
+ "0688-184": {
159
169
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
160
170
  "moduleParts": {
161
- "index.production.js": "06a4-179"
171
+ "index.production.js": "0688-185"
162
172
  },
163
173
  "imported": [],
164
174
  "importedBy": [
165
175
  {
166
- "uid": "06a4-186"
176
+ "uid": "0688-194"
167
177
  },
168
178
  {
169
- "uid": "06a4-182"
179
+ "uid": "0688-188"
170
180
  }
171
181
  ]
172
182
  },
173
- "06a4-180": {
183
+ "0688-186": {
174
184
  "id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
175
185
  "moduleParts": {
176
- "index.production.js": "06a4-181"
186
+ "index.production.js": "0688-187"
177
187
  },
178
188
  "imported": [],
179
189
  "importedBy": [
180
190
  {
181
- "uid": "06a4-186"
191
+ "uid": "0688-194"
182
192
  },
183
193
  {
184
- "uid": "06a4-182"
194
+ "uid": "0688-188"
185
195
  }
186
196
  ]
187
197
  },
188
- "06a4-182": {
198
+ "0688-188": {
189
199
  "id": "/packages/router-core/build/esm/index.js",
190
200
  "moduleParts": {
191
- "index.production.js": "06a4-183"
201
+ "index.production.js": "0688-189"
192
202
  },
193
203
  "imported": [
194
204
  {
195
- "uid": "06a4-178"
205
+ "uid": "0688-184"
196
206
  },
197
207
  {
198
- "uid": "06a4-180"
208
+ "uid": "0688-186"
199
209
  },
200
210
  {
201
- "uid": "06a4-176"
211
+ "uid": "0688-182"
202
212
  }
203
213
  ],
204
214
  "importedBy": [
205
215
  {
206
- "uid": "06a4-186"
216
+ "uid": "0688-194"
217
+ },
218
+ {
219
+ "uid": "0688-190"
207
220
  },
208
221
  {
209
- "uid": "06a4-184"
222
+ "uid": "0688-192"
210
223
  }
211
224
  ]
212
225
  },
213
- "06a4-184": {
226
+ "0688-190": {
214
227
  "id": "/packages/react-router/src/scroll-restoration.tsx",
215
228
  "moduleParts": {
216
- "index.production.js": "06a4-185"
229
+ "index.production.js": "0688-191"
217
230
  },
218
231
  "imported": [
219
232
  {
220
- "uid": "06a4-188"
233
+ "uid": "0688-196"
221
234
  },
222
235
  {
223
- "uid": "06a4-182"
236
+ "uid": "0688-188"
224
237
  },
225
238
  {
226
- "uid": "06a4-186"
239
+ "uid": "0688-194"
227
240
  }
228
241
  ],
229
242
  "importedBy": [
230
243
  {
231
- "uid": "06a4-186"
244
+ "uid": "0688-194"
232
245
  }
233
246
  ]
234
247
  },
235
- "06a4-186": {
248
+ "0688-192": {
249
+ "id": "/packages/react-router/src/deferred.tsx",
250
+ "moduleParts": {
251
+ "index.production.js": "0688-193"
252
+ },
253
+ "imported": [
254
+ {
255
+ "uid": "0688-188"
256
+ },
257
+ {
258
+ "uid": "0688-194"
259
+ }
260
+ ],
261
+ "importedBy": [
262
+ {
263
+ "uid": "0688-194"
264
+ }
265
+ ]
266
+ },
267
+ "0688-194": {
236
268
  "id": "/packages/react-router/src/index.tsx",
237
269
  "moduleParts": {
238
- "index.production.js": "06a4-187"
270
+ "index.production.js": "0688-195"
239
271
  },
240
272
  "imported": [
241
273
  {
242
- "uid": "06a4-172"
274
+ "uid": "0688-178"
275
+ },
276
+ {
277
+ "uid": "0688-196"
243
278
  },
244
279
  {
245
- "uid": "06a4-188"
280
+ "uid": "0688-182"
246
281
  },
247
282
  {
248
- "uid": "06a4-176"
283
+ "uid": "0688-184"
249
284
  },
250
285
  {
251
- "uid": "06a4-178"
286
+ "uid": "0688-186"
252
287
  },
253
288
  {
254
- "uid": "06a4-180"
289
+ "uid": "0688-188"
255
290
  },
256
291
  {
257
- "uid": "06a4-182"
292
+ "uid": "0688-190"
258
293
  },
259
294
  {
260
- "uid": "06a4-184"
295
+ "uid": "0688-192"
261
296
  }
262
297
  ],
263
298
  "importedBy": [
264
299
  {
265
- "uid": "06a4-184"
300
+ "uid": "0688-190"
301
+ },
302
+ {
303
+ "uid": "0688-192"
266
304
  }
267
305
  ],
268
306
  "isEntry": true
269
307
  },
270
- "06a4-188": {
308
+ "0688-196": {
271
309
  "id": "react",
272
310
  "moduleParts": {},
273
311
  "imported": [],
274
312
  "importedBy": [
275
313
  {
276
- "uid": "06a4-186"
314
+ "uid": "0688-194"
277
315
  },
278
316
  {
279
- "uid": "06a4-184"
317
+ "uid": "0688-190"
280
318
  }
281
319
  ],
282
320
  "isExternal": true
283
321
  },
284
- "06a4-189": {
322
+ "0688-197": {
285
323
  "id": "use-sync-external-store/shim/with-selector",
286
324
  "moduleParts": {},
287
325
  "imported": [],
288
326
  "importedBy": [
289
327
  {
290
- "uid": "06a4-176"
328
+ "uid": "0688-182"
291
329
  }
292
330
  ],
293
331
  "isExternal": true
@@ -9,7 +9,7 @@
9
9
  * @license MIT
10
10
  */
11
11
  import * as _tanstack_router_core from '@tanstack/router-core';
12
- import { ScrollRestorationOptions, RouteConstraints, AnyRoute, ResolveFullPath, ResolveId, ResolveFullSearchSchema, ParsePathParams, MergeParamsFromParent, RouteContext, AnyContext, UseLoaderResult, AnyRouteProps, RoutePaths, RegisteredRouter, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NavigateOptions, RouterOptions, Router, RouteMatch, RouteIds, RouteById, ParseRoute, RoutesById, AllParams } from '@tanstack/router-core';
12
+ import { ScrollRestorationOptions, DeferredPromise, RouteConstraints, AnyRoute, ResolveFullPath, ResolveId, ResolveFullSearchSchema, ParsePathParams, MergeParamsFromParent, RouteContext, AnyContext, UseLoaderResult, AnySearchSchema, AnyPathParams, AnyRouteProps, RoutePaths, RegisteredRouter, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NavigateOptions, RouterOptions, Router, RouteMatch, RouteIds, RouteById, ParseRoute, RoutesById, AllParams } from '@tanstack/router-core';
13
13
  export * from '@tanstack/router-core';
14
14
  import * as React from 'react';
15
15
  import { NoInfer } from '@tanstack/react-store';
@@ -18,11 +18,19 @@ export { useStore } from '@tanstack/react-store';
18
18
  declare function useScrollRestoration(options?: ScrollRestorationOptions): void;
19
19
  declare function ScrollRestoration(props: ScrollRestorationOptions): null;
20
20
 
21
+ type DeferredOptions<T> = {
22
+ promise: DeferredPromise<T>;
23
+ };
24
+ declare function useDeferred<T>({ promise }: DeferredOptions<T>): [T];
25
+ declare function Deferred<T>(props: DeferredOptions<T> & {
26
+ children: (result: T) => JSX.Element;
27
+ }): JSX.Element;
28
+
21
29
  declare module '@tanstack/router-core' {
22
- interface RegisterRouteComponent<TProps extends Record<string, any>> {
30
+ interface RegisterRouteComponent<TProps> {
23
31
  RouteComponent: RouteComponent<TProps>;
24
32
  }
25
- interface RegisterRouteErrorComponent<TProps extends Record<string, any>> {
33
+ interface RegisterRouteErrorComponent<TProps> {
26
34
  RouteErrorComponent: RouteComponent<TProps>;
27
35
  }
28
36
  interface Route<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TLoader = unknown, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends RouteConstraints['TParams'] = Record<ParsePathParams<TPath>, string>, TAllParams extends RouteConstraints['TAllParams'] = MergeParamsFromParent<TParentRoute['types']['allParams'], TParams>, TParentContext extends RouteConstraints['TParentContext'] = TParentRoute['types']['routeContext'], TAllParentContext extends RouteConstraints['TAllParentContext'] = TParentRoute['types']['context'], TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends RouteConstraints['TAllContext'] = MergeParamsFromParent<TParentRoute['types']['context'], TRouteContext>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> {
@@ -51,7 +59,47 @@ declare module '@tanstack/router-core' {
51
59
  select?: (search: TAllParams) => TSelected;
52
60
  }) => TStrict extends true ? TSelected : TSelected | undefined;
53
61
  }
62
+ interface RegisterRouteProps<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
63
+ RouteProps: RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
64
+ }
65
+ interface RegisterPendingRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
66
+ PendingRouteProps: Omit<RouteProps<unknown, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>, 'useLoader'>;
67
+ }
68
+ interface RegisterErrorRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
69
+ ErrorRouteProps: {
70
+ error: unknown;
71
+ info: {
72
+ componentStack: string;
73
+ };
74
+ } & Omit<RouteProps<unknown, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>, 'useLoader'>;
75
+ }
54
76
  }
77
+ type RouteProps<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = {
78
+ useLoader: <TStrict extends boolean = true, TSelected = TLoader>(opts?: {
79
+ strict?: TStrict;
80
+ select?: (search: TLoader) => TSelected;
81
+ }) => TStrict extends true ? UseLoaderResult<TSelected> : UseLoaderResult<TSelected> | undefined;
82
+ useMatch: <TStrict extends boolean = true, TSelected = TAllContext>(opts?: {
83
+ strict?: TStrict;
84
+ select?: (search: TAllContext) => TSelected;
85
+ }) => TStrict extends true ? TSelected : TSelected | undefined;
86
+ useContext: <TStrict extends boolean = true, TSelected = TAllContext>(opts?: {
87
+ strict?: TStrict;
88
+ select?: (search: TAllContext) => TSelected;
89
+ }) => TStrict extends true ? TSelected : TSelected | undefined;
90
+ useRouteContext: <TStrict extends boolean = true, TSelected = TRouteContext>(opts?: {
91
+ strict?: TStrict;
92
+ select?: (search: TRouteContext) => TSelected;
93
+ }) => TStrict extends true ? TSelected : TSelected | undefined;
94
+ useSearch: <TStrict extends boolean = true, TSelected = TFullSearchSchema>(opts?: {
95
+ strict?: TStrict;
96
+ select?: (search: TFullSearchSchema) => TSelected;
97
+ }) => TStrict extends true ? TSelected : TSelected | undefined;
98
+ useParams: <TStrict extends boolean = true, TSelected = TAllParams>(opts?: {
99
+ strict?: TStrict;
100
+ select?: (search: TAllParams) => TSelected;
101
+ }) => TStrict extends true ? TSelected : TSelected | undefined;
102
+ };
55
103
  type ReactNode = any;
56
104
  type SyncRouteComponent<TProps> = ((props: TProps) => ReactNode) | React.LazyExoticComponent<(props: TProps) => ReactNode>;
57
105
  type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
@@ -153,4 +201,4 @@ declare function useBlocker(message: string, condition?: boolean | any): void;
153
201
  declare function Block({ message, condition, children }: PromptProps): any;
154
202
  declare function shallow<T>(objA: T, objB: T): boolean;
155
203
 
156
- export { AnyRouteComponent, AsyncRouteComponent, Block, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouterProps, RouterProvider, ScrollRestoration, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useScrollRestoration, useSearch };
204
+ export { AnyRouteComponent, AsyncRouteComponent, Block, Deferred, DeferredOptions, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouteProps, RouterProps, RouterProvider, ScrollRestoration, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDeferred, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useScrollRestoration, useSearch };