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.
Files changed (72) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/dist/development/{browser-D-3-U2Jj.d.mts → browser-CRsXgNrY.d.mts} +2 -2
  3. package/dist/{production/browser-D-3-U2Jj.d.mts → development/browser-wDl1FZEL.d.ts} +2 -2
  4. package/dist/{production/chunk-3SUPTI2U.js → development/chunk-2D5H3HU3.js} +7 -7
  5. package/dist/development/{chunk-OE4NN4TA.mjs → chunk-5KNZJZUH.mjs} +362 -213
  6. package/dist/development/{chunk-YMKMFAYZ.js → chunk-AM3XM4LS.js} +314 -172
  7. package/dist/development/{chunk-BFXCU3MI.mjs → chunk-RMD3H4O3.mjs} +81 -62
  8. package/dist/development/{chunk-3F6IB66O.js → chunk-Z5YQYACE.js} +146 -139
  9. package/dist/{production/context-BzhbVly6.d.mts → development/context-BQs41HrG.d.mts} +94 -42
  10. package/dist/development/{routeModules-CM_clkdE.d.ts → data-BVUf681J.d.mts} +89 -56
  11. package/dist/{production/routeModules-CM_clkdE.d.ts → development/data-BqZ2x964.d.ts} +79 -46
  12. package/dist/development/dom-export.d.mts +9 -9
  13. package/dist/development/dom-export.d.ts +9 -9
  14. package/dist/development/dom-export.js +37 -40
  15. package/dist/development/dom-export.mjs +12 -15
  16. package/dist/development/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
  17. package/dist/{production/index-react-server-client-WSaoxloq.d.mts → development/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
  18. package/dist/development/index-react-server-client.d.mts +3 -3
  19. package/dist/development/index-react-server-client.d.ts +3 -3
  20. package/dist/development/index-react-server-client.js +4 -4
  21. package/dist/development/index-react-server-client.mjs +2 -2
  22. package/dist/development/index-react-server.d.mts +107 -36
  23. package/dist/development/index-react-server.d.ts +107 -36
  24. package/dist/development/index-react-server.js +60 -33
  25. package/dist/development/index-react-server.mjs +60 -33
  26. package/dist/development/index.d.mts +11 -11
  27. package/dist/development/index.d.ts +11 -11
  28. package/dist/development/index.js +174 -155
  29. package/dist/development/index.mjs +3 -3
  30. package/dist/{production/instrumentation-CMVbvxj9.d.ts → development/instrumentation-DlJ2QV7d.d.ts} +73 -21
  31. package/dist/development/lib/types/internal.d.mts +2 -2
  32. package/dist/development/lib/types/internal.d.ts +2 -2
  33. package/dist/development/lib/types/internal.js +1 -1
  34. package/dist/development/lib/types/internal.mjs +1 -1
  35. package/dist/development/{register-D1WlEpq9.d.ts → register-Bsscfj79.d.ts} +1 -1
  36. package/dist/{production/register-D1WlEpq9.d.ts → development/register-Df8okEea.d.mts} +1 -1
  37. package/dist/production/{browser-CtktEGQs.d.ts → browser-CRsXgNrY.d.mts} +2 -2
  38. package/dist/{development/browser-CtktEGQs.d.ts → production/browser-wDl1FZEL.d.ts} +2 -2
  39. package/dist/production/{chunk-G5ZWO7Q6.mjs → chunk-23ZOHYE5.mjs} +81 -62
  40. package/dist/{development/chunk-7VLQJKNG.js → production/chunk-7YXKJMLN.js} +7 -7
  41. package/dist/production/{chunk-SPR7R4GU.mjs → chunk-GM3PW4GX.mjs} +362 -213
  42. package/dist/production/{chunk-UVEQGZIH.js → chunk-LCJTIOKZ.js} +314 -172
  43. package/dist/production/{chunk-LIOP3ILM.js → chunk-YBQJ3ABE.js} +146 -139
  44. package/dist/{development/context-BzhbVly6.d.mts → production/context-BQs41HrG.d.mts} +94 -42
  45. package/dist/{development/routeModules-Djumx26z.d.mts → production/data-BVUf681J.d.mts} +79 -46
  46. package/dist/production/{routeModules-Djumx26z.d.mts → data-BqZ2x964.d.ts} +89 -56
  47. package/dist/production/dom-export.d.mts +9 -9
  48. package/dist/production/dom-export.d.ts +9 -9
  49. package/dist/production/dom-export.js +37 -40
  50. package/dist/production/dom-export.mjs +12 -15
  51. package/dist/production/{index-react-server-client-CimaPp9o.d.ts → index-react-server-client-CSv-KZBk.d.ts} +123 -121
  52. package/dist/{development/index-react-server-client-WSaoxloq.d.mts → production/index-react-server-client-Ck_yZ1qL.d.mts} +102 -100
  53. package/dist/production/index-react-server-client.d.mts +3 -3
  54. package/dist/production/index-react-server-client.d.ts +3 -3
  55. package/dist/production/index-react-server-client.js +4 -4
  56. package/dist/production/index-react-server-client.mjs +2 -2
  57. package/dist/production/index-react-server.d.mts +107 -36
  58. package/dist/production/index-react-server.d.ts +107 -36
  59. package/dist/production/index-react-server.js +60 -33
  60. package/dist/production/index-react-server.mjs +60 -33
  61. package/dist/production/index.d.mts +11 -11
  62. package/dist/production/index.d.ts +11 -11
  63. package/dist/production/index.js +174 -155
  64. package/dist/production/index.mjs +3 -3
  65. package/dist/{development/instrumentation-CMVbvxj9.d.ts → production/instrumentation-DlJ2QV7d.d.ts} +73 -21
  66. package/dist/production/lib/types/internal.d.mts +2 -2
  67. package/dist/production/lib/types/internal.d.ts +2 -2
  68. package/dist/production/lib/types/internal.js +1 -1
  69. package/dist/production/lib/types/internal.mjs +1 -1
  70. package/dist/{development/register-aE9ob3TK.d.mts → production/register-Bsscfj79.d.ts} +1 -1
  71. package/dist/production/{register-aE9ob3TK.d.mts → register-Df8okEea.d.mts} +1 -1
  72. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.14.1
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-G5ZWO7Q6.mjs";
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-SPR7R4GU.mjs";
144
+ } from "./chunk-GM3PW4GX.mjs";
145
145
  export {
146
146
  Await,
147
147
  BrowserRouter,
@@ -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, o as HTMLFormMethod, F as FormEncType, p as Path, q as LoaderFunctionArgs, r as MiddlewareEnabled, s as AppLoadContext } from './routeModules-CM_clkdE.js';
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
- unstable_instrumentations?: unstable_ClientInstrumentation[];
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
- unstable_normalizePath?: (request: Request) => Path;
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
- unstable_normalizePath?: (request: Request) => Path;
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
- unstable_defaultShouldRevalidate?: boolean;
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
- unstable_mask?: To;
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
- unstable_instrumentations?: Pick<unstable_ServerInstrumentation, "route">[];
623
+ instrumentations?: Pick<ServerInstrumentation, "route">[];
572
624
  future?: Partial<FutureConfig>;
573
625
  }
574
626
 
575
- type unstable_ServerInstrumentation = {
576
- handler?: unstable_InstrumentRequestHandlerFunction;
577
- route?: unstable_InstrumentRouteFunction;
627
+ type ServerInstrumentation = {
628
+ handler?: InstrumentRequestHandlerFunction;
629
+ route?: InstrumentRouteFunction;
578
630
  };
579
- type unstable_ClientInstrumentation = {
580
- router?: unstable_InstrumentRouterFunction;
581
- route?: unstable_InstrumentRouteFunction;
631
+ type ClientInstrumentation = {
632
+ router?: InstrumentRouterFunction;
633
+ route?: InstrumentRouteFunction;
582
634
  };
583
- type unstable_InstrumentRequestHandlerFunction = (handler: InstrumentableRequestHandler) => void;
584
- type unstable_InstrumentRouterFunction = (router: InstrumentableRouter) => void;
585
- type unstable_InstrumentRouteFunction = (route: InstrumentableRoute) => void;
586
- type unstable_InstrumentationHandlerResult = {
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<unstable_InstrumentationHandlerResult>, info: T) => Promise<void>;
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
- unstable_pattern: string;
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 CreateStaticHandlerOptions as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, IDLE_NAVIGATION 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 unstable_ServerInstrumentation as l, type unstable_InstrumentRequestHandlerFunction as m, type unstable_InstrumentRouterFunction as n, type unstable_InstrumentRouteFunction as o, type unstable_InstrumentationHandlerResult as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type unstable_ClientInstrumentation as u };
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 '../../routeModules-Djumx26z.mjs';
2
- import { R as RouteFiles, P as Pages } from '../../register-aE9ob3TK.mjs';
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, t as LinkDescriptor, L as Location, u as Func, v as Pretty, w as MetaDescriptor, G as GetLoaderData, x as ServerDataFunctionArgs, y as MiddlewareNextFunction, z as ClientDataFunctionArgs, B as DataStrategyResult, E as ServerDataFrom, N as Normalize, I as GetActionData } from '../../routeModules-CM_clkdE.js';
2
- import { R as RouteFiles, P as Pages } from '../../register-D1WlEpq9.js';
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>;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * react-router v7.14.1
2
+ * react-router v7.15.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.14.1
2
+ * react-router v7.15.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './routeModules-Djumx26z.mjs';
1
+ import { R as RouteModule } from './data-BqZ2x964.js';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './routeModules-Djumx26z.mjs';
1
+ import { R as RouteModule } from './data-BVUf681J.mjs';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.14.1",
3
+ "version": "7.15.0",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",