react-router 0.0.0-experimental-e56aa53bc → 0.0.0-experimental-aecfb0db1
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/CHANGELOG.md +19 -0
- package/dist/development/{chunk-RMWJZNG5.mjs → chunk-RXFCVJK2.mjs} +1132 -1142
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +1 -2
- package/dist/development/dom-export.js +34 -6129
- package/dist/development/dom-export.mjs +6 -3
- package/dist/development/index.d.mts +13 -68
- package/dist/development/index.d.ts +1873 -198
- package/dist/development/index.js +1132 -1151
- package/dist/development/index.mjs +2 -19
- package/dist/development/lib/types/route-module.d.mts +1 -2
- package/dist/development/lib/types/route-module.d.ts +1 -2
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{fog-of-war-DrUCUQQ-.d.ts → lib-BJBhVBWN.d.mts} +136 -178
- package/dist/{production/route-data-BIYebJr3.d.mts → development/route-data-BmDen1H_.d.mts} +12 -12
- package/dist/development/{route-data-BIYebJr3.d.mts → route-data-fNWkI-4T.d.ts} +12 -12
- package/dist/production/{chunk-BXBFRMFA.mjs → chunk-TLRBG5AD.mjs} +1132 -1142
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +1 -2
- package/dist/production/dom-export.js +34 -6129
- package/dist/production/dom-export.mjs +6 -3
- package/dist/production/index.d.mts +13 -68
- package/dist/production/index.d.ts +1873 -198
- package/dist/production/index.js +1132 -1151
- package/dist/production/index.mjs +2 -19
- package/dist/production/lib/types/route-module.d.mts +1 -2
- package/dist/production/lib/types/route-module.d.ts +1 -2
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{fog-of-war-DrUCUQQ-.d.ts → lib-BJBhVBWN.d.mts} +136 -178
- package/dist/{development/route-data-BIYebJr3.d.ts → production/route-data-BmDen1H_.d.mts} +12 -12
- package/dist/production/{route-data-BIYebJr3.d.ts → route-data-fNWkI-4T.d.ts} +12 -12
- package/package.json +6 -35
- package/dist/development/data-CQbyyGzl.d.mts +0 -11
- package/dist/development/data-CQbyyGzl.d.ts +0 -11
- package/dist/development/fog-of-war-C5L_Yd5M.d.mts +0 -1778
- package/dist/development/rsc-export.d.mts +0 -1788
- package/dist/development/rsc-export.d.ts +0 -1788
- package/dist/development/rsc-export.js +0 -2778
- package/dist/development/rsc-export.mjs +0 -2743
- package/dist/production/data-CQbyyGzl.d.mts +0 -11
- package/dist/production/data-CQbyyGzl.d.ts +0 -11
- package/dist/production/fog-of-war-C5L_Yd5M.d.mts +0 -1778
- package/dist/production/rsc-export.d.mts +0 -1788
- package/dist/production/rsc-export.d.ts +0 -1788
- package/dist/production/rsc-export.js +0 -2778
- package/dist/production/rsc-export.mjs +0 -2743
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-aecfb0db1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
"use client";
|
|
12
11
|
import {
|
|
13
12
|
Action,
|
|
14
13
|
Await,
|
|
@@ -34,8 +33,6 @@ import {
|
|
|
34
33
|
NavigationContext,
|
|
35
34
|
Outlet,
|
|
36
35
|
PrefetchPageLinks,
|
|
37
|
-
RSCHydratedRouter,
|
|
38
|
-
RSCStaticRouter,
|
|
39
36
|
RemixErrorBoundary,
|
|
40
37
|
Route,
|
|
41
38
|
RouteContext,
|
|
@@ -50,12 +47,8 @@ import {
|
|
|
50
47
|
StaticRouter,
|
|
51
48
|
StaticRouterProvider,
|
|
52
49
|
ViewTransitionContext,
|
|
53
|
-
WithErrorBoundaryProps,
|
|
54
|
-
WithHydrateFallbackProps,
|
|
55
|
-
WithRouteComponentProps,
|
|
56
50
|
createBrowserHistory,
|
|
57
51
|
createBrowserRouter,
|
|
58
|
-
createCallServer,
|
|
59
52
|
createClientRoutes,
|
|
60
53
|
createClientRoutesWithHMRRevalidationOptOut,
|
|
61
54
|
createCookie,
|
|
@@ -80,7 +73,6 @@ import {
|
|
|
80
73
|
generatePath,
|
|
81
74
|
getHydrationData,
|
|
82
75
|
getPatchRoutesOnNavigationFunction,
|
|
83
|
-
getServerStream,
|
|
84
76
|
getTurboStreamSingleFetchDataStrategy,
|
|
85
77
|
href,
|
|
86
78
|
hydrationRouteProperties,
|
|
@@ -97,7 +89,6 @@ import {
|
|
|
97
89
|
renderMatches,
|
|
98
90
|
replace,
|
|
99
91
|
resolvePath,
|
|
100
|
-
routeRSCServerRequest,
|
|
101
92
|
setDevServerHooks,
|
|
102
93
|
shouldHydrateRouteLoader,
|
|
103
94
|
unstable_RouterContextProvider,
|
|
@@ -134,7 +125,7 @@ import {
|
|
|
134
125
|
useSearchParams,
|
|
135
126
|
useSubmit,
|
|
136
127
|
useViewTransitionState
|
|
137
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-RXFCVJK2.mjs";
|
|
138
129
|
export {
|
|
139
130
|
Await,
|
|
140
131
|
BrowserRouter,
|
|
@@ -152,8 +143,6 @@ export {
|
|
|
152
143
|
Action as NavigationType,
|
|
153
144
|
Outlet,
|
|
154
145
|
PrefetchPageLinks,
|
|
155
|
-
RSCHydratedRouter,
|
|
156
|
-
RSCStaticRouter,
|
|
157
146
|
Route,
|
|
158
147
|
Router,
|
|
159
148
|
RouterProvider,
|
|
@@ -175,9 +164,6 @@ export {
|
|
|
175
164
|
ServerMode as UNSAFE_ServerMode,
|
|
176
165
|
SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol,
|
|
177
166
|
ViewTransitionContext as UNSAFE_ViewTransitionContext,
|
|
178
|
-
WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
|
|
179
|
-
WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
|
|
180
|
-
WithRouteComponentProps as UNSAFE_WithRouteComponentProps,
|
|
181
167
|
createBrowserHistory as UNSAFE_createBrowserHistory,
|
|
182
168
|
createClientRoutes as UNSAFE_createClientRoutes,
|
|
183
169
|
createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
@@ -194,7 +180,6 @@ export {
|
|
|
194
180
|
useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery,
|
|
195
181
|
useScrollRestoration as UNSAFE_useScrollRestoration,
|
|
196
182
|
createBrowserRouter,
|
|
197
|
-
createCallServer,
|
|
198
183
|
createCookie,
|
|
199
184
|
createCookieSessionStorage,
|
|
200
185
|
createHashRouter,
|
|
@@ -212,7 +197,6 @@ export {
|
|
|
212
197
|
createStaticRouter,
|
|
213
198
|
data,
|
|
214
199
|
generatePath,
|
|
215
|
-
getServerStream,
|
|
216
200
|
href,
|
|
217
201
|
isCookie,
|
|
218
202
|
isRouteErrorResponse,
|
|
@@ -225,7 +209,6 @@ export {
|
|
|
225
209
|
renderMatches,
|
|
226
210
|
replace,
|
|
227
211
|
resolvePath,
|
|
228
|
-
routeRSCServerRequest,
|
|
229
212
|
HistoryRouter as unstable_HistoryRouter,
|
|
230
213
|
unstable_RouterContextProvider,
|
|
231
214
|
unstable_createContext,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
|
|
1
|
+
import { aE as LinkDescriptor, L as Location, aB as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, E as Equal, ac as unstable_RouterContextProvider, s as MiddlewareEnabled, t as AppLoadContext, aZ as Pretty } from '../../route-data-BmDen1H_.mjs';
|
|
3
2
|
import 'react';
|
|
4
3
|
|
|
5
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
|
|
1
|
+
import { aH as LinkDescriptor, e as Location, aF as MetaDescriptor, aV as ServerDataFrom, aW as ClientDataFrom, aX as Func, aY as unstable_MiddlewareNextFunction, $ as Equal, u as unstable_RouterContextProvider, M as MiddlewareEnabled, i as AppLoadContext, aZ as Pretty } from '../../route-data-fNWkI-4T.js';
|
|
3
2
|
import 'react';
|
|
4
3
|
|
|
5
4
|
type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
|
|
@@ -1,83 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type SerializedError = {
|
|
5
|
-
message: string;
|
|
6
|
-
stack?: string;
|
|
7
|
-
};
|
|
8
|
-
interface FrameworkContextObject {
|
|
9
|
-
manifest: AssetsManifest;
|
|
10
|
-
routeModules: RouteModules;
|
|
11
|
-
criticalCss?: CriticalCss;
|
|
12
|
-
serverHandoffString?: string;
|
|
13
|
-
future: FutureConfig;
|
|
14
|
-
ssr: boolean;
|
|
15
|
-
isSpaMode: boolean;
|
|
16
|
-
serializeError?(error: Error): SerializedError;
|
|
17
|
-
renderMeta?: {
|
|
18
|
-
didRenderScripts?: boolean;
|
|
19
|
-
streamCache?: Record<number, Promise<void> & {
|
|
20
|
-
result?: {
|
|
21
|
-
done: boolean;
|
|
22
|
-
value: string;
|
|
23
|
-
};
|
|
24
|
-
error?: unknown;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
interface EntryContext extends FrameworkContextObject {
|
|
29
|
-
staticHandlerContext: StaticHandlerContext;
|
|
30
|
-
serverHandoffStream?: ReadableStream<Uint8Array>;
|
|
31
|
-
}
|
|
32
|
-
interface FutureConfig {
|
|
33
|
-
unstable_subResourceIntegrity: boolean;
|
|
34
|
-
unstable_middleware: boolean;
|
|
35
|
-
}
|
|
36
|
-
type CriticalCss = string | {
|
|
37
|
-
rel: "stylesheet";
|
|
38
|
-
href: string;
|
|
39
|
-
};
|
|
40
|
-
interface AssetsManifest {
|
|
41
|
-
entry: {
|
|
42
|
-
imports: string[];
|
|
43
|
-
module: string;
|
|
44
|
-
};
|
|
45
|
-
routes: RouteManifest<EntryRoute>;
|
|
46
|
-
url: string;
|
|
47
|
-
version: string;
|
|
48
|
-
hmr?: {
|
|
49
|
-
timestamp?: number;
|
|
50
|
-
runtime: string;
|
|
51
|
-
};
|
|
52
|
-
sri?: Record<string, string> | true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface Route$1 {
|
|
56
|
-
index?: boolean;
|
|
57
|
-
caseSensitive?: boolean;
|
|
58
|
-
id: string;
|
|
59
|
-
parentId?: string;
|
|
60
|
-
path?: string;
|
|
61
|
-
}
|
|
62
|
-
interface EntryRoute extends Route$1 {
|
|
63
|
-
hasAction: boolean;
|
|
64
|
-
hasLoader: boolean;
|
|
65
|
-
hasClientAction: boolean;
|
|
66
|
-
hasClientLoader: boolean;
|
|
67
|
-
hasClientMiddleware: boolean;
|
|
68
|
-
hasErrorBoundary: boolean;
|
|
69
|
-
imports?: string[];
|
|
70
|
-
css?: string[];
|
|
71
|
-
module: string;
|
|
72
|
-
clientActionModule: string | undefined;
|
|
73
|
-
clientLoaderModule: string | undefined;
|
|
74
|
-
clientMiddlewareModule: string | undefined;
|
|
75
|
-
hydrateFallbackModule: string | undefined;
|
|
76
|
-
parentId?: string;
|
|
77
|
-
}
|
|
78
|
-
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
79
|
-
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
80
|
-
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
2
|
+
import { h as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, w as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, r as NonIndexRouteObject, a3 as LazyRouteFunction, n as IndexRouteObject, L as Location, A as Action, as as Navigator, au as RouteMatch, aS as RouteManifest, aT as ServerRouteModule, s as MiddlewareEnabled, ac as unstable_RouterContextProvider, t as AppLoadContext, a4 as LoaderFunctionArgs, W as ActionFunctionArgs, l as StaticHandlerContext, b as RouteModules, x as DataRouteObject, y as ClientLoaderFunction, a2 as HTMLFormMethod, a0 as FormEncType, aC as PageLinkDescriptor, aU as History, z as GetScrollRestorationKeyFunction, N as NavigateOptions, J as Fetcher, S as SerializeFrom, B as BlockerFunction } from './route-data-BmDen1H_.mjs';
|
|
81
3
|
|
|
82
4
|
/**
|
|
83
5
|
* @private
|
|
@@ -271,7 +193,7 @@ type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps;
|
|
|
271
193
|
*
|
|
272
194
|
* @category Components
|
|
273
195
|
*/
|
|
274
|
-
declare function Route(_props: RouteProps): React.ReactElement | null;
|
|
196
|
+
declare function Route$1(_props: RouteProps): React.ReactElement | null;
|
|
275
197
|
/**
|
|
276
198
|
* @category Types
|
|
277
199
|
*/
|
|
@@ -471,15 +393,6 @@ function Book() {
|
|
|
471
393
|
|
|
472
394
|
*/
|
|
473
395
|
declare function Await<Resolve>({ children, errorElement, resolve, }: AwaitProps<Resolve>): React.JSX.Element;
|
|
474
|
-
declare function WithRouteComponentProps({ children, }: {
|
|
475
|
-
children: React.ReactElement;
|
|
476
|
-
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
477
|
-
declare function WithHydrateFallbackProps({ children, }: {
|
|
478
|
-
children: React.ReactElement;
|
|
479
|
-
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
480
|
-
declare function WithErrorBoundaryProps({ children, }: {
|
|
481
|
-
children: React.ReactElement;
|
|
482
|
-
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
483
396
|
/**
|
|
484
397
|
* Creates a route config from a React "children" object, which is usually
|
|
485
398
|
* either a `<Route>` element or an array of them. Used internally by
|
|
@@ -499,6 +412,139 @@ declare let createRoutesFromElements: typeof createRoutesFromChildren;
|
|
|
499
412
|
*/
|
|
500
413
|
declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
|
|
501
414
|
|
|
415
|
+
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
416
|
+
interface ServerRoute extends Route {
|
|
417
|
+
children: ServerRoute[];
|
|
418
|
+
module: ServerRouteModule;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
type OptionalCriticalCss = CriticalCss | undefined;
|
|
422
|
+
/**
|
|
423
|
+
* The output of the compiler for the server build.
|
|
424
|
+
*/
|
|
425
|
+
interface ServerBuild {
|
|
426
|
+
entry: {
|
|
427
|
+
module: ServerEntryModule;
|
|
428
|
+
};
|
|
429
|
+
routes: ServerRouteManifest;
|
|
430
|
+
assets: AssetsManifest;
|
|
431
|
+
basename?: string;
|
|
432
|
+
publicPath: string;
|
|
433
|
+
assetsBuildDirectory: string;
|
|
434
|
+
future: FutureConfig;
|
|
435
|
+
ssr: boolean;
|
|
436
|
+
unstable_getCriticalCss?: (args: {
|
|
437
|
+
pathname: string;
|
|
438
|
+
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
439
|
+
/**
|
|
440
|
+
* @deprecated This is now done via a custom header during prerendering
|
|
441
|
+
*/
|
|
442
|
+
isSpaMode: boolean;
|
|
443
|
+
prerender: string[];
|
|
444
|
+
routeDiscovery: {
|
|
445
|
+
mode: "lazy" | "initial";
|
|
446
|
+
manifestPath: string;
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
interface HandleDocumentRequestFunction {
|
|
450
|
+
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? unstable_RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
451
|
+
}
|
|
452
|
+
interface HandleDataRequestFunction {
|
|
453
|
+
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise<Response> | Response;
|
|
454
|
+
}
|
|
455
|
+
interface HandleErrorFunction {
|
|
456
|
+
(error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* A module that serves as the entry point for a Remix app during server
|
|
460
|
+
* rendering.
|
|
461
|
+
*/
|
|
462
|
+
interface ServerEntryModule {
|
|
463
|
+
default: HandleDocumentRequestFunction;
|
|
464
|
+
handleDataRequest?: HandleDataRequestFunction;
|
|
465
|
+
handleError?: HandleErrorFunction;
|
|
466
|
+
streamTimeout?: number;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
type SerializedError = {
|
|
470
|
+
message: string;
|
|
471
|
+
stack?: string;
|
|
472
|
+
};
|
|
473
|
+
interface FrameworkContextObject {
|
|
474
|
+
manifest: AssetsManifest;
|
|
475
|
+
routeModules: RouteModules;
|
|
476
|
+
criticalCss?: CriticalCss;
|
|
477
|
+
serverHandoffString?: string;
|
|
478
|
+
future: FutureConfig;
|
|
479
|
+
ssr: boolean;
|
|
480
|
+
isSpaMode: boolean;
|
|
481
|
+
routeDiscovery: ServerBuild["routeDiscovery"];
|
|
482
|
+
serializeError?(error: Error): SerializedError;
|
|
483
|
+
renderMeta?: {
|
|
484
|
+
didRenderScripts?: boolean;
|
|
485
|
+
streamCache?: Record<number, Promise<void> & {
|
|
486
|
+
result?: {
|
|
487
|
+
done: boolean;
|
|
488
|
+
value: string;
|
|
489
|
+
};
|
|
490
|
+
error?: unknown;
|
|
491
|
+
}>;
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
interface EntryContext extends FrameworkContextObject {
|
|
495
|
+
staticHandlerContext: StaticHandlerContext;
|
|
496
|
+
serverHandoffStream?: ReadableStream<Uint8Array>;
|
|
497
|
+
}
|
|
498
|
+
interface FutureConfig {
|
|
499
|
+
unstable_subResourceIntegrity: boolean;
|
|
500
|
+
unstable_middleware: boolean;
|
|
501
|
+
}
|
|
502
|
+
type CriticalCss = string | {
|
|
503
|
+
rel: "stylesheet";
|
|
504
|
+
href: string;
|
|
505
|
+
};
|
|
506
|
+
interface AssetsManifest {
|
|
507
|
+
entry: {
|
|
508
|
+
imports: string[];
|
|
509
|
+
module: string;
|
|
510
|
+
};
|
|
511
|
+
routes: RouteManifest<EntryRoute>;
|
|
512
|
+
url: string;
|
|
513
|
+
version: string;
|
|
514
|
+
hmr?: {
|
|
515
|
+
timestamp?: number;
|
|
516
|
+
runtime: string;
|
|
517
|
+
};
|
|
518
|
+
sri?: Record<string, string> | true;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
interface Route {
|
|
522
|
+
index?: boolean;
|
|
523
|
+
caseSensitive?: boolean;
|
|
524
|
+
id: string;
|
|
525
|
+
parentId?: string;
|
|
526
|
+
path?: string;
|
|
527
|
+
}
|
|
528
|
+
interface EntryRoute extends Route {
|
|
529
|
+
hasAction: boolean;
|
|
530
|
+
hasLoader: boolean;
|
|
531
|
+
hasClientAction: boolean;
|
|
532
|
+
hasClientLoader: boolean;
|
|
533
|
+
hasClientMiddleware: boolean;
|
|
534
|
+
hasErrorBoundary: boolean;
|
|
535
|
+
imports?: string[];
|
|
536
|
+
css?: string[];
|
|
537
|
+
module: string;
|
|
538
|
+
clientActionModule: string | undefined;
|
|
539
|
+
clientLoaderModule: string | undefined;
|
|
540
|
+
clientMiddlewareModule: string | undefined;
|
|
541
|
+
hydrateFallbackModule: string | undefined;
|
|
542
|
+
parentId?: string;
|
|
543
|
+
}
|
|
544
|
+
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
545
|
+
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
546
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
547
|
+
|
|
502
548
|
type ParamKeyValuePair = [string, string];
|
|
503
549
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
504
550
|
/**
|
|
@@ -1687,92 +1733,4 @@ declare function useViewTransitionState(to: To, opts?: {
|
|
|
1687
1733
|
relative?: RelativeRoutingType;
|
|
1688
1734
|
}): boolean;
|
|
1689
1735
|
|
|
1690
|
-
type
|
|
1691
|
-
clientAction?: ClientActionFunction;
|
|
1692
|
-
clientLoader?: ClientLoaderFunction;
|
|
1693
|
-
element?: React.ReactElement | false;
|
|
1694
|
-
errorElement?: React.ReactElement;
|
|
1695
|
-
handle?: any;
|
|
1696
|
-
hasAction: boolean;
|
|
1697
|
-
hasErrorBoundary: boolean;
|
|
1698
|
-
hasLoader: boolean;
|
|
1699
|
-
hydrateFallbackElement?: React.ReactElement;
|
|
1700
|
-
id: string;
|
|
1701
|
-
index?: boolean;
|
|
1702
|
-
links?: LinksFunction;
|
|
1703
|
-
meta?: MetaFunction;
|
|
1704
|
-
parentId?: string;
|
|
1705
|
-
path?: string;
|
|
1706
|
-
shouldRevalidate?: ShouldRevalidateFunction;
|
|
1707
|
-
};
|
|
1708
|
-
type ServerRouteMatch = RenderedRoute & {
|
|
1709
|
-
params: Params;
|
|
1710
|
-
pathname: string;
|
|
1711
|
-
pathnameBase: string;
|
|
1712
|
-
};
|
|
1713
|
-
type ServerRenderPayload = {
|
|
1714
|
-
type: "render";
|
|
1715
|
-
actionData: Record<string, any> | null;
|
|
1716
|
-
basename?: string;
|
|
1717
|
-
errors: Record<string, any> | null;
|
|
1718
|
-
loaderData: Record<string, any>;
|
|
1719
|
-
location: Location;
|
|
1720
|
-
matches: ServerRouteMatch[];
|
|
1721
|
-
patches?: RenderedRoute[];
|
|
1722
|
-
nonce?: string;
|
|
1723
|
-
};
|
|
1724
|
-
type ServerManifestPayload = {
|
|
1725
|
-
type: "manifest";
|
|
1726
|
-
matches: RenderedRoute[];
|
|
1727
|
-
patches: RenderedRoute[];
|
|
1728
|
-
};
|
|
1729
|
-
type ServerActionPayload = {
|
|
1730
|
-
type: "action";
|
|
1731
|
-
actionResult: Promise<unknown>;
|
|
1732
|
-
rerender?: Promise<ServerRenderPayload | ServerRedirectPayload>;
|
|
1733
|
-
};
|
|
1734
|
-
type ServerRedirectPayload = {
|
|
1735
|
-
type: "redirect";
|
|
1736
|
-
status: number;
|
|
1737
|
-
location: string;
|
|
1738
|
-
replace: boolean;
|
|
1739
|
-
reload: boolean;
|
|
1740
|
-
};
|
|
1741
|
-
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
|
|
1742
|
-
|
|
1743
|
-
type DecodeServerResponseFunction = (body: ReadableStream<Uint8Array>) => Promise<ServerPayload>;
|
|
1744
|
-
type EncodeActionFunction = (args: unknown[]) => Promise<BodyInit>;
|
|
1745
|
-
declare global {
|
|
1746
|
-
interface Window {
|
|
1747
|
-
__router: Router$1;
|
|
1748
|
-
__routerInitialized: boolean;
|
|
1749
|
-
__routerActionID: number;
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
declare function createCallServer({ decode, encodeAction, }: {
|
|
1753
|
-
decode: DecodeServerResponseFunction;
|
|
1754
|
-
encodeAction: EncodeActionFunction;
|
|
1755
|
-
}): (id: string, args: unknown[]) => Promise<unknown>;
|
|
1756
|
-
declare function RSCHydratedRouter({ decode, payload, }: {
|
|
1757
|
-
decode: DecodeServerResponseFunction;
|
|
1758
|
-
payload: ServerPayload;
|
|
1759
|
-
}): React.JSX.Element;
|
|
1760
|
-
|
|
1761
|
-
declare global {
|
|
1762
|
-
interface Window {
|
|
1763
|
-
__FLIGHT_DATA: any[];
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
declare function getServerStream(): ReadableStream<any>;
|
|
1767
|
-
|
|
1768
|
-
declare global {
|
|
1769
|
-
interface Navigator {
|
|
1770
|
-
connection?: {
|
|
1771
|
-
saveData: boolean;
|
|
1772
|
-
};
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
1776
|
-
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean): void;
|
|
1777
|
-
|
|
1778
|
-
export { useLinkClickHandler as $, type AssetsManifest as A, type BrowserRouterProps as B, type CriticalCss as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type SubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherSubmitFunction as J, type FetcherWithComponents as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createBrowserRouter as Q, type RouterProviderProps as R, type ServerPayload as S, createHashRouter as T, BrowserRouter as U, HashRouter as V, Link as W, HistoryRouter as X, NavLink as Y, Form as Z, ScrollRestoration as _, type Route$1 as a, useSearchParams as a0, useSubmit as a1, useFormAction as a2, useFetcher as a3, useFetchers as a4, useBeforeUnload as a5, usePrompt as a6, useViewTransitionState as a7, type FetcherSubmitOptions as a8, type ParamKeyValuePair as a9, type SubmitOptions as aa, type URLSearchParamsInit as ab, type SubmitTarget as ac, createSearchParams as ad, Meta as ae, Links as af, Scripts as ag, PrefetchPageLinks as ah, type ScriptsProps as ai, type DecodeServerResponseFunction as aj, type EncodeActionFunction as ak, createCallServer as al, RSCHydratedRouter as am, getServerStream as an, WithRouteComponentProps as ao, WithHydrateFallbackProps as ap, WithErrorBoundaryProps as aq, hydrationRouteProperties as ar, mapRouteProperties as as, FrameworkContext as at, getPatchRoutesOnNavigationFunction as au, useFogOFWarDiscovery as av, createClientRoutes as aw, createClientRoutesWithHMRRevalidationOptOut as ax, shouldHydrateRouteLoader as ay, useScrollRestoration as az, type AwaitProps as b, type MemoryRouterProps as c, type RouteProps as d, type RouterProps as e, type RoutesProps as f, Await as g, MemoryRouter as h, Navigate as i, Outlet as j, Route as k, Router as l, RouterProvider as m, Routes as n, createMemoryRouter as o, createRoutesFromChildren as p, createRoutesFromElements as q, renderMatches as r, type HistoryRouterProps as s, type LinkProps as t, type NavLinkProps as u, type NavLinkRenderProps as v, type FetcherFormProps as w, type FormProps as x, type ScrollRestorationProps as y, type SetURLSearchParams as z };
|
|
1736
|
+
export { useSubmit as $, type AssetsManifest as A, type BrowserRouterProps as B, type FetcherSubmitFunction as C, type DOMRouterOpts as D, type EntryContext as E, type FutureConfig as F, type FetcherWithComponents as G, type HashRouterProps as H, type IndexRouteProps as I, createBrowserRouter as J, createHashRouter as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, BrowserRouter as Q, type RouterProviderProps as R, type ServerBuild as S, HashRouter as T, Link as U, HistoryRouter as V, NavLink as W, Form as X, ScrollRestoration as Y, useLinkClickHandler as Z, useSearchParams as _, type AwaitProps as a, useFormAction as a0, useFetcher as a1, useFetchers as a2, useBeforeUnload as a3, usePrompt as a4, useViewTransitionState as a5, type FetcherSubmitOptions as a6, type ParamKeyValuePair as a7, type SubmitOptions as a8, type URLSearchParamsInit as a9, type SubmitTarget as aa, createSearchParams as ab, Meta as ac, Links as ad, Scripts as ae, PrefetchPageLinks as af, type ScriptsProps as ag, type HandleDataRequestFunction as ah, type HandleDocumentRequestFunction as ai, type HandleErrorFunction as aj, type ServerEntryModule as ak, hydrationRouteProperties as al, mapRouteProperties as am, FrameworkContext as an, createClientRoutes as ao, createClientRoutesWithHMRRevalidationOptOut as ap, shouldHydrateRouteLoader as aq, useScrollRestoration as ar, type MemoryRouterProps as b, type RouteProps as c, type RouterProps as d, type RoutesProps as e, Await as f, MemoryRouter as g, Navigate as h, Outlet as i, Route$1 as j, Router as k, RouterProvider as l, Routes as m, createMemoryRouter as n, createRoutesFromChildren as o, createRoutesFromElements as p, type HistoryRouterProps as q, renderMatches as r, type LinkProps as s, type NavLinkProps as t, type NavLinkRenderProps as u, type FetcherFormProps as v, type FormProps as w, type ScrollRestorationProps as x, type SetURLSearchParams as y, type SubmitFunction as z };
|
|
@@ -912,11 +912,8 @@ interface Router {
|
|
|
912
912
|
* @param routeId The parent route id or a callback function accepting `patch`
|
|
913
913
|
* to perform batch patching
|
|
914
914
|
* @param children The additional children routes
|
|
915
|
-
* @param unstable_allowElementMutations Allow mutation or route elements on
|
|
916
|
-
* existing routes. Intended for RSC-usage
|
|
917
|
-
* only.
|
|
918
915
|
*/
|
|
919
|
-
patchRoutes(routeId: string | null, children: AgnosticRouteObject[]
|
|
916
|
+
patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
|
|
920
917
|
/**
|
|
921
918
|
* @private
|
|
922
919
|
* PRIVATE - DO NOT USE
|
|
@@ -925,13 +922,6 @@ interface Router {
|
|
|
925
922
|
* TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
|
|
926
923
|
*/
|
|
927
924
|
_internalSetRoutes(routes: AgnosticRouteObject[]): void;
|
|
928
|
-
/**
|
|
929
|
-
* @private
|
|
930
|
-
* PRIVATE - DO NOT USE
|
|
931
|
-
*
|
|
932
|
-
* Cause subscribers to re-render. This is used to force a re-render.
|
|
933
|
-
*/
|
|
934
|
-
_internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
|
|
935
925
|
/**
|
|
936
926
|
* @private
|
|
937
927
|
* PRIVATE - DO NOT USE
|
|
@@ -1407,6 +1397,16 @@ interface RouteContextObject {
|
|
|
1407
1397
|
}
|
|
1408
1398
|
declare const RouteContext: React.Context<RouteContextObject>;
|
|
1409
1399
|
|
|
1400
|
+
/**
|
|
1401
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
1402
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
1403
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
1404
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
1405
|
+
*/
|
|
1406
|
+
interface AppLoadContext {
|
|
1407
|
+
[key: string]: unknown;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
1410
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
1411
1411
|
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1412
1412
|
interface HtmlLinkProps {
|
|
@@ -1746,4 +1746,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1746
1746
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1747
1747
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1748
1748
|
|
|
1749
|
-
export { type
|
|
1749
|
+
export { type ErrorResponse as $, Action as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type Fetcher as J, type NavigationStates as K, type Location as L, type MetaFunction as M, type NavigateOptions as N, type RouterSubscriber as O, type ParamParseKey as P, type RouterNavigateOptions as Q, type RouterInit as R, type SerializeFrom as S, type To as T, type UIMatch as U, type RouterFetchOptions as V, type ActionFunctionArgs as W, type DataStrategyFunctionArgs as X, type DataStrategyMatch as Y, type DataStrategyResult as Z, DataWithResponseInit as _, type Router as a, type FormEncType as a0, type FormMethod as a1, type HTMLFormMethod as a2, type LazyRouteFunction as a3, type LoaderFunctionArgs as a4, type unstable_MiddlewareFunction as a5, type PathParam as a6, type RedirectFunction as a7, type unstable_RouterContext as a8, type ShouldRevalidateFunction as a9, type MetaArgs as aA, type MetaDescriptor as aB, type PageLinkDescriptor as aC, type HtmlLinkDescriptor as aD, type LinkDescriptor as aE, type Future as aF, type unstable_SerializesTo as aG, createBrowserHistory as aH, invariant as aI, createRouter as aJ, ErrorResponseImpl as aK, DataRouterContext as aL, DataRouterStateContext as aM, FetchersContext as aN, LocationContext as aO, NavigationContext as aP, RouteContext as aQ, ViewTransitionContext as aR, type RouteManifest as aS, type ServerRouteModule as aT, type History as aU, type ServerDataFrom as aV, type ClientDataFrom as aW, type Func as aX, type unstable_MiddlewareNextFunction as aY, type Pretty as aZ, type ShouldRevalidateFunctionArgs as aa, unstable_createContext as ab, unstable_RouterContextProvider as ac, createPath as ad, parsePath as ae, IDLE_NAVIGATION as af, IDLE_FETCHER as ag, IDLE_BLOCKER as ah, data as ai, generatePath as aj, isRouteErrorResponse as ak, matchPath as al, matchRoutes as am, redirect as an, redirectDocument as ao, replace as ap, resolvePath as aq, type DataRouteMatch as ar, type Navigator as as, type PatchRoutesOnNavigationFunctionArgs as at, type RouteMatch as au, type ClientActionFunction as av, type ClientActionFunctionArgs as aw, type ClientLoaderFunctionArgs as ax, type HeadersArgs as ay, type HeadersFunction as az, type RouteModules as b, type RelativeRoutingType as c, type Path as d, type PathPattern as e, type PathMatch as f, type Params as g, type RouteObject as h, type Navigation as i, type RevalidationState as j, type Blocker as k, type StaticHandlerContext as l, type StaticHandler as m, type IndexRouteObject as n, type LoaderFunction as o, type ActionFunction as p, type LinksFunction as q, type NonIndexRouteObject as r, type MiddlewareEnabled as s, type AppLoadContext as t, type unstable_InitialContext as u, type RouterState as v, type PatchRoutesOnNavigationFunction as w, type DataRouteObject as x, type ClientLoaderFunction as y, type GetScrollRestorationKeyFunction as z };
|
|
@@ -912,11 +912,8 @@ interface Router {
|
|
|
912
912
|
* @param routeId The parent route id or a callback function accepting `patch`
|
|
913
913
|
* to perform batch patching
|
|
914
914
|
* @param children The additional children routes
|
|
915
|
-
* @param unstable_allowElementMutations Allow mutation or route elements on
|
|
916
|
-
* existing routes. Intended for RSC-usage
|
|
917
|
-
* only.
|
|
918
915
|
*/
|
|
919
|
-
patchRoutes(routeId: string | null, children: AgnosticRouteObject[]
|
|
916
|
+
patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
|
|
920
917
|
/**
|
|
921
918
|
* @private
|
|
922
919
|
* PRIVATE - DO NOT USE
|
|
@@ -925,13 +922,6 @@ interface Router {
|
|
|
925
922
|
* TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
|
|
926
923
|
*/
|
|
927
924
|
_internalSetRoutes(routes: AgnosticRouteObject[]): void;
|
|
928
|
-
/**
|
|
929
|
-
* @private
|
|
930
|
-
* PRIVATE - DO NOT USE
|
|
931
|
-
*
|
|
932
|
-
* Cause subscribers to re-render. This is used to force a re-render.
|
|
933
|
-
*/
|
|
934
|
-
_internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
|
|
935
925
|
/**
|
|
936
926
|
* @private
|
|
937
927
|
* PRIVATE - DO NOT USE
|
|
@@ -1407,6 +1397,16 @@ interface RouteContextObject {
|
|
|
1407
1397
|
}
|
|
1408
1398
|
declare const RouteContext: React.Context<RouteContextObject>;
|
|
1409
1399
|
|
|
1400
|
+
/**
|
|
1401
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
1402
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
1403
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
1404
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
1405
|
+
*/
|
|
1406
|
+
interface AppLoadContext {
|
|
1407
|
+
[key: string]: unknown;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
1410
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
1411
1411
|
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1412
1412
|
interface HtmlLinkProps {
|
|
@@ -1746,4 +1746,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1746
1746
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1747
1747
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1748
1748
|
|
|
1749
|
-
export { type
|
|
1749
|
+
export { type Equal as $, Action as A, type BlockerFunction as B, type ClientLoaderFunction as C, type DataStrategyFunction as D, type FormEncType as E, type FutureConfig as F, type PageLinkDescriptor as G, type HydrationState as H, type InitialEntry as I, type History as J, type GetScrollRestorationKeyFunction as K, type LazyRouteFunction as L, type MiddlewareEnabled as M, type NonIndexRouteObject as N, type Fetcher as O, type PatchRoutesOnNavigationFunction as P, type StaticHandler as Q, type RouteObject as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type CreateStaticHandlerOptions as V, type unstable_InitialContext as W, type LoaderFunction as X, type ActionFunction as Y, type MetaFunction as Z, type LinksFunction as _, type RouterInit as a, type RouterState as a0, type GetScrollPositionFunction as a1, type NavigationStates as a2, type RouterSubscriber as a3, type RouterNavigateOptions as a4, type RouterFetchOptions as a5, type DataStrategyFunctionArgs as a6, type DataStrategyMatch as a7, type DataStrategyResult as a8, DataWithResponseInit as a9, type ClientActionFunctionArgs as aA, type ClientLoaderFunctionArgs as aB, type HeadersArgs as aC, type HeadersFunction as aD, type MetaArgs as aE, type MetaDescriptor as aF, type HtmlLinkDescriptor as aG, type LinkDescriptor as aH, type Future as aI, type unstable_SerializesTo as aJ, createBrowserHistory as aK, invariant as aL, createRouter as aM, ErrorResponseImpl as aN, DataRouterContext as aO, DataRouterStateContext as aP, FetchersContext as aQ, LocationContext as aR, NavigationContext as aS, RouteContext as aT, ViewTransitionContext as aU, type ServerDataFrom as aV, type ClientDataFrom as aW, type Func as aX, type unstable_MiddlewareNextFunction as aY, type Pretty as aZ, type ErrorResponse as aa, type FormMethod as ab, type unstable_MiddlewareFunction as ac, type PathParam as ad, type RedirectFunction as ae, type unstable_RouterContext as af, type ShouldRevalidateFunction as ag, type ShouldRevalidateFunctionArgs as ah, unstable_createContext as ai, createPath as aj, parsePath as ak, IDLE_NAVIGATION as al, IDLE_FETCHER as am, IDLE_BLOCKER as an, data as ao, generatePath as ap, isRouteErrorResponse as aq, matchPath as ar, matchRoutes as as, redirect as at, redirectDocument as au, replace as av, resolvePath as aw, type DataRouteMatch as ax, type PatchRoutesOnNavigationFunctionArgs as ay, type ClientActionFunction as az, type Router as b, type RelativeRoutingType as c, type IndexRouteObject as d, type Location as e, type Navigator as f, type RouteMatch as g, type RouteManifest as h, type AppLoadContext as i, type LoaderFunctionArgs as j, type ActionFunctionArgs as k, type StaticHandlerContext as l, type RouteModules as m, type DataRouteObject as n, type ParamParseKey as o, type Path as p, type PathPattern as q, type PathMatch as r, type NavigateOptions as s, type Params as t, unstable_RouterContextProvider as u, type Navigation as v, type RevalidationState as w, type SerializeFrom as x, type Blocker as y, type HTMLFormMethod as z };
|