@tanstack/react-router 1.22.9 → 1.24.0
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.
- package/dist/cjs/fileRoute.cjs +4 -0
- package/dist/cjs/fileRoute.cjs.map +1 -1
- package/dist/cjs/fileRoute.d.cts +1 -0
- package/dist/cjs/index.cjs +16 -11
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +30 -28
- package/dist/cjs/redirects.cjs.map +1 -1
- package/dist/cjs/redirects.d.cts +1 -1
- package/dist/cjs/route.cjs +3 -0
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +1 -0
- package/dist/esm/fileRoute.d.ts +1 -0
- package/dist/esm/fileRoute.js +4 -0
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/index.d.ts +30 -28
- package/dist/esm/index.js +6 -6
- package/dist/esm/redirects.d.ts +1 -1
- package/dist/esm/redirects.js.map +1 -1
- package/dist/esm/route.d.ts +1 -0
- package/dist/esm/route.js +3 -0
- package/dist/esm/route.js.map +1 -1
- package/package.json +1 -1
- package/src/fileRoute.ts +6 -1
- package/src/index.tsx +279 -28
- package/src/redirects.ts +1 -1
- package/src/route.ts +4 -0
package/src/index.tsx
CHANGED
|
@@ -1,32 +1,283 @@
|
|
|
1
1
|
//
|
|
2
|
-
export
|
|
2
|
+
export {
|
|
3
|
+
createHistory,
|
|
4
|
+
createBrowserHistory,
|
|
5
|
+
createHashHistory,
|
|
6
|
+
createMemoryHistory,
|
|
7
|
+
type BlockerFn,
|
|
8
|
+
type HistoryLocation,
|
|
9
|
+
type RouterHistory,
|
|
10
|
+
type ParsedPath,
|
|
11
|
+
type HistoryState,
|
|
12
|
+
} from '@tanstack/history'
|
|
3
13
|
export { default as invariant } from 'tiny-invariant'
|
|
4
14
|
export { default as warning } from 'tiny-warning'
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
export { useAwaited, Await, type AwaitOptions } from './awaited'
|
|
16
|
+
export {
|
|
17
|
+
defer,
|
|
18
|
+
isDehydratedDeferred,
|
|
19
|
+
type DeferredPromiseState,
|
|
20
|
+
type DeferredPromise,
|
|
21
|
+
} from './defer'
|
|
22
|
+
export {
|
|
23
|
+
CatchBoundary,
|
|
24
|
+
CatchBoundaryImpl,
|
|
25
|
+
ErrorComponent,
|
|
26
|
+
} from './CatchBoundary'
|
|
27
|
+
export {
|
|
28
|
+
FileRoute,
|
|
29
|
+
createFileRoute,
|
|
30
|
+
FileRouteLoader,
|
|
31
|
+
LazyRoute,
|
|
32
|
+
createLazyRoute,
|
|
33
|
+
createLazyFileRoute,
|
|
34
|
+
type FileRoutesByPath,
|
|
35
|
+
type Trim,
|
|
36
|
+
type TrimLeft,
|
|
37
|
+
type TrimRight,
|
|
38
|
+
type RemoveUnderScores,
|
|
39
|
+
type ResolveFilePath,
|
|
40
|
+
type FileRoutePath,
|
|
41
|
+
type LazyRouteOptions,
|
|
42
|
+
} from './fileRoute'
|
|
9
43
|
export * from './history'
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
export { lazyRouteComponent } from './lazyRouteComponent'
|
|
45
|
+
export {
|
|
46
|
+
useLinkProps,
|
|
47
|
+
createLink,
|
|
48
|
+
Link,
|
|
49
|
+
type CleanPath,
|
|
50
|
+
type Split,
|
|
51
|
+
type ParsePathParams,
|
|
52
|
+
type Join,
|
|
53
|
+
type Last,
|
|
54
|
+
type RemoveTrailingSlashes,
|
|
55
|
+
type RemoveLeadingSlashes,
|
|
56
|
+
type SearchPaths,
|
|
57
|
+
type SearchRelativePathAutoComplete,
|
|
58
|
+
type RelativeToParentPathAutoComplete,
|
|
59
|
+
type RelativeToCurrentPathAutoComplete,
|
|
60
|
+
type AbsolutePathAutoComplete,
|
|
61
|
+
type RelativeToPathAutoComplete,
|
|
62
|
+
type NavigateOptions,
|
|
63
|
+
type ToOptions,
|
|
64
|
+
type ToMaskOptions,
|
|
65
|
+
type ToSubOptions,
|
|
66
|
+
type ResolveRoute,
|
|
67
|
+
type ParamOptions,
|
|
68
|
+
type SearchParamOptions,
|
|
69
|
+
type PathParamOptions,
|
|
70
|
+
type ToPathOption,
|
|
71
|
+
type ActiveOptions,
|
|
72
|
+
type LinkOptions,
|
|
73
|
+
type CheckPath,
|
|
74
|
+
type CheckPathError,
|
|
75
|
+
type ResolveRelativePath,
|
|
76
|
+
type UseLinkPropsOptions,
|
|
77
|
+
type ActiveLinkOptions,
|
|
78
|
+
type LinkProps,
|
|
79
|
+
type LinkComponent,
|
|
80
|
+
} from './link'
|
|
81
|
+
export { type ParsedLocation } from './location'
|
|
82
|
+
export {
|
|
83
|
+
matchContext,
|
|
84
|
+
Matches,
|
|
85
|
+
Match,
|
|
86
|
+
Outlet,
|
|
87
|
+
useMatchRoute,
|
|
88
|
+
MatchRoute,
|
|
89
|
+
useMatch,
|
|
90
|
+
useMatches,
|
|
91
|
+
useParentMatches,
|
|
92
|
+
useChildMatches,
|
|
93
|
+
useLoaderDeps,
|
|
94
|
+
useLoaderData,
|
|
95
|
+
isServerSideError,
|
|
96
|
+
defaultDeserializeError,
|
|
97
|
+
getRenderedMatches,
|
|
98
|
+
type RouteMatch,
|
|
99
|
+
type AnyRouteMatch,
|
|
100
|
+
type MatchRouteOptions,
|
|
101
|
+
type UseMatchRouteOptions,
|
|
102
|
+
type MakeMatchRouteOptions,
|
|
103
|
+
} from './Matches'
|
|
104
|
+
export {
|
|
105
|
+
joinPaths,
|
|
106
|
+
cleanPath,
|
|
107
|
+
trimPathLeft,
|
|
108
|
+
trimPathRight,
|
|
109
|
+
trimPath,
|
|
110
|
+
resolvePath,
|
|
111
|
+
parsePathname,
|
|
112
|
+
interpolatePath,
|
|
113
|
+
matchPathname,
|
|
114
|
+
removeBasepath,
|
|
115
|
+
matchByPath,
|
|
116
|
+
type Segment,
|
|
117
|
+
} from './path'
|
|
118
|
+
export { encode, decode } from './qss'
|
|
119
|
+
export {
|
|
120
|
+
redirect,
|
|
121
|
+
isRedirect,
|
|
122
|
+
type AnyRedirect,
|
|
123
|
+
type Redirect,
|
|
124
|
+
type ResolvedRedirect,
|
|
125
|
+
} from './redirects'
|
|
126
|
+
export {
|
|
127
|
+
rootRouteId,
|
|
128
|
+
RouteApi,
|
|
129
|
+
getRouteApi,
|
|
130
|
+
Route,
|
|
131
|
+
createRoute,
|
|
132
|
+
RootRoute,
|
|
133
|
+
rootRouteWithContext,
|
|
134
|
+
createRootRoute,
|
|
135
|
+
createRootRouteWithContext,
|
|
136
|
+
createRouteMask,
|
|
137
|
+
NotFoundRoute,
|
|
138
|
+
type RootRouteId,
|
|
139
|
+
type AnyPathParams,
|
|
140
|
+
type SearchSchemaInput,
|
|
141
|
+
type AnySearchSchema,
|
|
142
|
+
type AnyContext,
|
|
143
|
+
type RouteContext,
|
|
144
|
+
type PreloadableObj,
|
|
145
|
+
type RoutePathOptions,
|
|
146
|
+
type StaticDataRouteOption,
|
|
147
|
+
type RoutePathOptionsIntersection,
|
|
148
|
+
type RouteOptions,
|
|
149
|
+
type ParamsFallback,
|
|
150
|
+
type FileBaseRouteOptions,
|
|
151
|
+
type BaseRouteOptions,
|
|
152
|
+
type UpdatableRouteOptions,
|
|
153
|
+
type UpdatableStaticRouteOption,
|
|
154
|
+
type MetaDescriptor,
|
|
155
|
+
type RouteLinkEntry,
|
|
156
|
+
type ParseParamsOption,
|
|
157
|
+
type ParseParamsFn,
|
|
158
|
+
type ParseParamsObj,
|
|
159
|
+
type SearchSchemaValidator,
|
|
160
|
+
type SearchSchemaValidatorObj,
|
|
161
|
+
type SearchSchemaValidatorFn,
|
|
162
|
+
type RouteLoaderFn,
|
|
163
|
+
type LoaderFnContext,
|
|
164
|
+
type SearchFilter,
|
|
165
|
+
type ResolveId,
|
|
166
|
+
type InferFullSearchSchema,
|
|
167
|
+
type InferFullSearchSchemaInput,
|
|
168
|
+
type ResolveFullSearchSchema,
|
|
169
|
+
type ResolveFullSearchSchemaInput,
|
|
170
|
+
type AnyRoute,
|
|
171
|
+
type MergeFromFromParent,
|
|
172
|
+
type ResolveAllParams,
|
|
173
|
+
type RouteConstraints,
|
|
174
|
+
type AnyRootRoute,
|
|
175
|
+
type RootSearchSchema,
|
|
176
|
+
type ResolveFullPath,
|
|
177
|
+
type RouteMask,
|
|
178
|
+
type ErrorRouteProps,
|
|
179
|
+
type ErrorComponentProps,
|
|
180
|
+
type NotFoundRouteProps,
|
|
181
|
+
type ReactNode,
|
|
182
|
+
type SyncRouteComponent,
|
|
183
|
+
type AsyncRouteComponent,
|
|
184
|
+
type RouteComponent,
|
|
185
|
+
type ErrorRouteComponent,
|
|
186
|
+
type NotFoundRouteComponent,
|
|
187
|
+
type TrimPath,
|
|
188
|
+
type TrimPathLeft,
|
|
189
|
+
type TrimPathRight,
|
|
190
|
+
} from './route'
|
|
191
|
+
export {
|
|
192
|
+
type ParseRoute,
|
|
193
|
+
type RoutesById,
|
|
194
|
+
type RouteById,
|
|
195
|
+
type RouteIds,
|
|
196
|
+
type RoutesByPath,
|
|
197
|
+
type RouteByPath,
|
|
198
|
+
type RoutePaths,
|
|
199
|
+
type RoutePathsAutoComplete,
|
|
200
|
+
type FullSearchSchema,
|
|
201
|
+
type AllParams,
|
|
202
|
+
} from './routeInfo'
|
|
203
|
+
export {
|
|
204
|
+
componentTypes,
|
|
205
|
+
createRouter,
|
|
206
|
+
Router,
|
|
207
|
+
lazyFn,
|
|
208
|
+
SearchParamError,
|
|
209
|
+
PathParamError,
|
|
210
|
+
getInitialRouterState,
|
|
211
|
+
defaultSerializeError,
|
|
212
|
+
type Register,
|
|
213
|
+
type AnyRouter,
|
|
214
|
+
type RegisteredRouter,
|
|
215
|
+
type HydrationCtx,
|
|
216
|
+
type RouterContextOptions,
|
|
217
|
+
type RouterOptions,
|
|
218
|
+
type RouterTransformer,
|
|
219
|
+
type RouterErrorSerializer,
|
|
220
|
+
type RouterState,
|
|
221
|
+
type ListenerFn,
|
|
222
|
+
type BuildNextOptions,
|
|
223
|
+
type DehydratedRouterState,
|
|
224
|
+
type DehydratedRouteMatch,
|
|
225
|
+
type DehydratedRouter,
|
|
226
|
+
type RouterConstructorOptions,
|
|
227
|
+
type RouterEvents,
|
|
228
|
+
type RouterEvent,
|
|
229
|
+
type RouterListener,
|
|
230
|
+
} from './router'
|
|
231
|
+
export {
|
|
232
|
+
RouterProvider,
|
|
233
|
+
getRouteMatch,
|
|
234
|
+
type RouterProps,
|
|
235
|
+
type CommitLocationOptions,
|
|
236
|
+
type MatchLocation,
|
|
237
|
+
type NavigateFn,
|
|
238
|
+
type BuildLocationFn,
|
|
239
|
+
type InjectedHtmlEntry,
|
|
240
|
+
} from './RouterProvider'
|
|
241
|
+
export {
|
|
242
|
+
useScrollRestoration,
|
|
243
|
+
useElementScrollRestoration,
|
|
244
|
+
ScrollRestoration,
|
|
245
|
+
type ScrollRestorationOptions,
|
|
246
|
+
} from './scroll-restoration'
|
|
247
|
+
export {
|
|
248
|
+
defaultParseSearch,
|
|
249
|
+
defaultStringifySearch,
|
|
250
|
+
parseSearchWith,
|
|
251
|
+
stringifySearchWith,
|
|
252
|
+
type SearchSerializer,
|
|
253
|
+
type SearchParser,
|
|
254
|
+
} from './searchParams'
|
|
255
|
+
export { useBlocker, Block } from './useBlocker'
|
|
256
|
+
export { useNavigate, Navigate, type UseNavigateResult } from './useNavigate'
|
|
257
|
+
export { useParams } from './useParams'
|
|
258
|
+
export { useSearch } from './useSearch'
|
|
259
|
+
export {
|
|
260
|
+
getRouterContext, // SSR
|
|
261
|
+
} from './routerContext'
|
|
262
|
+
export { useRouteContext } from './useRouteContext'
|
|
263
|
+
export { useRouter } from './useRouter'
|
|
264
|
+
export { useRouterState } from './useRouterState'
|
|
265
|
+
export {
|
|
266
|
+
escapeJSON, // SSR
|
|
267
|
+
useLayoutEffect, // SSR
|
|
268
|
+
pick,
|
|
269
|
+
functionalUpdate,
|
|
270
|
+
replaceEqualDeep,
|
|
271
|
+
isPlainObject,
|
|
272
|
+
isPlainArray,
|
|
273
|
+
deepEqual,
|
|
274
|
+
useStableCallback,
|
|
275
|
+
shallow,
|
|
276
|
+
} from './utils'
|
|
277
|
+
export {
|
|
278
|
+
notFound,
|
|
279
|
+
isNotFound,
|
|
280
|
+
CatchNotFound,
|
|
281
|
+
DefaultGlobalNotFound,
|
|
282
|
+
type NotFoundError,
|
|
283
|
+
} from './not-found'
|
package/src/redirects.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { NavigateOptions } from './link'
|
|
|
2
2
|
import type { AnyRoute } from './route'
|
|
3
3
|
import type { RoutePaths } from './routeInfo'
|
|
4
4
|
import type { RegisteredRouter } from './router'
|
|
5
|
-
import type { PickAsRequired } from '
|
|
5
|
+
import type { PickAsRequired } from './utils'
|
|
6
6
|
|
|
7
7
|
export type AnyRedirect = Redirect<any, any, any, any, any>
|
|
8
8
|
|
package/src/route.ts
CHANGED