react-router 7.9.4 → 7.9.6
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 +70 -0
- package/dist/development/browser-BbBXFHbO.d.ts +310 -0
- package/dist/development/browser-C07r42Tt.d.mts +310 -0
- package/dist/development/{chunk-OIYGIGL5.mjs → chunk-4WY6JWTD.mjs} +458 -43
- package/dist/development/{chunk-DI2QHYMJ.js → chunk-AMVS5XVJ.js} +1314 -138
- package/dist/development/{chunk-WY5IRSCW.mjs → chunk-G3INQAYP.mjs} +197 -857
- package/dist/development/chunk-O4JVZSOY.js +1310 -0
- package/dist/development/chunk-PZWDWJAY.js +188 -0
- package/dist/development/dom-export.d.mts +103 -6
- package/dist/development/dom-export.d.ts +103 -4
- package/dist/development/dom-export.js +708 -20
- package/dist/development/dom-export.mjs +692 -11
- package/dist/{production/index-react-server-client-BbRcBjrA.d.ts → development/index-react-server-client-Da3kmxNd.d.ts} +195 -135
- package/dist/{production/index-react-server-client-BIz4AUNd.d.mts → development/index-react-server-client-rcoGPJhU.d.mts} +137 -78
- package/dist/development/index-react-server-client.d.mts +2 -3
- package/dist/development/index-react-server-client.d.ts +2 -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 +107 -3
- package/dist/development/index-react-server.d.ts +107 -3
- package/dist/development/index-react-server.js +259 -13
- package/dist/development/index-react-server.mjs +259 -13
- package/dist/development/index.d.mts +14 -320
- package/dist/development/index.d.ts +14 -362
- package/dist/development/index.js +146 -962
- package/dist/development/index.mjs +3 -9
- package/dist/development/{routeModules-D5iJ6JYT.d.ts → instrumentation-Unc20tLk.d.ts} +178 -25
- package/dist/development/lib/types/internal.d.mts +2 -3
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/register-C34pU-in.d.ts → development/register-BpU9rFBJ.d.ts} +1 -1
- package/dist/development/{register-CI4bTprK.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/{production/context-DSyS5mLj.d.mts → development/router-CAvh_Drx.d.mts} +1877 -1254
- package/dist/production/browser-BbBXFHbO.d.ts +310 -0
- package/dist/production/browser-C07r42Tt.d.mts +310 -0
- package/dist/production/{chunk-4E5LHRQP.js → chunk-EAIF67OW.js} +1314 -138
- package/dist/production/{chunk-FR6HSPLK.mjs → chunk-FDUMZGKM.mjs} +197 -857
- package/dist/production/{chunk-3TADTUL4.mjs → chunk-FUSXQSWG.mjs} +458 -43
- package/dist/production/chunk-G5A35OQU.js +188 -0
- package/dist/production/chunk-QN64DHI4.js +1310 -0
- package/dist/production/dom-export.d.mts +103 -6
- package/dist/production/dom-export.d.ts +103 -4
- package/dist/production/dom-export.js +708 -20
- package/dist/production/dom-export.mjs +692 -11
- package/dist/{development/index-react-server-client-BIz4AUNd.d.mts → production/index-react-server-client-Da3kmxNd.d.ts} +137 -78
- package/dist/{development/index-react-server-client-BbRcBjrA.d.ts → production/index-react-server-client-rcoGPJhU.d.mts} +195 -135
- package/dist/production/index-react-server-client.d.mts +2 -3
- package/dist/production/index-react-server-client.d.ts +2 -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 +107 -3
- package/dist/production/index-react-server.d.ts +107 -3
- package/dist/production/index-react-server.js +259 -13
- package/dist/production/index-react-server.mjs +259 -13
- package/dist/production/index.d.mts +14 -320
- package/dist/production/index.d.ts +14 -362
- package/dist/production/index.js +146 -962
- package/dist/production/index.mjs +3 -9
- package/dist/production/{routeModules-D5iJ6JYT.d.ts → instrumentation-Unc20tLk.d.ts} +178 -25
- package/dist/production/lib/types/internal.d.mts +2 -3
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/register-C34pU-in.d.ts → production/register-BpU9rFBJ.d.ts} +1 -1
- package/dist/production/{register-CI4bTprK.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/{development/context-DSyS5mLj.d.mts → production/router-CAvh_Drx.d.mts} +1877 -1254
- package/package.json +1 -1
- package/dist/development/browser-z32v5KVN.d.mts +0 -46
- package/dist/development/chunk-72XNTZCV.js +0 -2089
- package/dist/development/route-data-DZQOUSqV.d.mts +0 -473
- package/dist/production/browser-z32v5KVN.d.mts +0 -46
- package/dist/production/chunk-WNLQ53P5.js +0 -2089
- package/dist/production/route-data-DZQOUSqV.d.mts +0 -473
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
var _chunkQN64DHI4js = require('./chunk-QN64DHI4.js');
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
|
|
@@ -29,12 +30,11 @@
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
var _chunkWNLQ53P5js = require('./chunk-WNLQ53P5.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkEAIF67OWjs = require('./chunk-EAIF67OW.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunk4E5LHRQPjs = require('./chunk-4E5LHRQP.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkQN64DHI4js.BrowserRouter; exports.Form = _chunkQN64DHI4js.Form; exports.HashRouter = _chunkQN64DHI4js.HashRouter; exports.Link = _chunkQN64DHI4js.Link; exports.Links = _chunkEAIF67OWjs.Links; exports.MemoryRouter = _chunkEAIF67OWjs.MemoryRouter; exports.Meta = _chunkEAIF67OWjs.Meta; exports.NavLink = _chunkQN64DHI4js.NavLink; exports.Navigate = _chunkEAIF67OWjs.Navigate; exports.Outlet = _chunkEAIF67OWjs.Outlet; exports.Route = _chunkEAIF67OWjs.Route; exports.Router = _chunkEAIF67OWjs.Router; exports.RouterProvider = _chunkEAIF67OWjs.RouterProvider; exports.Routes = _chunkEAIF67OWjs.Routes; exports.ScrollRestoration = _chunkQN64DHI4js.ScrollRestoration; exports.StaticRouter = _chunkQN64DHI4js.StaticRouter; exports.StaticRouterProvider = _chunkQN64DHI4js.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkEAIF67OWjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkEAIF67OWjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkEAIF67OWjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkEAIF67OWjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkQN64DHI4js.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6
|
|
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-FUSXQSWG.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
|
+
unstable_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,98 @@ type ErrorResponse = {
|
|
|
887
892
|
*/
|
|
888
893
|
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
889
894
|
|
|
895
|
+
/**
|
|
896
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
897
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
898
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
899
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
900
|
+
*/
|
|
901
|
+
interface AppLoadContext {
|
|
902
|
+
[key: string]: unknown;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
type unstable_ServerInstrumentation = {
|
|
906
|
+
handler?: unstable_InstrumentRequestHandlerFunction;
|
|
907
|
+
route?: unstable_InstrumentRouteFunction;
|
|
908
|
+
};
|
|
909
|
+
type unstable_ClientInstrumentation = {
|
|
910
|
+
router?: unstable_InstrumentRouterFunction;
|
|
911
|
+
route?: unstable_InstrumentRouteFunction;
|
|
912
|
+
};
|
|
913
|
+
type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
914
|
+
type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
915
|
+
type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
916
|
+
type unstable_InstrumentationHandlerResult = {
|
|
917
|
+
status: "success";
|
|
918
|
+
error: undefined;
|
|
919
|
+
} | {
|
|
920
|
+
status: "error";
|
|
921
|
+
error: Error;
|
|
922
|
+
};
|
|
923
|
+
type InstrumentFunction<T> = (handler: () => Promise<unstable_InstrumentationHandlerResult>, info: T) => Promise<void>;
|
|
924
|
+
type ReadonlyRequest = {
|
|
925
|
+
method: string;
|
|
926
|
+
url: string;
|
|
927
|
+
headers: Pick<Headers, "get">;
|
|
928
|
+
};
|
|
929
|
+
type ReadonlyContext = MiddlewareEnabled extends true ? Pick<RouterContextProvider, "get"> : Readonly<AppLoadContext>;
|
|
930
|
+
type InstrumentableRoute = {
|
|
931
|
+
id: string;
|
|
932
|
+
index: boolean | undefined;
|
|
933
|
+
path: string | undefined;
|
|
934
|
+
instrument(instrumentations: RouteInstrumentations): void;
|
|
935
|
+
};
|
|
936
|
+
type RouteInstrumentations = {
|
|
937
|
+
lazy?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
938
|
+
"lazy.loader"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
939
|
+
"lazy.action"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
940
|
+
"lazy.middleware"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
941
|
+
middleware?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
942
|
+
loader?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
943
|
+
action?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
944
|
+
};
|
|
945
|
+
type RouteLazyInstrumentationInfo = undefined;
|
|
946
|
+
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
947
|
+
request: ReadonlyRequest;
|
|
948
|
+
params: LoaderFunctionArgs["params"];
|
|
949
|
+
unstable_pattern: string;
|
|
950
|
+
context: ReadonlyContext;
|
|
951
|
+
}>;
|
|
952
|
+
type InstrumentableRouter = {
|
|
953
|
+
instrument(instrumentations: RouterInstrumentations): void;
|
|
954
|
+
};
|
|
955
|
+
type RouterInstrumentations = {
|
|
956
|
+
navigate?: InstrumentFunction<RouterNavigationInstrumentationInfo>;
|
|
957
|
+
fetch?: InstrumentFunction<RouterFetchInstrumentationInfo>;
|
|
958
|
+
};
|
|
959
|
+
type RouterNavigationInstrumentationInfo = Readonly<{
|
|
960
|
+
to: string | number;
|
|
961
|
+
currentUrl: string;
|
|
962
|
+
formMethod?: HTMLFormMethod;
|
|
963
|
+
formEncType?: FormEncType;
|
|
964
|
+
formData?: FormData;
|
|
965
|
+
body?: any;
|
|
966
|
+
}>;
|
|
967
|
+
type RouterFetchInstrumentationInfo = Readonly<{
|
|
968
|
+
href: string;
|
|
969
|
+
currentUrl: string;
|
|
970
|
+
fetcherKey: string;
|
|
971
|
+
formMethod?: HTMLFormMethod;
|
|
972
|
+
formEncType?: FormEncType;
|
|
973
|
+
formData?: FormData;
|
|
974
|
+
body?: any;
|
|
975
|
+
}>;
|
|
976
|
+
type InstrumentableRequestHandler = {
|
|
977
|
+
instrument(instrumentations: RequestHandlerInstrumentations): void;
|
|
978
|
+
};
|
|
979
|
+
type RequestHandlerInstrumentations = {
|
|
980
|
+
request?: InstrumentFunction<RequestHandlerInstrumentationInfo>;
|
|
981
|
+
};
|
|
982
|
+
type RequestHandlerInstrumentationInfo = Readonly<{
|
|
983
|
+
request: ReadonlyRequest;
|
|
984
|
+
context: ReadonlyContext | undefined;
|
|
985
|
+
}>;
|
|
986
|
+
|
|
890
987
|
/**
|
|
891
988
|
* A Router instance manages all navigation and data loading/mutations
|
|
892
989
|
*/
|
|
@@ -1171,6 +1268,7 @@ interface RouterInit {
|
|
|
1171
1268
|
history: History;
|
|
1172
1269
|
basename?: string;
|
|
1173
1270
|
getContext?: () => MaybePromise<RouterContextProvider>;
|
|
1271
|
+
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
1174
1272
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1175
1273
|
future?: Partial<FutureConfig>;
|
|
1176
1274
|
hydrationRouteProperties?: string[];
|
|
@@ -1437,6 +1535,7 @@ type BlockerFunction = (args: {
|
|
|
1437
1535
|
interface CreateStaticHandlerOptions {
|
|
1438
1536
|
basename?: string;
|
|
1439
1537
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1538
|
+
unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
|
|
1440
1539
|
future?: {};
|
|
1441
1540
|
}
|
|
1442
1541
|
declare function createStaticHandler(routes: AgnosticRouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
|
|
@@ -1807,6 +1906,11 @@ type ClientDataFunctionArgs<Params> = {
|
|
|
1807
1906
|
* }
|
|
1808
1907
|
**/
|
|
1809
1908
|
params: Params;
|
|
1909
|
+
/**
|
|
1910
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
1911
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
1912
|
+
*/
|
|
1913
|
+
unstable_pattern: string;
|
|
1810
1914
|
/**
|
|
1811
1915
|
* When `future.v8_middleware` is not enabled, this is undefined.
|
|
1812
1916
|
*
|
|
@@ -1860,7 +1964,7 @@ interface HeadersFunction {
|
|
|
1860
1964
|
* A function that defines `<link>` tags to be inserted into the `<head>` of
|
|
1861
1965
|
* the document on route transitions.
|
|
1862
1966
|
*
|
|
1863
|
-
* @see https://
|
|
1967
|
+
* @see https://reactrouter.com/start/framework/route-module#meta
|
|
1864
1968
|
*/
|
|
1865
1969
|
interface LinksFunction {
|
|
1866
1970
|
(): LinkDescriptor[];
|
|
@@ -1973,7 +2077,7 @@ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
|
|
1973
2077
|
/**
|
|
1974
2078
|
* An arbitrary object that is associated with a route.
|
|
1975
2079
|
*
|
|
1976
|
-
* @see https://
|
|
2080
|
+
* @see https://reactrouter.com/how-to/using-handle
|
|
1977
2081
|
*/
|
|
1978
2082
|
type RouteHandle = unknown;
|
|
1979
2083
|
|
|
@@ -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
|
+
unstable_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,98 @@ type ErrorResponse = {
|
|
|
887
892
|
*/
|
|
888
893
|
declare function isRouteErrorResponse(error: any): error is ErrorResponse;
|
|
889
894
|
|
|
895
|
+
/**
|
|
896
|
+
* An object of unknown type for route loaders and actions provided by the
|
|
897
|
+
* server's `getLoadContext()` function. This is defined as an empty interface
|
|
898
|
+
* specifically so apps can leverage declaration merging to augment this type
|
|
899
|
+
* globally: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
900
|
+
*/
|
|
901
|
+
interface AppLoadContext {
|
|
902
|
+
[key: string]: unknown;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
type unstable_ServerInstrumentation = {
|
|
906
|
+
handler?: unstable_InstrumentRequestHandlerFunction;
|
|
907
|
+
route?: unstable_InstrumentRouteFunction;
|
|
908
|
+
};
|
|
909
|
+
type unstable_ClientInstrumentation = {
|
|
910
|
+
router?: unstable_InstrumentRouterFunction;
|
|
911
|
+
route?: unstable_InstrumentRouteFunction;
|
|
912
|
+
};
|
|
913
|
+
type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
914
|
+
type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
915
|
+
type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
916
|
+
type unstable_InstrumentationHandlerResult = {
|
|
917
|
+
status: "success";
|
|
918
|
+
error: undefined;
|
|
919
|
+
} | {
|
|
920
|
+
status: "error";
|
|
921
|
+
error: Error;
|
|
922
|
+
};
|
|
923
|
+
type InstrumentFunction<T> = (handler: () => Promise<unstable_InstrumentationHandlerResult>, info: T) => Promise<void>;
|
|
924
|
+
type ReadonlyRequest = {
|
|
925
|
+
method: string;
|
|
926
|
+
url: string;
|
|
927
|
+
headers: Pick<Headers, "get">;
|
|
928
|
+
};
|
|
929
|
+
type ReadonlyContext = MiddlewareEnabled extends true ? Pick<RouterContextProvider, "get"> : Readonly<AppLoadContext>;
|
|
930
|
+
type InstrumentableRoute = {
|
|
931
|
+
id: string;
|
|
932
|
+
index: boolean | undefined;
|
|
933
|
+
path: string | undefined;
|
|
934
|
+
instrument(instrumentations: RouteInstrumentations): void;
|
|
935
|
+
};
|
|
936
|
+
type RouteInstrumentations = {
|
|
937
|
+
lazy?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
938
|
+
"lazy.loader"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
939
|
+
"lazy.action"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
940
|
+
"lazy.middleware"?: InstrumentFunction<RouteLazyInstrumentationInfo>;
|
|
941
|
+
middleware?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
942
|
+
loader?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
943
|
+
action?: InstrumentFunction<RouteHandlerInstrumentationInfo>;
|
|
944
|
+
};
|
|
945
|
+
type RouteLazyInstrumentationInfo = undefined;
|
|
946
|
+
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
947
|
+
request: ReadonlyRequest;
|
|
948
|
+
params: LoaderFunctionArgs["params"];
|
|
949
|
+
unstable_pattern: string;
|
|
950
|
+
context: ReadonlyContext;
|
|
951
|
+
}>;
|
|
952
|
+
type InstrumentableRouter = {
|
|
953
|
+
instrument(instrumentations: RouterInstrumentations): void;
|
|
954
|
+
};
|
|
955
|
+
type RouterInstrumentations = {
|
|
956
|
+
navigate?: InstrumentFunction<RouterNavigationInstrumentationInfo>;
|
|
957
|
+
fetch?: InstrumentFunction<RouterFetchInstrumentationInfo>;
|
|
958
|
+
};
|
|
959
|
+
type RouterNavigationInstrumentationInfo = Readonly<{
|
|
960
|
+
to: string | number;
|
|
961
|
+
currentUrl: string;
|
|
962
|
+
formMethod?: HTMLFormMethod;
|
|
963
|
+
formEncType?: FormEncType;
|
|
964
|
+
formData?: FormData;
|
|
965
|
+
body?: any;
|
|
966
|
+
}>;
|
|
967
|
+
type RouterFetchInstrumentationInfo = Readonly<{
|
|
968
|
+
href: string;
|
|
969
|
+
currentUrl: string;
|
|
970
|
+
fetcherKey: string;
|
|
971
|
+
formMethod?: HTMLFormMethod;
|
|
972
|
+
formEncType?: FormEncType;
|
|
973
|
+
formData?: FormData;
|
|
974
|
+
body?: any;
|
|
975
|
+
}>;
|
|
976
|
+
type InstrumentableRequestHandler = {
|
|
977
|
+
instrument(instrumentations: RequestHandlerInstrumentations): void;
|
|
978
|
+
};
|
|
979
|
+
type RequestHandlerInstrumentations = {
|
|
980
|
+
request?: InstrumentFunction<RequestHandlerInstrumentationInfo>;
|
|
981
|
+
};
|
|
982
|
+
type RequestHandlerInstrumentationInfo = Readonly<{
|
|
983
|
+
request: ReadonlyRequest;
|
|
984
|
+
context: ReadonlyContext | undefined;
|
|
985
|
+
}>;
|
|
986
|
+
|
|
890
987
|
/**
|
|
891
988
|
* A Router instance manages all navigation and data loading/mutations
|
|
892
989
|
*/
|
|
@@ -1171,6 +1268,7 @@ interface RouterInit {
|
|
|
1171
1268
|
history: History;
|
|
1172
1269
|
basename?: string;
|
|
1173
1270
|
getContext?: () => MaybePromise<RouterContextProvider>;
|
|
1271
|
+
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
1174
1272
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1175
1273
|
future?: Partial<FutureConfig>;
|
|
1176
1274
|
hydrationRouteProperties?: string[];
|
|
@@ -1437,6 +1535,7 @@ type BlockerFunction = (args: {
|
|
|
1437
1535
|
interface CreateStaticHandlerOptions {
|
|
1438
1536
|
basename?: string;
|
|
1439
1537
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
1538
|
+
unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
|
|
1440
1539
|
future?: {};
|
|
1441
1540
|
}
|
|
1442
1541
|
declare function createStaticHandler(routes: AgnosticRouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
|
|
@@ -1807,6 +1906,11 @@ type ClientDataFunctionArgs<Params> = {
|
|
|
1807
1906
|
* }
|
|
1808
1907
|
**/
|
|
1809
1908
|
params: Params;
|
|
1909
|
+
/**
|
|
1910
|
+
* Matched un-interpolated route pattern for the current path (i.e., /blog/:slug).
|
|
1911
|
+
* Mostly useful as a identifier to aggregate on for logging/tracing/etc.
|
|
1912
|
+
*/
|
|
1913
|
+
unstable_pattern: string;
|
|
1810
1914
|
/**
|
|
1811
1915
|
* When `future.v8_middleware` is not enabled, this is undefined.
|
|
1812
1916
|
*
|
|
@@ -1860,7 +1964,7 @@ interface HeadersFunction {
|
|
|
1860
1964
|
* A function that defines `<link>` tags to be inserted into the `<head>` of
|
|
1861
1965
|
* the document on route transitions.
|
|
1862
1966
|
*
|
|
1863
|
-
* @see https://
|
|
1967
|
+
* @see https://reactrouter.com/start/framework/route-module#meta
|
|
1864
1968
|
*/
|
|
1865
1969
|
interface LinksFunction {
|
|
1866
1970
|
(): LinkDescriptor[];
|
|
@@ -1973,7 +2077,7 @@ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
|
|
1973
2077
|
/**
|
|
1974
2078
|
* An arbitrary object that is associated with a route.
|
|
1975
2079
|
*
|
|
1976
|
-
* @see https://
|
|
2080
|
+
* @see https://reactrouter.com/how-to/using-handle
|
|
1977
2081
|
*/
|
|
1978
2082
|
type RouteHandle = unknown;
|
|
1979
2083
|
|