react-router 0.0.0-experimental-e613d4238 → 0.0.0-experimental-4e44d47
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/development/{chunk-YJ6T7YSE.js → chunk-7B7CUJYE.js} +345 -66
- package/dist/development/{chunk-XXC4LMW2.js → chunk-MTLWRICG.js} +164 -161
- package/dist/development/{chunk-2YVPYFDJ.mjs → chunk-PSQFTIPQ.mjs} +67 -51
- package/dist/development/{chunk-5P3HEZQU.mjs → chunk-XVVWTPHF.mjs} +307 -25
- package/dist/development/dom-export.d.mts +59 -4
- package/dist/development/dom-export.d.ts +59 -3
- package/dist/development/dom-export.js +8 -5
- package/dist/development/dom-export.mjs +8 -5
- package/dist/development/{index-react-server-client-DKvU8YRr.d.ts → index-react-server-client-83aVZHgI.d.ts} +198 -134
- package/dist/{production/index-react-server-client-2EDmGlsZ.d.mts → development/index-react-server-client-BDG19ZQl.d.mts} +140 -77
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +106 -1
- package/dist/development/index-react-server.d.ts +106 -1
- package/dist/development/index-react-server.js +181 -8
- package/dist/development/index-react-server.mjs +181 -8
- package/dist/development/index.d.mts +13 -18
- package/dist/development/index.d.ts +13 -16
- package/dist/development/index.js +161 -147
- package/dist/development/index.mjs +3 -5
- package/dist/development/instrumentation-XYmrzhe3.d.ts +1138 -0
- package/dist/development/lib/types/internal.d.mts +3 -3
- package/dist/development/lib/types/internal.d.ts +3 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-BrVEYTED.d.mts → register-DiOIlEq5.d.mts} +1 -7
- package/dist/{production/register-BrVEYTED.d.mts → development/register-DiOIlEq5.d.ts} +1 -7
- package/dist/development/{routeModules-BmVo7q9e.d.ts → routeModules-Bu1JamQV.d.ts} +73 -1046
- package/dist/development/{route-data-CDwqkzPE.d.mts → routeModules-CtCOLGtG.d.mts} +157 -147
- package/dist/development/{context-BqL5Eckq.d.mts → router-2BoB34m1.d.mts} +1403 -1250
- package/dist/production/{chunk-VNGQS422.mjs → chunk-GSSVRQ6M.mjs} +307 -25
- package/dist/production/{chunk-5MHETEIL.mjs → chunk-IZVJSKMU.mjs} +67 -51
- package/dist/production/{chunk-QBUHFRYZ.js → chunk-OXRQQZPR.js} +345 -66
- package/dist/production/{chunk-E4G6PZCJ.js → chunk-UNIYMJFU.js} +164 -161
- package/dist/production/dom-export.d.mts +59 -4
- package/dist/production/dom-export.d.ts +59 -3
- package/dist/production/dom-export.js +8 -5
- package/dist/production/dom-export.mjs +8 -5
- package/dist/{development/index-react-server-client-2EDmGlsZ.d.mts → production/index-react-server-client-83aVZHgI.d.ts} +140 -77
- package/dist/production/{index-react-server-client-DKvU8YRr.d.ts → index-react-server-client-BDG19ZQl.d.mts} +198 -134
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +106 -1
- package/dist/production/index-react-server.d.ts +106 -1
- package/dist/production/index-react-server.js +181 -8
- package/dist/production/index-react-server.mjs +181 -8
- package/dist/production/index.d.mts +13 -18
- package/dist/production/index.d.ts +13 -16
- package/dist/production/index.js +161 -147
- package/dist/production/index.mjs +3 -5
- package/dist/production/instrumentation-XYmrzhe3.d.ts +1138 -0
- package/dist/production/lib/types/internal.d.mts +3 -3
- package/dist/production/lib/types/internal.d.ts +3 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/register-D8NQoPsO.d.ts → production/register-DiOIlEq5.d.mts} +1 -7
- package/dist/production/{register-D8NQoPsO.d.ts → register-DiOIlEq5.d.ts} +1 -7
- package/dist/production/{routeModules-BmVo7q9e.d.ts → routeModules-Bu1JamQV.d.ts} +73 -1046
- package/dist/production/{route-data-CDwqkzPE.d.mts → routeModules-CtCOLGtG.d.mts} +157 -147
- package/dist/production/{context-BqL5Eckq.d.mts → router-2BoB34m1.d.mts} +1403 -1250
- package/package.json +1 -1
|
@@ -1,60 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b8 as RouteManifest, H as HydrationState, G as DataRouteObject, Q as StaticHandlerContext, e as MiddlewareEnabled, c as RouterContextProvider, f as LoaderFunctionArgs, A as ActionFunctionArgs, b9 as unstable_ServerInstrumentation, a4 as HTMLFormMethod, a2 as FormEncType, n as RelativeRoutingType, T as To, ba as History, O as GetScrollRestorationKeyFunction, a as RouterInit, bb as FutureConfig$1, u as unstable_ClientInstrumentation, l as DataStrategyFunction, F as PatchRoutesOnNavigationFunction, N as NavigateOptions, V as Fetcher, v as RouteObject, k as Router, B as BlockerFunction, L as Location, bc as CreateStaticHandlerOptions$1, J as StaticHandler } from './router-2BoB34m1.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { c as RouteModules, h as ClientLoaderFunction, o as ServerRouteModule, A as AppLoadContext, m as PageLinkDescriptor, d as SerializeFrom } from './routeModules-CtCOLGtG.mjs';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type OptionalCriticalCss = CriticalCss | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* The output of the compiler for the server build.
|
|
14
|
-
*/
|
|
15
|
-
interface ServerBuild {
|
|
16
|
-
entry: {
|
|
17
|
-
module: ServerEntryModule;
|
|
18
|
-
};
|
|
19
|
-
routes: ServerRouteManifest;
|
|
20
|
-
assets: AssetsManifest;
|
|
21
|
-
basename?: string;
|
|
22
|
-
publicPath: string;
|
|
23
|
-
assetsBuildDirectory: string;
|
|
24
|
-
future: FutureConfig;
|
|
25
|
-
ssr: boolean;
|
|
26
|
-
unstable_getCriticalCss?: (args: {
|
|
27
|
-
pathname: string;
|
|
28
|
-
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
31
|
-
*/
|
|
32
|
-
isSpaMode: boolean;
|
|
33
|
-
prerender: string[];
|
|
34
|
-
routeDiscovery: {
|
|
35
|
-
mode: "lazy" | "initial";
|
|
36
|
-
manifestPath: string;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
interface HandleDocumentRequestFunction {
|
|
40
|
-
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
41
|
-
}
|
|
42
|
-
interface HandleDataRequestFunction {
|
|
43
|
-
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise<Response> | Response;
|
|
44
|
-
}
|
|
45
|
-
interface HandleErrorFunction {
|
|
46
|
-
(error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void;
|
|
5
|
+
interface Route {
|
|
6
|
+
index?: boolean;
|
|
7
|
+
caseSensitive?: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
parentId?: string;
|
|
10
|
+
path?: string;
|
|
47
11
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
12
|
+
interface EntryRoute extends Route {
|
|
13
|
+
hasAction: boolean;
|
|
14
|
+
hasLoader: boolean;
|
|
15
|
+
hasClientAction: boolean;
|
|
16
|
+
hasClientLoader: boolean;
|
|
17
|
+
hasClientMiddleware: boolean;
|
|
18
|
+
hasErrorBoundary: boolean;
|
|
19
|
+
imports?: string[];
|
|
20
|
+
css?: string[];
|
|
21
|
+
module: string;
|
|
22
|
+
clientActionModule: string | undefined;
|
|
23
|
+
clientLoaderModule: string | undefined;
|
|
24
|
+
clientMiddlewareModule: string | undefined;
|
|
25
|
+
hydrateFallbackModule: string | undefined;
|
|
26
|
+
parentId?: string;
|
|
57
27
|
}
|
|
28
|
+
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
29
|
+
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[];
|
|
30
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
58
31
|
|
|
59
32
|
type SerializedError = {
|
|
60
33
|
message: string;
|
|
@@ -108,32 +81,68 @@ interface AssetsManifest {
|
|
|
108
81
|
sri?: Record<string, string> | true;
|
|
109
82
|
}
|
|
110
83
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
parentId?: string;
|
|
116
|
-
path?: string;
|
|
84
|
+
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
85
|
+
interface ServerRoute extends Route {
|
|
86
|
+
children: ServerRoute[];
|
|
87
|
+
module: ServerRouteModule;
|
|
117
88
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
89
|
+
|
|
90
|
+
type OptionalCriticalCss = CriticalCss | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The output of the compiler for the server build.
|
|
93
|
+
*/
|
|
94
|
+
interface ServerBuild {
|
|
95
|
+
entry: {
|
|
96
|
+
module: ServerEntryModule;
|
|
97
|
+
};
|
|
98
|
+
routes: ServerRouteManifest;
|
|
99
|
+
assets: AssetsManifest;
|
|
100
|
+
basename?: string;
|
|
101
|
+
publicPath: string;
|
|
102
|
+
assetsBuildDirectory: string;
|
|
103
|
+
future: FutureConfig;
|
|
104
|
+
ssr: boolean;
|
|
105
|
+
unstable_getCriticalCss?: (args: {
|
|
106
|
+
pathname: string;
|
|
107
|
+
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated This is now done via a custom header during prerendering
|
|
110
|
+
*/
|
|
111
|
+
isSpaMode: boolean;
|
|
112
|
+
prerender: string[];
|
|
113
|
+
routeDiscovery: {
|
|
114
|
+
mode: "lazy" | "initial";
|
|
115
|
+
manifestPath: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
interface HandleDocumentRequestFunction {
|
|
119
|
+
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
120
|
+
}
|
|
121
|
+
interface HandleDataRequestFunction {
|
|
122
|
+
(response: Response, args: {
|
|
123
|
+
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
124
|
+
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
125
|
+
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
126
|
+
}): Promise<Response> | Response;
|
|
127
|
+
}
|
|
128
|
+
interface HandleErrorFunction {
|
|
129
|
+
(error: unknown, args: {
|
|
130
|
+
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
131
|
+
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
132
|
+
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
133
|
+
}): void;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A module that serves as the entry point for a Remix app during server
|
|
137
|
+
* rendering.
|
|
138
|
+
*/
|
|
139
|
+
interface ServerEntryModule {
|
|
140
|
+
default: HandleDocumentRequestFunction;
|
|
141
|
+
handleDataRequest?: HandleDataRequestFunction;
|
|
142
|
+
handleError?: HandleErrorFunction;
|
|
143
|
+
unstable_instrumentations?: unstable_ServerInstrumentation[];
|
|
144
|
+
streamTimeout?: number;
|
|
133
145
|
}
|
|
134
|
-
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
135
|
-
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[];
|
|
136
|
-
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
137
146
|
|
|
138
147
|
type ParamKeyValuePair = [string, string];
|
|
139
148
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
@@ -522,6 +531,58 @@ interface DOMRouterOpts {
|
|
|
522
531
|
* ```
|
|
523
532
|
*/
|
|
524
533
|
hydrationData?: HydrationState;
|
|
534
|
+
/**
|
|
535
|
+
* Array of instrumentation objects allowing you to instrument the router and
|
|
536
|
+
* individual routes prior to router initialization (and on any subsequently
|
|
537
|
+
* added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
|
|
538
|
+
* mostly useful for observability such as wrapping navigations, fetches,
|
|
539
|
+
* as well as route loaders/actions/middlewares with logging and/or performance
|
|
540
|
+
* tracing.
|
|
541
|
+
*
|
|
542
|
+
* ```tsx
|
|
543
|
+
* let router = createBrowserRouter(routes, {
|
|
544
|
+
* unstable_instrumentations: [logging]
|
|
545
|
+
* });
|
|
546
|
+
*
|
|
547
|
+
*
|
|
548
|
+
* let logging = {
|
|
549
|
+
* router({ instrument }) {
|
|
550
|
+
* instrument({
|
|
551
|
+
* navigate: (impl, info) => logExecution(`navigate ${info.to}`, impl),
|
|
552
|
+
* fetch: (impl, info) => logExecution(`fetch ${info.to}`, impl)
|
|
553
|
+
* });
|
|
554
|
+
* },
|
|
555
|
+
* route({ instrument, id }) {
|
|
556
|
+
* instrument({
|
|
557
|
+
* middleware: (impl, info) => logExecution(
|
|
558
|
+
* `middleware ${info.request.url} (route ${id})`,
|
|
559
|
+
* impl
|
|
560
|
+
* ),
|
|
561
|
+
* loader: (impl, info) => logExecution(
|
|
562
|
+
* `loader ${info.request.url} (route ${id})`,
|
|
563
|
+
* impl
|
|
564
|
+
* ),
|
|
565
|
+
* action: (impl, info) => logExecution(
|
|
566
|
+
* `action ${info.request.url} (route ${id})`,
|
|
567
|
+
* impl
|
|
568
|
+
* ),
|
|
569
|
+
* })
|
|
570
|
+
* }
|
|
571
|
+
* };
|
|
572
|
+
*
|
|
573
|
+
* async function logExecution(label: string, impl: () => Promise<void>) {
|
|
574
|
+
* let start = performance.now();
|
|
575
|
+
* console.log(`start ${label}`);
|
|
576
|
+
* try {
|
|
577
|
+
* await impl();
|
|
578
|
+
* } finally {
|
|
579
|
+
* let end = performance.now();
|
|
580
|
+
* console.log(`end ${label} (${Math.round(end - start)}ms)`);
|
|
581
|
+
* }
|
|
582
|
+
* }
|
|
583
|
+
* ```
|
|
584
|
+
*/
|
|
585
|
+
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
525
586
|
/**
|
|
526
587
|
* Override the default data strategy of running loaders in parallel.
|
|
527
588
|
* See {@link DataStrategyFunction}.
|
|
@@ -1027,6 +1088,7 @@ interface DOMRouterOpts {
|
|
|
1027
1088
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1028
1089
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1029
1090
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1091
|
+
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1030
1092
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1031
1093
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
1032
1094
|
* @returns An initialized {@link DataRouter| data router} to pass to {@link RouterProvider | `<RouterProvider>`}
|
|
@@ -1045,6 +1107,7 @@ declare function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts
|
|
|
1045
1107
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1046
1108
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1047
1109
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1110
|
+
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1048
1111
|
* @param {DOMRouterOpts.dataStrategy} opts.dataStrategy n/a
|
|
1049
1112
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1050
1113
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { aF as MemoryRouter, aG as Navigate, aH as Outlet, aI as Route, aJ as Router, aK as RouterProvider, aL as Routes, as as UNSAFE_AwaitContextProvider, b2 as UNSAFE_WithComponentProps, b6 as UNSAFE_WithErrorBoundaryProps, b4 as UNSAFE_WithHydrateFallbackProps } from './router-2BoB34m1.mjs';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-BDG19ZQl.mjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import './
|
|
4
|
+
import './routeModules-CtCOLGtG.mjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { af as MemoryRouter, ag as Navigate, ah as Outlet, ai as Route, aj as Router, ak as RouterProvider, al as Routes, a0 as UNSAFE_AwaitContextProvider, aH as UNSAFE_WithComponentProps, aL as UNSAFE_WithErrorBoundaryProps, aJ as UNSAFE_WithHydrateFallbackProps } from './routeModules-Bu1JamQV.js';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-83aVZHgI.js';
|
|
3
3
|
import 'react';
|
|
4
|
+
import './instrumentation-XYmrzhe3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-4e44d47
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkMTLWRICGjs = require('./chunk-MTLWRICG.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk7B7CUJYEjs = require('./chunk-7B7CUJYE.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkYJ6T7YSEjs = require('./chunk-YJ6T7YSE.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkMTLWRICGjs.BrowserRouter; exports.Form = _chunkMTLWRICGjs.Form; exports.HashRouter = _chunkMTLWRICGjs.HashRouter; exports.Link = _chunkMTLWRICGjs.Link; exports.Links = _chunk7B7CUJYEjs.Links; exports.MemoryRouter = _chunkMTLWRICGjs.MemoryRouter; exports.Meta = _chunk7B7CUJYEjs.Meta; exports.NavLink = _chunkMTLWRICGjs.NavLink; exports.Navigate = _chunkMTLWRICGjs.Navigate; exports.Outlet = _chunkMTLWRICGjs.Outlet; exports.Route = _chunkMTLWRICGjs.Route; exports.Router = _chunkMTLWRICGjs.Router; exports.RouterProvider = _chunkMTLWRICGjs.RouterProvider; exports.Routes = _chunkMTLWRICGjs.Routes; exports.ScrollRestoration = _chunkMTLWRICGjs.ScrollRestoration; exports.StaticRouter = _chunkMTLWRICGjs.StaticRouter; exports.StaticRouterProvider = _chunkMTLWRICGjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk7B7CUJYEjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkMTLWRICGjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkMTLWRICGjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkMTLWRICGjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkMTLWRICGjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-4e44d47
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-XVVWTPHF.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|
|
@@ -351,6 +351,11 @@ type DefaultContext = MiddlewareEnabled extends true ? Readonly<RouterContextPro
|
|
|
351
351
|
interface DataFunctionArgs<Context> {
|
|
352
352
|
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read headers (like cookies, and {@link https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams URLSearchParams} from the request. */
|
|
353
353
|
request: Request;
|
|
354
|
+
/**
|
|
355
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
356
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
357
|
+
*/
|
|
358
|
+
pattern: string;
|
|
354
359
|
/**
|
|
355
360
|
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
356
361
|
* @example
|
|
@@ -571,7 +576,7 @@ type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = Agn
|
|
|
571
576
|
* properties from framework-agnostic properties
|
|
572
577
|
*/
|
|
573
578
|
interface MapRoutePropertiesFunction {
|
|
574
|
-
(route:
|
|
579
|
+
(route: AgnosticDataRouteObject): {
|
|
575
580
|
hasErrorBoundary: boolean;
|
|
576
581
|
} & Record<string, any>;
|
|
577
582
|
}
|
|
@@ -887,6 +892,99 @@ type ErrorResponse = {
|
|
|
887
892
|
*/
|
|
888
893
|
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
889
894
|
|
|
895
|
+
type unstable_ServerInstrumentation = {
|
|
896
|
+
handler?: unstable_InstrumentRequestHandlerFunction;
|
|
897
|
+
route?: unstable_InstrumentRouteFunction;
|
|
898
|
+
};
|
|
899
|
+
type unstable_ClientInstrumentation = {
|
|
900
|
+
router?: unstable_InstrumentRouterFunction;
|
|
901
|
+
route?: unstable_InstrumentRouteFunction;
|
|
902
|
+
};
|
|
903
|
+
type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
904
|
+
type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
905
|
+
type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
906
|
+
interface GenericInstrumentFunction {
|
|
907
|
+
(handler: () => Promise<void>, info: unknown): Promise<void>;
|
|
908
|
+
}
|
|
909
|
+
type InstrumentableRoute = {
|
|
910
|
+
id: string;
|
|
911
|
+
index: boolean | undefined;
|
|
912
|
+
path: string | undefined;
|
|
913
|
+
instrument(instrumentations: RouteInstrumentations): void;
|
|
914
|
+
};
|
|
915
|
+
type RouteInstrumentations = {
|
|
916
|
+
lazy?: InstrumentLazyFunction;
|
|
917
|
+
"lazy.loader"?: InstrumentLazyFunction;
|
|
918
|
+
"lazy.action"?: InstrumentLazyFunction;
|
|
919
|
+
"lazy.middleware"?: InstrumentLazyFunction;
|
|
920
|
+
middleware?: InstrumentRouteHandlerFunction;
|
|
921
|
+
loader?: InstrumentRouteHandlerFunction;
|
|
922
|
+
action?: InstrumentRouteHandlerFunction;
|
|
923
|
+
};
|
|
924
|
+
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
925
|
+
request: {
|
|
926
|
+
method: string;
|
|
927
|
+
url: string;
|
|
928
|
+
headers: Pick<Headers, "get">;
|
|
929
|
+
};
|
|
930
|
+
params: LoaderFunctionArgs["params"];
|
|
931
|
+
pattern: string;
|
|
932
|
+
context: Pick<RouterContextProvider, "get">;
|
|
933
|
+
}>;
|
|
934
|
+
interface InstrumentLazyFunction extends GenericInstrumentFunction {
|
|
935
|
+
(handler: () => Promise<void>): Promise<void>;
|
|
936
|
+
}
|
|
937
|
+
interface InstrumentRouteHandlerFunction extends GenericInstrumentFunction {
|
|
938
|
+
(handler: () => Promise<void>, info: RouteHandlerInstrumentationInfo): Promise<void>;
|
|
939
|
+
}
|
|
940
|
+
type InstrumentableRouter = {
|
|
941
|
+
instrument(instrumentations: RouterInstrumentations): void;
|
|
942
|
+
};
|
|
943
|
+
type RouterInstrumentations = {
|
|
944
|
+
navigate?: InstrumentNavigateFunction;
|
|
945
|
+
fetch?: InstrumentFetchFunction;
|
|
946
|
+
};
|
|
947
|
+
type RouterNavigationInstrumentationInfo = Readonly<{
|
|
948
|
+
to: string | number;
|
|
949
|
+
currentUrl: string;
|
|
950
|
+
formMethod?: HTMLFormMethod;
|
|
951
|
+
formEncType?: FormEncType;
|
|
952
|
+
formData?: FormData;
|
|
953
|
+
body?: any;
|
|
954
|
+
}>;
|
|
955
|
+
type RouterFetchInstrumentationInfo = Readonly<{
|
|
956
|
+
href: string;
|
|
957
|
+
currentUrl: string;
|
|
958
|
+
fetcherKey: string;
|
|
959
|
+
formMethod?: HTMLFormMethod;
|
|
960
|
+
formEncType?: FormEncType;
|
|
961
|
+
formData?: FormData;
|
|
962
|
+
body?: any;
|
|
963
|
+
}>;
|
|
964
|
+
interface InstrumentNavigateFunction extends GenericInstrumentFunction {
|
|
965
|
+
(handler: () => Promise<void>, info: RouterNavigationInstrumentationInfo): MaybePromise<void>;
|
|
966
|
+
}
|
|
967
|
+
interface InstrumentFetchFunction extends GenericInstrumentFunction {
|
|
968
|
+
(handler: () => Promise<void>, info: RouterFetchInstrumentationInfo): MaybePromise<void>;
|
|
969
|
+
}
|
|
970
|
+
type InstrumentableRequestHandler = {
|
|
971
|
+
instrument(instrumentations: RequestHandlerInstrumentations): void;
|
|
972
|
+
};
|
|
973
|
+
type RequestHandlerInstrumentations = {
|
|
974
|
+
request?: InstrumentRequestHandlerFunction;
|
|
975
|
+
};
|
|
976
|
+
type RequestHandlerInstrumentationInfo = Readonly<{
|
|
977
|
+
request: {
|
|
978
|
+
method: string;
|
|
979
|
+
url: string;
|
|
980
|
+
headers: Pick<Headers, "get">;
|
|
981
|
+
};
|
|
982
|
+
context: Pick<RouterContextProvider, "get">;
|
|
983
|
+
}>;
|
|
984
|
+
interface InstrumentRequestHandlerFunction extends GenericInstrumentFunction {
|
|
985
|
+
(handler: () => Promise<void>, info: RequestHandlerInstrumentationInfo): MaybePromise<void>;
|
|
986
|
+
}
|
|
987
|
+
|
|
890
988
|
/**
|
|
891
989
|
* A Router instance manages all navigation and data loading/mutations
|
|
892
990
|
*/
|
|
@@ -1171,6 +1269,7 @@ interface RouterInit {
|
|
|
1171
1269
|
history: History;
|
|
1172
1270
|
basename?: string;
|
|
1173
1271
|
getContext?: () => MaybePromise<RouterContextProvider>;
|
|
1272
|
+
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
1174
1273
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1175
1274
|
future?: Partial<FutureConfig>;
|
|
1176
1275
|
hydrationRouteProperties?: string[];
|
|
@@ -1437,6 +1536,7 @@ type BlockerFunction = (args: {
|
|
|
1437
1536
|
interface CreateStaticHandlerOptions {
|
|
1438
1537
|
basename?: string;
|
|
1439
1538
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1539
|
+
unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
|
|
1440
1540
|
future?: {};
|
|
1441
1541
|
}
|
|
1442
1542
|
declare function createStaticHandler(routes: AgnosticRouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
|
|
@@ -1807,6 +1907,11 @@ type ClientDataFunctionArgs<Params> = {
|
|
|
1807
1907
|
* }
|
|
1808
1908
|
**/
|
|
1809
1909
|
params: Params;
|
|
1910
|
+
/**
|
|
1911
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
1912
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
1913
|
+
*/
|
|
1914
|
+
pattern: string;
|
|
1810
1915
|
/**
|
|
1811
1916
|
* When `future.v8_middleware` is not enabled, this is undefined.
|
|
1812
1917
|
*
|
|
@@ -351,6 +351,11 @@ type DefaultContext = MiddlewareEnabled extends true ? Readonly<RouterContextPro
|
|
|
351
351
|
interface DataFunctionArgs<Context> {
|
|
352
352
|
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read headers (like cookies, and {@link https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams URLSearchParams} from the request. */
|
|
353
353
|
request: Request;
|
|
354
|
+
/**
|
|
355
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
356
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
357
|
+
*/
|
|
358
|
+
pattern: string;
|
|
354
359
|
/**
|
|
355
360
|
* {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
|
|
356
361
|
* @example
|
|
@@ -571,7 +576,7 @@ type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = Agn
|
|
|
571
576
|
* properties from framework-agnostic properties
|
|
572
577
|
*/
|
|
573
578
|
interface MapRoutePropertiesFunction {
|
|
574
|
-
(route:
|
|
579
|
+
(route: AgnosticDataRouteObject): {
|
|
575
580
|
hasErrorBoundary: boolean;
|
|
576
581
|
} & Record<string, any>;
|
|
577
582
|
}
|
|
@@ -887,6 +892,99 @@ type ErrorResponse = {
|
|
|
887
892
|
*/
|
|
888
893
|
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
889
894
|
|
|
895
|
+
type unstable_ServerInstrumentation = {
|
|
896
|
+
handler?: unstable_InstrumentRequestHandlerFunction;
|
|
897
|
+
route?: unstable_InstrumentRouteFunction;
|
|
898
|
+
};
|
|
899
|
+
type unstable_ClientInstrumentation = {
|
|
900
|
+
router?: unstable_InstrumentRouterFunction;
|
|
901
|
+
route?: unstable_InstrumentRouteFunction;
|
|
902
|
+
};
|
|
903
|
+
type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
904
|
+
type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
905
|
+
type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
906
|
+
interface GenericInstrumentFunction {
|
|
907
|
+
(handler: () => Promise<void>, info: unknown): Promise<void>;
|
|
908
|
+
}
|
|
909
|
+
type InstrumentableRoute = {
|
|
910
|
+
id: string;
|
|
911
|
+
index: boolean | undefined;
|
|
912
|
+
path: string | undefined;
|
|
913
|
+
instrument(instrumentations: RouteInstrumentations): void;
|
|
914
|
+
};
|
|
915
|
+
type RouteInstrumentations = {
|
|
916
|
+
lazy?: InstrumentLazyFunction;
|
|
917
|
+
"lazy.loader"?: InstrumentLazyFunction;
|
|
918
|
+
"lazy.action"?: InstrumentLazyFunction;
|
|
919
|
+
"lazy.middleware"?: InstrumentLazyFunction;
|
|
920
|
+
middleware?: InstrumentRouteHandlerFunction;
|
|
921
|
+
loader?: InstrumentRouteHandlerFunction;
|
|
922
|
+
action?: InstrumentRouteHandlerFunction;
|
|
923
|
+
};
|
|
924
|
+
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
925
|
+
request: {
|
|
926
|
+
method: string;
|
|
927
|
+
url: string;
|
|
928
|
+
headers: Pick<Headers, "get">;
|
|
929
|
+
};
|
|
930
|
+
params: LoaderFunctionArgs["params"];
|
|
931
|
+
pattern: string;
|
|
932
|
+
context: Pick<RouterContextProvider, "get">;
|
|
933
|
+
}>;
|
|
934
|
+
interface InstrumentLazyFunction extends GenericInstrumentFunction {
|
|
935
|
+
(handler: () => Promise<void>): Promise<void>;
|
|
936
|
+
}
|
|
937
|
+
interface InstrumentRouteHandlerFunction extends GenericInstrumentFunction {
|
|
938
|
+
(handler: () => Promise<void>, info: RouteHandlerInstrumentationInfo): Promise<void>;
|
|
939
|
+
}
|
|
940
|
+
type InstrumentableRouter = {
|
|
941
|
+
instrument(instrumentations: RouterInstrumentations): void;
|
|
942
|
+
};
|
|
943
|
+
type RouterInstrumentations = {
|
|
944
|
+
navigate?: InstrumentNavigateFunction;
|
|
945
|
+
fetch?: InstrumentFetchFunction;
|
|
946
|
+
};
|
|
947
|
+
type RouterNavigationInstrumentationInfo = Readonly<{
|
|
948
|
+
to: string | number;
|
|
949
|
+
currentUrl: string;
|
|
950
|
+
formMethod?: HTMLFormMethod;
|
|
951
|
+
formEncType?: FormEncType;
|
|
952
|
+
formData?: FormData;
|
|
953
|
+
body?: any;
|
|
954
|
+
}>;
|
|
955
|
+
type RouterFetchInstrumentationInfo = Readonly<{
|
|
956
|
+
href: string;
|
|
957
|
+
currentUrl: string;
|
|
958
|
+
fetcherKey: string;
|
|
959
|
+
formMethod?: HTMLFormMethod;
|
|
960
|
+
formEncType?: FormEncType;
|
|
961
|
+
formData?: FormData;
|
|
962
|
+
body?: any;
|
|
963
|
+
}>;
|
|
964
|
+
interface InstrumentNavigateFunction extends GenericInstrumentFunction {
|
|
965
|
+
(handler: () => Promise<void>, info: RouterNavigationInstrumentationInfo): MaybePromise<void>;
|
|
966
|
+
}
|
|
967
|
+
interface InstrumentFetchFunction extends GenericInstrumentFunction {
|
|
968
|
+
(handler: () => Promise<void>, info: RouterFetchInstrumentationInfo): MaybePromise<void>;
|
|
969
|
+
}
|
|
970
|
+
type InstrumentableRequestHandler = {
|
|
971
|
+
instrument(instrumentations: RequestHandlerInstrumentations): void;
|
|
972
|
+
};
|
|
973
|
+
type RequestHandlerInstrumentations = {
|
|
974
|
+
request?: InstrumentRequestHandlerFunction;
|
|
975
|
+
};
|
|
976
|
+
type RequestHandlerInstrumentationInfo = Readonly<{
|
|
977
|
+
request: {
|
|
978
|
+
method: string;
|
|
979
|
+
url: string;
|
|
980
|
+
headers: Pick<Headers, "get">;
|
|
981
|
+
};
|
|
982
|
+
context: Pick<RouterContextProvider, "get">;
|
|
983
|
+
}>;
|
|
984
|
+
interface InstrumentRequestHandlerFunction extends GenericInstrumentFunction {
|
|
985
|
+
(handler: () => Promise<void>, info: RequestHandlerInstrumentationInfo): MaybePromise<void>;
|
|
986
|
+
}
|
|
987
|
+
|
|
890
988
|
/**
|
|
891
989
|
* A Router instance manages all navigation and data loading/mutations
|
|
892
990
|
*/
|
|
@@ -1171,6 +1269,7 @@ interface RouterInit {
|
|
|
1171
1269
|
history: History;
|
|
1172
1270
|
basename?: string;
|
|
1173
1271
|
getContext?: () => MaybePromise<RouterContextProvider>;
|
|
1272
|
+
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
1174
1273
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1175
1274
|
future?: Partial<FutureConfig>;
|
|
1176
1275
|
hydrationRouteProperties?: string[];
|
|
@@ -1437,6 +1536,7 @@ type BlockerFunction = (args: {
|
|
|
1437
1536
|
interface CreateStaticHandlerOptions {
|
|
1438
1537
|
basename?: string;
|
|
1439
1538
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1539
|
+
unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
|
|
1440
1540
|
future?: {};
|
|
1441
1541
|
}
|
|
1442
1542
|
declare function createStaticHandler(routes: AgnosticRouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
|
|
@@ -1807,6 +1907,11 @@ type ClientDataFunctionArgs<Params> = {
|
|
|
1807
1907
|
* }
|
|
1808
1908
|
**/
|
|
1809
1909
|
params: Params;
|
|
1910
|
+
/**
|
|
1911
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
1912
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
1913
|
+
*/
|
|
1914
|
+
pattern: string;
|
|
1810
1915
|
/**
|
|
1811
1916
|
* When `future.v8_middleware` is not enabled, this is undefined.
|
|
1812
1917
|
*
|