react-router 7.2.0 → 7.3.0-pre.1
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 +266 -0
- package/dist/development/{chunk-HA7DTUK3.mjs → chunk-3XNZT7XE.mjs} +782 -340
- package/dist/development/dom-export.d.mts +13 -3
- package/dist/development/dom-export.d.ts +13 -3
- package/dist/development/dom-export.js +306 -83
- package/dist/development/dom-export.mjs +14 -5
- package/dist/development/{fog-of-war-Cm1iXIp7.d.ts → fog-of-war-CvttGpNz.d.ts} +93 -9
- package/dist/{production/fog-of-war-Cm1iXIp7.d.ts → development/fog-of-war-Da8gpnoZ.d.mts} +93 -9
- package/dist/{production/data-CQbyyGzl.d.mts → development/future-ldDp5FKH.d.mts} +11 -1
- package/dist/development/{data-CQbyyGzl.d.mts → future-ldDp5FKH.d.ts} +11 -1
- package/dist/development/index.d.mts +16 -14
- package/dist/development/index.d.ts +16 -14
- package/dist/development/index.js +784 -340
- package/dist/development/index.mjs +6 -2
- package/dist/development/lib/types/route-module.d.mts +25 -6
- package/dist/development/lib/types/route-module.d.ts +25 -6
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/{production/route-data-BmvbmBej.d.mts → development/route-data-H2S3hwhf.d.mts} +66 -13
- package/dist/development/{route-data-BmvbmBej.d.mts → route-data-H2S3hwhf.d.ts} +66 -13
- package/dist/production/{chunk-Z4EF7MSU.mjs → chunk-ZGBK665M.mjs} +782 -340
- package/dist/production/dom-export.d.mts +13 -3
- package/dist/production/dom-export.d.ts +13 -3
- package/dist/production/dom-export.js +306 -83
- package/dist/production/dom-export.mjs +14 -5
- package/dist/production/{fog-of-war-BALYJxf_.d.mts → fog-of-war-CvttGpNz.d.ts} +93 -9
- package/dist/{development/fog-of-war-BALYJxf_.d.mts → production/fog-of-war-Da8gpnoZ.d.mts} +93 -9
- package/dist/{development/data-CQbyyGzl.d.ts → production/future-ldDp5FKH.d.mts} +11 -1
- package/dist/production/{data-CQbyyGzl.d.ts → future-ldDp5FKH.d.ts} +11 -1
- package/dist/production/index.d.mts +16 -14
- package/dist/production/index.d.ts +16 -14
- package/dist/production/index.js +784 -340
- package/dist/production/index.mjs +6 -2
- package/dist/production/lib/types/route-module.d.mts +25 -6
- package/dist/production/lib/types/route-module.d.ts +25 -6
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/{development/route-data-BmvbmBej.d.ts → production/route-data-H2S3hwhf.d.mts} +66 -13
- package/dist/production/{route-data-BmvbmBej.d.ts → route-data-H2S3hwhf.d.ts} +66 -13
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.3.0-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
matchRoutes,
|
|
26
26
|
shouldHydrateRouteLoader,
|
|
27
27
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3XNZT7XE.mjs";
|
|
29
29
|
|
|
30
30
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
31
|
import * as React from "react";
|
|
@@ -50,7 +50,9 @@ function initSsrInfo() {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function createHydratedRouter(
|
|
53
|
+
function createHydratedRouter({
|
|
54
|
+
unstable_getContext
|
|
55
|
+
}) {
|
|
54
56
|
initSsrInfo();
|
|
55
57
|
if (!ssrInfo) {
|
|
56
58
|
throw new Error(
|
|
@@ -120,12 +122,17 @@ function createHydratedRouter() {
|
|
|
120
122
|
routes,
|
|
121
123
|
history: createBrowserHistory(),
|
|
122
124
|
basename: ssrInfo.context.basename,
|
|
125
|
+
unstable_getContext,
|
|
123
126
|
hydrationData,
|
|
124
127
|
mapRouteProperties,
|
|
128
|
+
future: {
|
|
129
|
+
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
|
130
|
+
},
|
|
125
131
|
dataStrategy: getSingleFetchDataStrategy(
|
|
126
132
|
ssrInfo.manifest,
|
|
127
133
|
ssrInfo.routeModules,
|
|
128
134
|
ssrInfo.context.ssr,
|
|
135
|
+
ssrInfo.context.basename,
|
|
129
136
|
() => router2
|
|
130
137
|
),
|
|
131
138
|
patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
|
|
@@ -146,9 +153,11 @@ function createHydratedRouter() {
|
|
|
146
153
|
window.__reactRouterDataRouter = router2;
|
|
147
154
|
return router2;
|
|
148
155
|
}
|
|
149
|
-
function HydratedRouter() {
|
|
156
|
+
function HydratedRouter(props) {
|
|
150
157
|
if (!router) {
|
|
151
|
-
router = createHydratedRouter(
|
|
158
|
+
router = createHydratedRouter({
|
|
159
|
+
unstable_getContext: props.unstable_getContext
|
|
160
|
+
});
|
|
152
161
|
}
|
|
153
162
|
let [criticalCss, setCriticalCss] = React2.useState(
|
|
154
163
|
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, ar as PatchRoutesOnNavigationFunction, b as Router$1, T as To, d as RelativeRoutingType, x as NonIndexRouteObject, a2 as LazyRouteFunction, s as IndexRouteObject, e as Location, f as Action, aq as Navigator, at as RouteMatch, p as StaticHandlerContext, c as RouteManifest, a as RouteModules, ap as DataRouteObject, aR as RouteModule, a1 as HTMLFormMethod, $ as FormEncType, aC as PageLinkDescriptor, aS as History, z as GetScrollRestorationKeyFunction, N as NavigateOptions, J as Fetcher, n as SerializeFrom, B as BlockerFunction } from './route-data-H2S3hwhf.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -7,18 +7,57 @@ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as Initia
|
|
|
7
7
|
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
|
|
8
8
|
hasErrorBoundary: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
interface MemoryRouterOpts {
|
|
11
|
+
/**
|
|
12
|
+
* Basename path for the application.
|
|
13
|
+
*/
|
|
14
14
|
basename?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Function to provide the initial context values for all client side navigations/fetches
|
|
17
|
+
*/
|
|
18
|
+
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
19
|
+
/**
|
|
20
|
+
* Future flags to enable for the router.
|
|
21
|
+
*/
|
|
15
22
|
future?: Partial<FutureConfig$1>;
|
|
23
|
+
/**
|
|
24
|
+
* Hydration data to initialize the router with if you have already performed
|
|
25
|
+
* data loading on the server.
|
|
26
|
+
*/
|
|
16
27
|
hydrationData?: HydrationState;
|
|
28
|
+
/**
|
|
29
|
+
* Initial entires in the in-memory history stack
|
|
30
|
+
*/
|
|
17
31
|
initialEntries?: InitialEntry[];
|
|
32
|
+
/**
|
|
33
|
+
* Index of `initialEntries` the application should initialize to
|
|
34
|
+
*/
|
|
18
35
|
initialIndex?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Override the default data strategy of loading in parallel.
|
|
38
|
+
* Only intended for advanced usage.
|
|
39
|
+
*/
|
|
19
40
|
dataStrategy?: DataStrategyFunction;
|
|
41
|
+
/**
|
|
42
|
+
* Lazily define portions of the route tree on navigations.
|
|
43
|
+
*/
|
|
20
44
|
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
|
|
21
|
-
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a new data router that manages the application path using an in-memory
|
|
48
|
+
* history stack. Useful for non-browser environments without a DOM API.
|
|
49
|
+
*
|
|
50
|
+
* @category Data Routers
|
|
51
|
+
*/
|
|
52
|
+
declare function createMemoryRouter(
|
|
53
|
+
/**
|
|
54
|
+
* Application routes
|
|
55
|
+
*/
|
|
56
|
+
routes: RouteObject[],
|
|
57
|
+
/**
|
|
58
|
+
* Router options
|
|
59
|
+
*/
|
|
60
|
+
opts?: MemoryRouterOpts): Router$1;
|
|
22
61
|
interface RouterProviderProps {
|
|
23
62
|
router: Router$1;
|
|
24
63
|
flushSync?: (fn: () => unknown) => undefined;
|
|
@@ -379,7 +418,7 @@ type SerializedError = {
|
|
|
379
418
|
interface FrameworkContextObject {
|
|
380
419
|
manifest: AssetsManifest;
|
|
381
420
|
routeModules: RouteModules;
|
|
382
|
-
criticalCss?:
|
|
421
|
+
criticalCss?: CriticalCss;
|
|
383
422
|
serverHandoffString?: string;
|
|
384
423
|
future: FutureConfig;
|
|
385
424
|
ssr: boolean;
|
|
@@ -401,7 +440,12 @@ interface EntryContext extends FrameworkContextObject {
|
|
|
401
440
|
serverHandoffStream?: ReadableStream<Uint8Array>;
|
|
402
441
|
}
|
|
403
442
|
interface FutureConfig {
|
|
443
|
+
unstable_middleware: boolean;
|
|
404
444
|
}
|
|
445
|
+
type CriticalCss = string | {
|
|
446
|
+
rel: "stylesheet";
|
|
447
|
+
href: string;
|
|
448
|
+
};
|
|
405
449
|
interface AssetsManifest {
|
|
406
450
|
entry: {
|
|
407
451
|
imports: string[];
|
|
@@ -657,19 +701,59 @@ declare function Scripts(props: ScriptsProps): React.JSX.Element | null;
|
|
|
657
701
|
declare global {
|
|
658
702
|
const REACT_ROUTER_VERSION: string;
|
|
659
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* @category Routers
|
|
706
|
+
*/
|
|
660
707
|
interface DOMRouterOpts {
|
|
708
|
+
/**
|
|
709
|
+
* Basename path for the application.
|
|
710
|
+
*/
|
|
661
711
|
basename?: string;
|
|
712
|
+
/**
|
|
713
|
+
* Function to provide the initial context values for all client side navigations/fetches
|
|
714
|
+
*/
|
|
715
|
+
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
716
|
+
/**
|
|
717
|
+
* Future flags to enable for the router.
|
|
718
|
+
*/
|
|
662
719
|
future?: Partial<FutureConfig$1>;
|
|
720
|
+
/**
|
|
721
|
+
* Hydration data to initialize the router with if you have already performed
|
|
722
|
+
* data loading on the server.
|
|
723
|
+
*/
|
|
663
724
|
hydrationData?: HydrationState;
|
|
725
|
+
/**
|
|
726
|
+
* Override the default data strategy of loading in parallel.
|
|
727
|
+
* Only intended for advanced usage.
|
|
728
|
+
*/
|
|
664
729
|
dataStrategy?: DataStrategyFunction;
|
|
730
|
+
/**
|
|
731
|
+
* Lazily define portions of the route tree on navigations.
|
|
732
|
+
*/
|
|
665
733
|
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
|
|
734
|
+
/**
|
|
735
|
+
* Window object override - defaults to the global `window` instance.
|
|
736
|
+
*/
|
|
666
737
|
window?: Window;
|
|
667
738
|
}
|
|
668
739
|
/**
|
|
740
|
+
* Create a new data router that manages the application path via `history.pushState`
|
|
741
|
+
* and `history.replaceState`.
|
|
742
|
+
*
|
|
669
743
|
* @category Data Routers
|
|
670
744
|
*/
|
|
671
|
-
declare function createBrowserRouter(
|
|
745
|
+
declare function createBrowserRouter(
|
|
746
|
+
/**
|
|
747
|
+
* Application routes
|
|
748
|
+
*/
|
|
749
|
+
routes: RouteObject[],
|
|
672
750
|
/**
|
|
751
|
+
* Router options
|
|
752
|
+
*/
|
|
753
|
+
opts?: DOMRouterOpts): Router$1;
|
|
754
|
+
/**
|
|
755
|
+
* Create a new data router that manages the application path via the URL hash
|
|
756
|
+
*
|
|
673
757
|
* @category Data Routers
|
|
674
758
|
*/
|
|
675
759
|
declare function createHashRouter(routes: RouteObject[], opts?: DOMRouterOpts): Router$1;
|
|
@@ -1599,4 +1683,4 @@ declare global {
|
|
|
1599
1683
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
1600
1684
|
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean): void;
|
|
1601
1685
|
|
|
1602
|
-
export {
|
|
1686
|
+
export { useSearchParams 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 FetcherSubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherWithComponents as J, createBrowserRouter as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createHashRouter as Q, type RouterProviderProps as R, type ScrollRestorationProps as S, BrowserRouter as T, HashRouter as U, Link as V, HistoryRouter as W, NavLink as X, Form as Y, ScrollRestoration as Z, useLinkClickHandler as _, type Route as a, useSubmit as a0, useFormAction as a1, useFetcher as a2, useFetchers as a3, useBeforeUnload as a4, usePrompt as a5, useViewTransitionState as a6, type FetcherSubmitOptions as a7, type ParamKeyValuePair as a8, type SubmitOptions as a9, type URLSearchParamsInit as aa, type SubmitTarget as ab, createSearchParams as ac, Meta as ad, Links as ae, Scripts as af, PrefetchPageLinks as ag, type ScriptsProps as ah, mapRouteProperties as ai, FrameworkContext as aj, getPatchRoutesOnNavigationFunction as ak, useFogOFWarDiscovery as al, createClientRoutes as am, createClientRoutesWithHMRRevalidationOptOut as an, shouldHydrateRouteLoader as ao, useScrollRestoration as ap, 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$1 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 SetURLSearchParams as y, type SubmitFunction as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { k as RouteObject, R as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, ar as PatchRoutesOnNavigationFunction, b as Router$1, T as To, d as RelativeRoutingType, x as NonIndexRouteObject, a2 as LazyRouteFunction, s as IndexRouteObject, e as Location, f as Action, aq as Navigator, at as RouteMatch, p as StaticHandlerContext, c as RouteManifest, a as RouteModules, ap as DataRouteObject, aR as RouteModule, a1 as HTMLFormMethod, $ as FormEncType, aC as PageLinkDescriptor, aS as History, z as GetScrollRestorationKeyFunction, N as NavigateOptions, J as Fetcher, n as SerializeFrom, B as BlockerFunction } from './route-data-H2S3hwhf.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @private
|
|
@@ -7,18 +7,57 @@ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as Initia
|
|
|
7
7
|
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {
|
|
8
8
|
hasErrorBoundary: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
interface MemoryRouterOpts {
|
|
11
|
+
/**
|
|
12
|
+
* Basename path for the application.
|
|
13
|
+
*/
|
|
14
14
|
basename?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Function to provide the initial context values for all client side navigations/fetches
|
|
17
|
+
*/
|
|
18
|
+
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
19
|
+
/**
|
|
20
|
+
* Future flags to enable for the router.
|
|
21
|
+
*/
|
|
15
22
|
future?: Partial<FutureConfig$1>;
|
|
23
|
+
/**
|
|
24
|
+
* Hydration data to initialize the router with if you have already performed
|
|
25
|
+
* data loading on the server.
|
|
26
|
+
*/
|
|
16
27
|
hydrationData?: HydrationState;
|
|
28
|
+
/**
|
|
29
|
+
* Initial entires in the in-memory history stack
|
|
30
|
+
*/
|
|
17
31
|
initialEntries?: InitialEntry[];
|
|
32
|
+
/**
|
|
33
|
+
* Index of `initialEntries` the application should initialize to
|
|
34
|
+
*/
|
|
18
35
|
initialIndex?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Override the default data strategy of loading in parallel.
|
|
38
|
+
* Only intended for advanced usage.
|
|
39
|
+
*/
|
|
19
40
|
dataStrategy?: DataStrategyFunction;
|
|
41
|
+
/**
|
|
42
|
+
* Lazily define portions of the route tree on navigations.
|
|
43
|
+
*/
|
|
20
44
|
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
|
|
21
|
-
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a new data router that manages the application path using an in-memory
|
|
48
|
+
* history stack. Useful for non-browser environments without a DOM API.
|
|
49
|
+
*
|
|
50
|
+
* @category Data Routers
|
|
51
|
+
*/
|
|
52
|
+
declare function createMemoryRouter(
|
|
53
|
+
/**
|
|
54
|
+
* Application routes
|
|
55
|
+
*/
|
|
56
|
+
routes: RouteObject[],
|
|
57
|
+
/**
|
|
58
|
+
* Router options
|
|
59
|
+
*/
|
|
60
|
+
opts?: MemoryRouterOpts): Router$1;
|
|
22
61
|
interface RouterProviderProps {
|
|
23
62
|
router: Router$1;
|
|
24
63
|
flushSync?: (fn: () => unknown) => undefined;
|
|
@@ -379,7 +418,7 @@ type SerializedError = {
|
|
|
379
418
|
interface FrameworkContextObject {
|
|
380
419
|
manifest: AssetsManifest;
|
|
381
420
|
routeModules: RouteModules;
|
|
382
|
-
criticalCss?:
|
|
421
|
+
criticalCss?: CriticalCss;
|
|
383
422
|
serverHandoffString?: string;
|
|
384
423
|
future: FutureConfig;
|
|
385
424
|
ssr: boolean;
|
|
@@ -401,7 +440,12 @@ interface EntryContext extends FrameworkContextObject {
|
|
|
401
440
|
serverHandoffStream?: ReadableStream<Uint8Array>;
|
|
402
441
|
}
|
|
403
442
|
interface FutureConfig {
|
|
443
|
+
unstable_middleware: boolean;
|
|
404
444
|
}
|
|
445
|
+
type CriticalCss = string | {
|
|
446
|
+
rel: "stylesheet";
|
|
447
|
+
href: string;
|
|
448
|
+
};
|
|
405
449
|
interface AssetsManifest {
|
|
406
450
|
entry: {
|
|
407
451
|
imports: string[];
|
|
@@ -657,19 +701,59 @@ declare function Scripts(props: ScriptsProps): React.JSX.Element | null;
|
|
|
657
701
|
declare global {
|
|
658
702
|
const REACT_ROUTER_VERSION: string;
|
|
659
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* @category Routers
|
|
706
|
+
*/
|
|
660
707
|
interface DOMRouterOpts {
|
|
708
|
+
/**
|
|
709
|
+
* Basename path for the application.
|
|
710
|
+
*/
|
|
661
711
|
basename?: string;
|
|
712
|
+
/**
|
|
713
|
+
* Function to provide the initial context values for all client side navigations/fetches
|
|
714
|
+
*/
|
|
715
|
+
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
716
|
+
/**
|
|
717
|
+
* Future flags to enable for the router.
|
|
718
|
+
*/
|
|
662
719
|
future?: Partial<FutureConfig$1>;
|
|
720
|
+
/**
|
|
721
|
+
* Hydration data to initialize the router with if you have already performed
|
|
722
|
+
* data loading on the server.
|
|
723
|
+
*/
|
|
663
724
|
hydrationData?: HydrationState;
|
|
725
|
+
/**
|
|
726
|
+
* Override the default data strategy of loading in parallel.
|
|
727
|
+
* Only intended for advanced usage.
|
|
728
|
+
*/
|
|
664
729
|
dataStrategy?: DataStrategyFunction;
|
|
730
|
+
/**
|
|
731
|
+
* Lazily define portions of the route tree on navigations.
|
|
732
|
+
*/
|
|
665
733
|
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction;
|
|
734
|
+
/**
|
|
735
|
+
* Window object override - defaults to the global `window` instance.
|
|
736
|
+
*/
|
|
666
737
|
window?: Window;
|
|
667
738
|
}
|
|
668
739
|
/**
|
|
740
|
+
* Create a new data router that manages the application path via `history.pushState`
|
|
741
|
+
* and `history.replaceState`.
|
|
742
|
+
*
|
|
669
743
|
* @category Data Routers
|
|
670
744
|
*/
|
|
671
|
-
declare function createBrowserRouter(
|
|
745
|
+
declare function createBrowserRouter(
|
|
746
|
+
/**
|
|
747
|
+
* Application routes
|
|
748
|
+
*/
|
|
749
|
+
routes: RouteObject[],
|
|
672
750
|
/**
|
|
751
|
+
* Router options
|
|
752
|
+
*/
|
|
753
|
+
opts?: DOMRouterOpts): Router$1;
|
|
754
|
+
/**
|
|
755
|
+
* Create a new data router that manages the application path via the URL hash
|
|
756
|
+
*
|
|
673
757
|
* @category Data Routers
|
|
674
758
|
*/
|
|
675
759
|
declare function createHashRouter(routes: RouteObject[], opts?: DOMRouterOpts): Router$1;
|
|
@@ -1599,4 +1683,4 @@ declare global {
|
|
|
1599
1683
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
1600
1684
|
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, isSpaMode: boolean): void;
|
|
1601
1685
|
|
|
1602
|
-
export {
|
|
1686
|
+
export { useSearchParams 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 FetcherSubmitFunction as G, type HashRouterProps as H, type IndexRouteProps as I, type FetcherWithComponents as J, createBrowserRouter as K, type LayoutRouteProps as L, type MemoryRouterOpts as M, type NavigateProps as N, type OutletProps as O, type PathRouteProps as P, createHashRouter as Q, type RouterProviderProps as R, type ScrollRestorationProps as S, BrowserRouter as T, HashRouter as U, Link as V, HistoryRouter as W, NavLink as X, Form as Y, ScrollRestoration as Z, useLinkClickHandler as _, type Route as a, useSubmit as a0, useFormAction as a1, useFetcher as a2, useFetchers as a3, useBeforeUnload as a4, usePrompt as a5, useViewTransitionState as a6, type FetcherSubmitOptions as a7, type ParamKeyValuePair as a8, type SubmitOptions as a9, type URLSearchParamsInit as aa, type SubmitTarget as ab, createSearchParams as ac, Meta as ad, Links as ae, Scripts as af, PrefetchPageLinks as ag, type ScriptsProps as ah, mapRouteProperties as ai, FrameworkContext as aj, getPatchRoutesOnNavigationFunction as ak, useFogOFWarDiscovery as al, createClientRoutes as am, createClientRoutesWithHMRRevalidationOptOut as an, shouldHydrateRouteLoader as ao, useScrollRestoration as ap, 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$1 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 SetURLSearchParams as y, type SubmitFunction as z };
|
|
@@ -8,4 +8,14 @@ interface AppLoadContext {
|
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* An augmentable interface users can modify in their app-code to opt into
|
|
13
|
+
* future-flag-specific types
|
|
14
|
+
*/
|
|
15
|
+
interface Future {
|
|
16
|
+
}
|
|
17
|
+
type MiddlewareEnabled = Future extends {
|
|
18
|
+
unstable_middleware: infer T extends boolean;
|
|
19
|
+
} ? T : false;
|
|
20
|
+
|
|
21
|
+
export type { AppLoadContext as A, Future as F, MiddlewareEnabled as M };
|
|
@@ -8,4 +8,14 @@ interface AppLoadContext {
|
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* An augmentable interface users can modify in their app-code to opt into
|
|
13
|
+
* future-flag-specific types
|
|
14
|
+
*/
|
|
15
|
+
interface Future {
|
|
16
|
+
}
|
|
17
|
+
type MiddlewareEnabled = Future extends {
|
|
18
|
+
unstable_middleware: infer T extends boolean;
|
|
19
|
+
} ? T : false;
|
|
20
|
+
|
|
21
|
+
export type { AppLoadContext as A, Future as F, MiddlewareEnabled as M };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-
|
|
4
|
-
export {
|
|
1
|
+
import { a as RouteModules, b as Router, D as DataStrategyFunction, c as RouteManifest, S as ServerRouteModule, u as unstable_RouterContextProvider, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, d as RelativeRoutingType, e as Location, f as Action, P as ParamParseKey, g as Path, h as PathPattern, i as PathMatch, N as NavigateOptions, j as Params$1, k as RouteObject, l as Navigation, m as RevalidationState, U as UIMatch, n as SerializeFrom, B as BlockerFunction, o as Blocker, p as StaticHandlerContext, q as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, r as unstable_InitialContext, s as IndexRouteObject, t as LoaderFunction, v as ActionFunction, M as MetaFunction, w as LinksFunction, x as NonIndexRouteObject, E as Equal, y as RouterState } from './route-data-H2S3hwhf.mjs';
|
|
2
|
+
export { au as ClientActionFunction, av as ClientActionFunctionArgs, aw as ClientLoaderFunction, ax as ClientLoaderFunctionArgs, ao as DataRouteMatch, ap as DataRouteObject, W as DataStrategyFunctionArgs, X as DataStrategyMatch, Y as DataStrategyResult, _ as ErrorResponse, J as Fetcher, $ as FormEncType, a0 as FormMethod, G as GetScrollPositionFunction, z as GetScrollRestorationKeyFunction, a1 as HTMLFormMethod, ay as HeadersArgs, az as HeadersFunction, aD as HtmlLinkDescriptor, ae as IDLE_BLOCKER, ad as IDLE_FETCHER, ac as IDLE_NAVIGATION, a2 as LazyRouteFunction, aE as LinkDescriptor, aA as MetaArgs, aB as MetaDescriptor, K as NavigationStates, aq as Navigator, aC as PageLinkDescriptor, ar as PatchRoutesOnNavigationFunction, as as PatchRoutesOnNavigationFunctionArgs, a4 as PathParam, a5 as RedirectFunction, at as RouteMatch, V as RouterFetchOptions, R as RouterInit, Q as RouterNavigateOptions, O as RouterSubscriber, a7 as ShouldRevalidateFunction, a8 as ShouldRevalidateFunctionArgs, aK as UNSAFE_DataRouterContext, aL as UNSAFE_DataRouterStateContext, Z as UNSAFE_DataWithResponseInit, aJ as UNSAFE_ErrorResponseImpl, aM as UNSAFE_FetchersContext, aN as UNSAFE_LocationContext, aO as UNSAFE_NavigationContext, aP as UNSAFE_RouteContext, aQ as UNSAFE_ViewTransitionContext, aG as UNSAFE_createBrowserHistory, aI as UNSAFE_createRouter, aH as UNSAFE_invariant, aa as createPath, af as data, ag as generatePath, ah as isRouteErrorResponse, ai as matchPath, aj as matchRoutes, ab as parsePath, ak as redirect, al as redirectDocument, am as replace, an as resolvePath, a3 as unstable_MiddlewareFunction, a6 as unstable_RouterContext, aF as unstable_SerializesTo, a9 as unstable_createContext } from './route-data-H2S3hwhf.mjs';
|
|
3
|
+
import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext, C as CriticalCss } from './fog-of-war-Da8gpnoZ.mjs';
|
|
4
|
+
export { g as Await, b as AwaitProps, T as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, w as FetcherFormProps, G as FetcherSubmitFunction, a7 as FetcherSubmitOptions, J as FetcherWithComponents, Y as Form, x as FormProps, U as HashRouter, H as HashRouterProps, s as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, V as Link, t as LinkProps, ae as Links, h as MemoryRouter, M as MemoryRouterOpts, c as MemoryRouterProps, ad as Meta, X as NavLink, u as NavLinkProps, v as NavLinkRenderProps, i as Navigate, N as NavigateProps, j as Outlet, O as OutletProps, a8 as ParamKeyValuePair, P as PathRouteProps, ag as PrefetchPageLinks, k as Route, d as RouteProps, l as Router, e as RouterProps, m as RouterProvider, R as RouterProviderProps, n as Routes, f as RoutesProps, af as Scripts, ah as ScriptsProps, Z as ScrollRestoration, S as ScrollRestorationProps, y as SetURLSearchParams, z as SubmitFunction, a9 as SubmitOptions, ab as SubmitTarget, aj as UNSAFE_FrameworkContext, am as UNSAFE_createClientRoutes, an as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ak as UNSAFE_getPatchRoutesOnNavigationFunction, ai as UNSAFE_mapRouteProperties, ao as UNSAFE_shouldHydrateRouteLoader, al as UNSAFE_useFogOFWarDiscovery, ap as UNSAFE_useScrollRestoration, aa as URLSearchParamsInit, K as createBrowserRouter, Q as createHashRouter, o as createMemoryRouter, p as createRoutesFromChildren, q as createRoutesFromElements, ac as createSearchParams, r as renderMatches, W as unstable_HistoryRouter, a5 as unstable_usePrompt, a4 as useBeforeUnload, a2 as useFetcher, a3 as useFetchers, a1 as useFormAction, _ as useLinkClickHandler, $ as useSearchParams, a0 as useSubmit, a6 as useViewTransitionState } from './fog-of-war-Da8gpnoZ.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
8
8
|
export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
|
|
9
|
-
import { A as AppLoadContext
|
|
9
|
+
import { M as MiddlewareEnabled, A as AppLoadContext } from './future-ldDp5FKH.mjs';
|
|
10
|
+
export { F as Future } from './future-ldDp5FKH.mjs';
|
|
10
11
|
|
|
11
12
|
declare const SingleFetchRedirectSymbol: unique symbol;
|
|
12
|
-
declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, getRouter: () => Router): DataStrategyFunction;
|
|
13
|
+
declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined, getRouter: () => Router): DataStrategyFunction;
|
|
13
14
|
declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
|
|
14
15
|
done: Promise<undefined>;
|
|
15
16
|
value: unknown;
|
|
@@ -30,6 +31,7 @@ interface ServerRoute extends Route {
|
|
|
30
31
|
module: ServerRouteModule;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
type OptionalCriticalCss = CriticalCss | undefined;
|
|
33
35
|
/**
|
|
34
36
|
* The output of the compiler for the server build.
|
|
35
37
|
*/
|
|
@@ -44,6 +46,9 @@ interface ServerBuild {
|
|
|
44
46
|
assetsBuildDirectory: string;
|
|
45
47
|
future: FutureConfig;
|
|
46
48
|
ssr: boolean;
|
|
49
|
+
getCriticalCss?: (args: {
|
|
50
|
+
pathname: string;
|
|
51
|
+
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
47
52
|
/**
|
|
48
53
|
* @deprecated This is now done via a custom header during prerendering
|
|
49
54
|
*/
|
|
@@ -51,7 +56,7 @@ interface ServerBuild {
|
|
|
51
56
|
prerender: string[];
|
|
52
57
|
}
|
|
53
58
|
interface HandleDocumentRequestFunction {
|
|
54
|
-
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: AppLoadContext
|
|
59
|
+
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? unstable_RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
55
60
|
}
|
|
56
61
|
interface HandleDataRequestFunction {
|
|
57
62
|
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise<Response> | Response;
|
|
@@ -503,9 +508,6 @@ interface StubNonIndexRouteObject extends Omit<NonIndexRouteObject, "loader" | "
|
|
|
503
508
|
links?: LinksFunction;
|
|
504
509
|
}
|
|
505
510
|
type StubRouteObject = StubIndexRouteObject | StubNonIndexRouteObject;
|
|
506
|
-
interface AppLoadContext {
|
|
507
|
-
[key: string]: unknown;
|
|
508
|
-
}
|
|
509
511
|
interface RoutesTestStubProps {
|
|
510
512
|
/**
|
|
511
513
|
* The initial entries in the history stack. This allows you to start a test with
|
|
@@ -538,7 +540,7 @@ interface RoutesTestStubProps {
|
|
|
538
540
|
/**
|
|
539
541
|
* @category Utils
|
|
540
542
|
*/
|
|
541
|
-
declare function createRoutesStub(routes: StubRouteObject[],
|
|
543
|
+
declare function createRoutesStub(routes: StubRouteObject[], unstable_getContext?: () => unstable_InitialContext): ({ initialEntries, initialIndex, hydrationData, future, }: RoutesTestStubProps) => React.JSX.Element;
|
|
542
544
|
|
|
543
545
|
interface CookieSignatureOptions {
|
|
544
546
|
/**
|
|
@@ -601,7 +603,7 @@ type IsCookieFunction = (object: any) => object is Cookie;
|
|
|
601
603
|
*/
|
|
602
604
|
declare const isCookie: IsCookieFunction;
|
|
603
605
|
|
|
604
|
-
type RequestHandler = (request: Request, loadContext?: AppLoadContext
|
|
606
|
+
type RequestHandler = (request: Request, loadContext?: MiddlewareEnabled extends true ? unstable_RouterContextProvider : AppLoadContext) => Promise<Response>;
|
|
605
607
|
type CreateRequestHandlerFunction = (build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>), mode?: string) => RequestHandler;
|
|
606
608
|
declare const createRequestHandler: CreateRequestHandlerFunction;
|
|
607
609
|
|
|
@@ -777,7 +779,7 @@ interface MemorySessionStorageOptions {
|
|
|
777
779
|
declare function createMemorySessionStorage<Data = SessionData, FlashData = Data>({ cookie }?: MemorySessionStorageOptions): SessionStorage<Data, FlashData>;
|
|
778
780
|
|
|
779
781
|
type DevServerHooks = {
|
|
780
|
-
getCriticalCss?: (
|
|
782
|
+
getCriticalCss?: (pathname: string) => Promise<string | undefined>;
|
|
781
783
|
processRequestError?: (error: unknown) => void;
|
|
782
784
|
};
|
|
783
785
|
declare function setDevServerHooks(devServerHooks: DevServerHooks): void;
|
|
@@ -836,4 +838,4 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
836
838
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
837
839
|
}
|
|
838
840
|
|
|
839
|
-
export { ActionFunction, ActionFunctionArgs, AppLoadContext
|
|
841
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params$1 as Params, Path, PathMatch, PathPattern, type Register, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, unstable_InitialContext, unstable_RouterContextProvider, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|