react-router 7.14.1 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/dist/development/{browser-D-3-U2Jj.d.mts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{production/browser-D-3-U2Jj.d.mts → development/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/{production/chunk-3SUPTI2U.js → development/chunk-2D5H3HU3.js} +7 -7
- package/dist/development/{chunk-OE4NN4TA.mjs → chunk-5KNZJZUH.mjs} +362 -213
- package/dist/development/{chunk-YMKMFAYZ.js → chunk-AM3XM4LS.js} +314 -172
- package/dist/development/{chunk-BFXCU3MI.mjs → chunk-RMD3H4O3.mjs} +81 -62
- package/dist/development/{chunk-3F6IB66O.js → chunk-Z5YQYACE.js} +146 -139
- package/dist/{production/context-BzhbVly6.d.mts → development/context-BQs41HrG.d.mts} +94 -42
- package/dist/development/{routeModules-CM_clkdE.d.ts → data-BVUf681J.d.mts} +89 -56
- package/dist/{production/routeModules-CM_clkdE.d.ts → development/data-BqZ2x964.d.ts} +79 -46
- package/dist/development/dom-export.d.mts +9 -9
- package/dist/development/dom-export.d.ts +9 -9
- package/dist/development/dom-export.js +37 -40
- package/dist/development/dom-export.mjs +12 -15
- package/dist/development/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{production/index-react-server-client-WSaoxloq.d.mts → development/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -3
- 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 -36
- package/dist/development/index-react-server.d.ts +107 -36
- package/dist/development/index-react-server.js +60 -33
- package/dist/development/index-react-server.mjs +60 -33
- package/dist/development/index.d.mts +11 -11
- package/dist/development/index.d.ts +11 -11
- package/dist/development/index.js +174 -155
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-CMVbvxj9.d.ts → development/instrumentation-DlJ2QV7d.d.ts} +73 -21
- package/dist/development/lib/types/internal.d.mts +2 -2
- 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/development/{register-D1WlEpq9.d.ts → register-Bsscfj79.d.ts} +1 -1
- package/dist/{production/register-D1WlEpq9.d.ts → development/register-Df8okEea.d.mts} +1 -1
- package/dist/production/{browser-CtktEGQs.d.ts → browser-CRsXgNrY.d.mts} +2 -2
- package/dist/{development/browser-CtktEGQs.d.ts → production/browser-wDl1FZEL.d.ts} +2 -2
- package/dist/production/{chunk-G5ZWO7Q6.mjs → chunk-23ZOHYE5.mjs} +81 -62
- package/dist/{development/chunk-7VLQJKNG.js → production/chunk-7YXKJMLN.js} +7 -7
- package/dist/production/{chunk-SPR7R4GU.mjs → chunk-GM3PW4GX.mjs} +362 -213
- package/dist/production/{chunk-UVEQGZIH.js → chunk-LCJTIOKZ.js} +314 -172
- package/dist/production/{chunk-LIOP3ILM.js → chunk-YBQJ3ABE.js} +146 -139
- package/dist/{development/context-BzhbVly6.d.mts → production/context-BQs41HrG.d.mts} +94 -42
- package/dist/{development/routeModules-Djumx26z.d.mts → production/data-BVUf681J.d.mts} +79 -46
- package/dist/production/{routeModules-Djumx26z.d.mts → data-BqZ2x964.d.ts} +89 -56
- package/dist/production/dom-export.d.mts +9 -9
- package/dist/production/dom-export.d.ts +9 -9
- package/dist/production/dom-export.js +37 -40
- package/dist/production/dom-export.mjs +12 -15
- package/dist/production/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
- package/dist/{development/index-react-server-client-WSaoxloq.d.mts → production/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -3
- 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 -36
- package/dist/production/index-react-server.d.ts +107 -36
- package/dist/production/index-react-server.js +60 -33
- package/dist/production/index-react-server.mjs +60 -33
- package/dist/production/index.d.mts +11 -11
- package/dist/production/index.d.ts +11 -11
- package/dist/production/index.js +174 -155
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-CMVbvxj9.d.ts → production/instrumentation-DlJ2QV7d.d.ts} +73 -21
- package/dist/production/lib/types/internal.d.mts +2 -2
- 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-aE9ob3TK.d.mts → production/register-Bsscfj79.d.ts} +1 -1
- package/dist/production/{register-aE9ob3TK.d.mts → register-Df8okEea.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.15.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isSession,
|
|
29
29
|
routeRSCServerRequest,
|
|
30
30
|
setDevServerHooks
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-23ZOHYE5.mjs";
|
|
32
32
|
import {
|
|
33
33
|
Action,
|
|
34
34
|
Await,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
withComponentProps,
|
|
142
142
|
withErrorBoundaryProps,
|
|
143
143
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-GM3PW4GX.mjs";
|
|
145
145
|
export {
|
|
146
146
|
Await,
|
|
147
147
|
BrowserRouter,
|
package/dist/{development/instrumentation-CMVbvxj9.d.ts → production/instrumentation-DlJ2QV7d.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, U as UIMatch, T as To,
|
|
1
|
+
import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, o as RouteBranch, p as RouteManifest, U as UIMatch, T as To, q as HTMLFormMethod, F as FormEncType, r as Path, s as LoaderFunctionArgs, t as MiddlewareEnabled, u as AppLoadContext } from './data-BqZ2x964.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A Router instance manages all navigation and data loading/mutations
|
|
@@ -32,6 +32,20 @@ interface Router {
|
|
|
32
32
|
* Return the routes for this router instance
|
|
33
33
|
*/
|
|
34
34
|
get routes(): DataRouteObject[];
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
* PRIVATE - DO NOT USE
|
|
38
|
+
*
|
|
39
|
+
* Return the route branches for this router instance
|
|
40
|
+
*/
|
|
41
|
+
get branches(): RouteBranch<DataRouteObject>[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* PRIVATE - DO NOT USE
|
|
45
|
+
*
|
|
46
|
+
* Return the manifest for this router instance
|
|
47
|
+
*/
|
|
48
|
+
get manifest(): RouteManifest;
|
|
35
49
|
/**
|
|
36
50
|
* @private
|
|
37
51
|
* PRIVATE - DO NOT USE
|
|
@@ -279,7 +293,6 @@ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "e
|
|
|
279
293
|
* Future flags to toggle new feature behavior
|
|
280
294
|
*/
|
|
281
295
|
interface FutureConfig {
|
|
282
|
-
unstable_passThroughRequests: boolean;
|
|
283
296
|
}
|
|
284
297
|
/**
|
|
285
298
|
* Initialization options for createRouter
|
|
@@ -289,7 +302,7 @@ interface RouterInit {
|
|
|
289
302
|
history: History;
|
|
290
303
|
basename?: string;
|
|
291
304
|
getContext?: () => MaybePromise<RouterContextProvider>;
|
|
292
|
-
|
|
305
|
+
instrumentations?: ClientInstrumentation[];
|
|
293
306
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
294
307
|
future?: Partial<FutureConfig>;
|
|
295
308
|
hydrationRouteProperties?: string[];
|
|
@@ -317,7 +330,33 @@ interface StaticHandlerContext {
|
|
|
317
330
|
* A StaticHandler instance manages a singular SSR navigation/fetch event
|
|
318
331
|
*/
|
|
319
332
|
interface StaticHandler {
|
|
333
|
+
/**
|
|
334
|
+
* The set of data routes managed by this handler
|
|
335
|
+
*/
|
|
320
336
|
dataRoutes: DataRouteObject[];
|
|
337
|
+
/**
|
|
338
|
+
* @private
|
|
339
|
+
* PRIVATE - DO NOT USE
|
|
340
|
+
*
|
|
341
|
+
* The route branches derived from the data routes, used for internal route
|
|
342
|
+
* matching in Framework Mode
|
|
343
|
+
*/
|
|
344
|
+
_internalRouteBranches: RouteBranch<DataRouteObject>[];
|
|
345
|
+
/**
|
|
346
|
+
* Perform a query for a given request - executing all matched route
|
|
347
|
+
* loaders/actions. Used for document requests.
|
|
348
|
+
*
|
|
349
|
+
* @param request The request to query
|
|
350
|
+
* @param opts Optional query options
|
|
351
|
+
* @param opts.dataStrategy Alternate dataStrategy implementation
|
|
352
|
+
* @param opts.filterMatchesToLoad Predicate function to filter which matches should be loaded
|
|
353
|
+
* @param opts.generateMiddlewareResponse To enable middleware, provide a function
|
|
354
|
+
* to generate a response to bubble back up the middleware chain
|
|
355
|
+
* @param opts.requestContext Context object to pass to loaders/actions
|
|
356
|
+
* @param opts.skipLoaderErrorBubbling Skip loader error bubbling
|
|
357
|
+
* @param opts.skipRevalidation Skip revalidation after action submission
|
|
358
|
+
* @param opts.normalizePath Normalize the request path
|
|
359
|
+
*/
|
|
321
360
|
query(request: Request, opts?: {
|
|
322
361
|
requestContext?: unknown;
|
|
323
362
|
filterMatchesToLoad?: (match: DataRouteMatch) => boolean;
|
|
@@ -327,14 +366,27 @@ interface StaticHandler {
|
|
|
327
366
|
generateMiddlewareResponse?: (query: (r: Request, args?: {
|
|
328
367
|
filterMatchesToLoad?: (match: DataRouteMatch) => boolean;
|
|
329
368
|
}) => Promise<StaticHandlerContext | Response>) => MaybePromise<Response>;
|
|
330
|
-
|
|
369
|
+
normalizePath?: (request: Request) => Path;
|
|
331
370
|
}): Promise<StaticHandlerContext | Response>;
|
|
371
|
+
/**
|
|
372
|
+
* Perform a query for a specific route. Used for resource requests.
|
|
373
|
+
*
|
|
374
|
+
* @param request The request to query
|
|
375
|
+
* @param opts Optional queryRoute options
|
|
376
|
+
* @param opts.dataStrategy Alternate dataStrategy implementation
|
|
377
|
+
* @param opts.generateMiddlewareResponse To enable middleware, provide a function
|
|
378
|
+
* to generate a response to bubble back up the middleware chain
|
|
379
|
+
* @param opts.requestContext Context object to pass to loaders/actions
|
|
380
|
+
* @param opts.routeId The ID of the route to query
|
|
381
|
+
* @param opts.normalizePath Normalize the request path
|
|
382
|
+
|
|
383
|
+
*/
|
|
332
384
|
queryRoute(request: Request, opts?: {
|
|
333
385
|
routeId?: string;
|
|
334
386
|
requestContext?: unknown;
|
|
335
387
|
dataStrategy?: DataStrategyFunction<unknown>;
|
|
336
388
|
generateMiddlewareResponse?: (queryRoute: (r: Request) => Promise<Response>) => MaybePromise<Response>;
|
|
337
|
-
|
|
389
|
+
normalizePath?: (request: Request) => Path;
|
|
338
390
|
}): Promise<any>;
|
|
339
391
|
}
|
|
340
392
|
type ViewTransitionOpts = {
|
|
@@ -378,14 +430,14 @@ type BaseNavigateOrFetchOptions = {
|
|
|
378
430
|
preventScrollReset?: boolean;
|
|
379
431
|
relative?: RelativeRoutingType;
|
|
380
432
|
flushSync?: boolean;
|
|
381
|
-
|
|
433
|
+
defaultShouldRevalidate?: boolean;
|
|
382
434
|
};
|
|
383
435
|
type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
|
|
384
436
|
replace?: boolean;
|
|
385
437
|
state?: any;
|
|
386
438
|
fromRouteId?: string;
|
|
387
439
|
viewTransition?: boolean;
|
|
388
|
-
|
|
440
|
+
mask?: To;
|
|
389
441
|
};
|
|
390
442
|
type BaseSubmissionOptions = {
|
|
391
443
|
formMethod?: HTMLFormMethod;
|
|
@@ -568,29 +620,29 @@ declare function createRouter(init: RouterInit): Router;
|
|
|
568
620
|
interface CreateStaticHandlerOptions {
|
|
569
621
|
basename?: string;
|
|
570
622
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
571
|
-
|
|
623
|
+
instrumentations?: Pick<ServerInstrumentation, "route">[];
|
|
572
624
|
future?: Partial<FutureConfig>;
|
|
573
625
|
}
|
|
574
626
|
|
|
575
|
-
type
|
|
576
|
-
handler?:
|
|
577
|
-
route?:
|
|
627
|
+
type ServerInstrumentation = {
|
|
628
|
+
handler?: InstrumentRequestHandlerFunction;
|
|
629
|
+
route?: InstrumentRouteFunction;
|
|
578
630
|
};
|
|
579
|
-
type
|
|
580
|
-
router?:
|
|
581
|
-
route?:
|
|
631
|
+
type ClientInstrumentation = {
|
|
632
|
+
router?: InstrumentRouterFunction;
|
|
633
|
+
route?: InstrumentRouteFunction;
|
|
582
634
|
};
|
|
583
|
-
type
|
|
584
|
-
type
|
|
585
|
-
type
|
|
586
|
-
type
|
|
635
|
+
type InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
636
|
+
type InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
637
|
+
type InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
638
|
+
type InstrumentationHandlerResult = {
|
|
587
639
|
status: "success";
|
|
588
640
|
error: undefined;
|
|
589
641
|
} | {
|
|
590
642
|
status: "error";
|
|
591
643
|
error: Error;
|
|
592
644
|
};
|
|
593
|
-
type InstrumentFunction<T> = (handler: () => Promise<
|
|
645
|
+
type InstrumentFunction<T> = (handler: () => Promise<InstrumentationHandlerResult>, info: T) => Promise<void>;
|
|
594
646
|
type ReadonlyRequest = {
|
|
595
647
|
method: string;
|
|
596
648
|
url: string;
|
|
@@ -616,7 +668,7 @@ type RouteLazyInstrumentationInfo = undefined;
|
|
|
616
668
|
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
617
669
|
request: ReadonlyRequest;
|
|
618
670
|
params: LoaderFunctionArgs["params"];
|
|
619
|
-
|
|
671
|
+
pattern: string;
|
|
620
672
|
context: ReadonlyContext;
|
|
621
673
|
}>;
|
|
622
674
|
type InstrumentableRouter = {
|
|
@@ -654,4 +706,4 @@ type RequestHandlerInstrumentationInfo = Readonly<{
|
|
|
654
706
|
context: ReadonlyContext | undefined;
|
|
655
707
|
}>;
|
|
656
708
|
|
|
657
|
-
export { type BlockerFunction as B, type
|
|
709
|
+
export { type BlockerFunction as B, type ClientInstrumentation as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, type InstrumentRequestHandlerFunction as I, type Navigation as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type RouterState as d, type GetScrollRestorationKeyFunction as e, type StaticHandlerContext as f, type NavigationStates as g, type RouterSubscriber as h, type RouterNavigateOptions as i, type RouterFetchOptions as j, type RevalidationState as k, type ServerInstrumentation as l, type InstrumentRouterFunction as m, type InstrumentRouteFunction as n, type InstrumentationHandlerResult as o, IDLE_NAVIGATION as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type CreateStaticHandlerOptions as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../data-BVUf681J.mjs';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-Df8okEea.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule,
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, v as LinkDescriptor, L as Location, w as Func, x as Pretty, y as MetaDescriptor, G as GetLoaderData, z as ServerDataFunctionArgs, B as MiddlewareNextFunction, E as ClientDataFunctionArgs, I as DataStrategyResult, J as ServerDataFrom, N as Normalize, K as GetActionData } from '../../data-BqZ2x964.js';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-Bsscfj79.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|