react-router 7.14.2 → 7.15.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 +99 -0
- package/dist/development/{browser-I6n6wVSO.d.mts → browser-3AnU12UI.d.mts} +2 -2
- package/dist/{production/browser-I6n6wVSO.d.mts → development/browser-BOdXz9dK.d.ts} +2 -2
- package/dist/development/{chunk-EVOBXE3Y.mjs → chunk-4N6VE7H7.mjs} +567 -317
- package/dist/{production/chunk-PQL4HLVQ.js → development/chunk-4YRVXM2U.js} +7 -7
- package/dist/{production/chunk-UJQ4OJF4.js → development/chunk-66UKHEGQ.js} +153 -143
- package/dist/development/{chunk-ZZNWZ5Q3.js → chunk-D6LUOGOQ.js} +550 -310
- package/dist/development/{chunk-YQSHRJWW.mjs → chunk-RJYABSBD.mjs} +100 -80
- package/dist/{production/context-DGGUoDIu.d.mts → development/context-ByvtofY2.d.mts} +100 -42
- package/dist/development/{routeModules-7rtk67cd.d.ts → data-BVUf681J.d.mts} +64 -46
- package/dist/development/{routeModules-BW4a8k3I.d.mts → data-BqZ2x964.d.ts} +64 -46
- package/dist/development/dom-export.d.mts +8 -8
- package/dist/development/dom-export.d.ts +8 -8
- package/dist/development/dom-export.js +57 -62
- package/dist/development/dom-export.mjs +32 -37
- package/dist/{production/index-react-server-client-BBd0A0TL.d.ts → development/index-react-server-client-BS5F89FR.d.ts} +132 -122
- package/dist/{production/index-react-server-client-BjhKIe3u.d.mts → development/index-react-server-client-DY04-103.d.mts} +111 -101
- 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 +113 -36
- package/dist/development/index-react-server.d.ts +113 -36
- package/dist/development/index-react-server.js +63 -36
- package/dist/development/index-react-server.mjs +63 -36
- package/dist/development/index.d.mts +94 -12
- package/dist/development/index.d.ts +94 -12
- package/dist/development/index.js +193 -171
- package/dist/development/index.mjs +5 -3
- package/dist/{production/instrumentation-g0dG8UL0.d.ts → development/instrumentation-cRWWLfsU.d.ts} +79 -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-DcBltf5q.d.ts → register-Bsscfj79.d.ts} +1 -1
- package/dist/{production/register-DcBltf5q.d.ts → development/register-Df8okEea.d.mts} +1 -1
- package/dist/production/{browser-C-UvoYvi.d.ts → browser-3AnU12UI.d.mts} +2 -2
- package/dist/{development/browser-C-UvoYvi.d.ts → production/browser-BOdXz9dK.d.ts} +2 -2
- package/dist/production/{chunk-2WLZNCK5.mjs → chunk-6S4627ZB.mjs} +100 -80
- package/dist/production/{chunk-X5SKXJ4A.js → chunk-HUBUW7R3.js} +550 -310
- package/dist/production/{chunk-LK6U7ULH.mjs → chunk-JAKZPQZC.mjs} +567 -317
- package/dist/{development/chunk-YZKCRDTN.js → production/chunk-PNZCCTKT.js} +153 -143
- package/dist/{development/chunk-PZFPF4X7.js → production/chunk-Y6IFXO7V.js} +7 -7
- package/dist/{development/context-DGGUoDIu.d.mts → production/context-ByvtofY2.d.mts} +100 -42
- package/dist/production/{routeModules-7rtk67cd.d.ts → data-BVUf681J.d.mts} +64 -46
- package/dist/production/{routeModules-BW4a8k3I.d.mts → data-BqZ2x964.d.ts} +64 -46
- package/dist/production/dom-export.d.mts +8 -8
- package/dist/production/dom-export.d.ts +8 -8
- package/dist/production/dom-export.js +57 -62
- package/dist/production/dom-export.mjs +32 -37
- package/dist/{development/index-react-server-client-BBd0A0TL.d.ts → production/index-react-server-client-BS5F89FR.d.ts} +132 -122
- package/dist/{development/index-react-server-client-BjhKIe3u.d.mts → production/index-react-server-client-DY04-103.d.mts} +111 -101
- 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 +113 -36
- package/dist/production/index-react-server.d.ts +113 -36
- package/dist/production/index-react-server.js +63 -36
- package/dist/production/index-react-server.mjs +63 -36
- package/dist/production/index.d.mts +94 -12
- package/dist/production/index.d.ts +94 -12
- package/dist/production/index.js +193 -171
- package/dist/production/index.mjs +5 -3
- package/dist/{development/instrumentation-g0dG8UL0.d.ts → production/instrumentation-cRWWLfsU.d.ts} +79 -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-D9d2sMQ7.d.mts → production/register-Bsscfj79.d.ts} +1 -1
- package/dist/production/{register-D9d2sMQ7.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.1
|
|
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-6S4627ZB.mjs";
|
|
32
32
|
import {
|
|
33
33
|
Action,
|
|
34
34
|
Await,
|
|
@@ -133,6 +133,7 @@ import {
|
|
|
133
133
|
useRoute,
|
|
134
134
|
useRouteError,
|
|
135
135
|
useRouteLoaderData,
|
|
136
|
+
useRouterState,
|
|
136
137
|
useRoutes,
|
|
137
138
|
useScrollRestoration,
|
|
138
139
|
useSearchParams,
|
|
@@ -141,7 +142,7 @@ import {
|
|
|
141
142
|
withComponentProps,
|
|
142
143
|
withErrorBoundaryProps,
|
|
143
144
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-JAKZPQZC.mjs";
|
|
145
146
|
export {
|
|
146
147
|
Await,
|
|
147
148
|
BrowserRouter,
|
|
@@ -243,6 +244,7 @@ export {
|
|
|
243
244
|
setDevServerHooks as unstable_setDevServerHooks,
|
|
244
245
|
usePrompt as unstable_usePrompt,
|
|
245
246
|
useRoute as unstable_useRoute,
|
|
247
|
+
useRouterState as unstable_useRouterState,
|
|
246
248
|
useActionData,
|
|
247
249
|
useAsyncError,
|
|
248
250
|
useAsyncValue,
|
package/dist/{development/instrumentation-g0dG8UL0.d.ts → production/instrumentation-cRWWLfsU.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;
|
|
@@ -428,6 +480,8 @@ type NavigationStates = {
|
|
|
428
480
|
Idle: {
|
|
429
481
|
state: "idle";
|
|
430
482
|
location: undefined;
|
|
483
|
+
matches: undefined;
|
|
484
|
+
historyAction: undefined;
|
|
431
485
|
formMethod: undefined;
|
|
432
486
|
formAction: undefined;
|
|
433
487
|
formEncType: undefined;
|
|
@@ -438,6 +492,8 @@ type NavigationStates = {
|
|
|
438
492
|
Loading: {
|
|
439
493
|
state: "loading";
|
|
440
494
|
location: Location;
|
|
495
|
+
matches: DataRouteMatch[];
|
|
496
|
+
historyAction: Action;
|
|
441
497
|
formMethod: Submission["formMethod"] | undefined;
|
|
442
498
|
formAction: Submission["formAction"] | undefined;
|
|
443
499
|
formEncType: Submission["formEncType"] | undefined;
|
|
@@ -448,6 +504,8 @@ type NavigationStates = {
|
|
|
448
504
|
Submitting: {
|
|
449
505
|
state: "submitting";
|
|
450
506
|
location: Location;
|
|
507
|
+
matches: DataRouteMatch[];
|
|
508
|
+
historyAction: Action;
|
|
451
509
|
formMethod: Submission["formMethod"];
|
|
452
510
|
formAction: Submission["formAction"];
|
|
453
511
|
formEncType: Submission["formEncType"];
|
|
@@ -568,29 +626,29 @@ declare function createRouter(init: RouterInit): Router;
|
|
|
568
626
|
interface CreateStaticHandlerOptions {
|
|
569
627
|
basename?: string;
|
|
570
628
|
mapRouteProperties?: MapRoutePropertiesFunction;
|
|
571
|
-
|
|
629
|
+
instrumentations?: Pick<ServerInstrumentation, "route">[];
|
|
572
630
|
future?: Partial<FutureConfig>;
|
|
573
631
|
}
|
|
574
632
|
|
|
575
|
-
type
|
|
576
|
-
handler?:
|
|
577
|
-
route?:
|
|
633
|
+
type ServerInstrumentation = {
|
|
634
|
+
handler?: InstrumentRequestHandlerFunction;
|
|
635
|
+
route?: InstrumentRouteFunction;
|
|
578
636
|
};
|
|
579
|
-
type
|
|
580
|
-
router?:
|
|
581
|
-
route?:
|
|
637
|
+
type ClientInstrumentation = {
|
|
638
|
+
router?: InstrumentRouterFunction;
|
|
639
|
+
route?: InstrumentRouteFunction;
|
|
582
640
|
};
|
|
583
|
-
type
|
|
584
|
-
type
|
|
585
|
-
type
|
|
586
|
-
type
|
|
641
|
+
type InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
|
|
642
|
+
type InstrumentRouterFunction = (router: InstrumentableRouter) => void;
|
|
643
|
+
type InstrumentRouteFunction = (route: InstrumentableRoute) => void;
|
|
644
|
+
type InstrumentationHandlerResult = {
|
|
587
645
|
status: "success";
|
|
588
646
|
error: undefined;
|
|
589
647
|
} | {
|
|
590
648
|
status: "error";
|
|
591
649
|
error: Error;
|
|
592
650
|
};
|
|
593
|
-
type InstrumentFunction<T> = (handler: () => Promise<
|
|
651
|
+
type InstrumentFunction<T> = (handler: () => Promise<InstrumentationHandlerResult>, info: T) => Promise<void>;
|
|
594
652
|
type ReadonlyRequest = {
|
|
595
653
|
method: string;
|
|
596
654
|
url: string;
|
|
@@ -616,7 +674,7 @@ type RouteLazyInstrumentationInfo = undefined;
|
|
|
616
674
|
type RouteHandlerInstrumentationInfo = Readonly<{
|
|
617
675
|
request: ReadonlyRequest;
|
|
618
676
|
params: LoaderFunctionArgs["params"];
|
|
619
|
-
|
|
677
|
+
pattern: string;
|
|
620
678
|
context: ReadonlyContext;
|
|
621
679
|
}>;
|
|
622
680
|
type InstrumentableRouter = {
|
|
@@ -654,4 +712,4 @@ type RequestHandlerInstrumentationInfo = Readonly<{
|
|
|
654
712
|
context: ReadonlyContext | undefined;
|
|
655
713
|
}>;
|
|
656
714
|
|
|
657
|
-
export { type BlockerFunction as B, type
|
|
715
|
+
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 NavigationStates as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type Navigation as d, type RouterState as e, type GetScrollRestorationKeyFunction as f, type StaticHandlerContext 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>;
|