react-router 7.0.0 → 7.0.1-pre.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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.0.1-pre.0
4
+
3
5
  ## 7.0.0
4
6
 
5
7
  ### Major Changes
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
- # React Router
1
+ `react-router` is the primary package in the React Router project.
2
2
 
3
- The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all the core functionality.
3
+ ## Installation
4
+
5
+ ```sh
6
+ npm i react-router
7
+ ```
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4214,7 +4214,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4214
4214
  let parentPath = parentRoute && parentRoute.path || "";
4215
4215
  warningOnce(
4216
4216
  parentPathname,
4217
- !parentRoute || parentPath.endsWith("*"),
4217
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
4218
4218
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4219
4219
 
4220
4220
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -6980,7 +6980,7 @@ function mergeRefs(...refs) {
6980
6980
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
6981
6981
  try {
6982
6982
  if (isBrowser) {
6983
- window.__reactRouterVersion = "7.0.0";
6983
+ window.__reactRouterVersion = "7.0.1-pre.0";
6984
6984
  }
6985
6985
  } catch (e) {
6986
6986
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3558,7 +3558,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
3558
3558
  let parentPath = parentRoute && parentRoute.path || "";
3559
3559
  warningOnce(
3560
3560
  parentPathname,
3561
- !parentRoute || parentPath.endsWith("*"),
3561
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
3562
3562
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3563
3563
 
3564
3564
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ import {
25
25
  matchRoutes,
26
26
  shouldHydrateRouteLoader,
27
27
  useFogOFWarDiscovery
28
- } from "./chunk-U6WQEHBI.mjs";
28
+ } from "./chunk-MFVUHSGM.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4359,7 +4359,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4359
4359
  let parentPath = parentRoute && parentRoute.path || "";
4360
4360
  warningOnce(
4361
4361
  parentPathname,
4362
- !parentRoute || parentPath.endsWith("*"),
4362
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
4363
4363
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4364
4364
 
4365
4365
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -7125,7 +7125,7 @@ function mergeRefs(...refs) {
7125
7125
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7126
7126
  try {
7127
7127
  if (isBrowser) {
7128
- window.__reactRouterVersion = "7.0.0";
7128
+ window.__reactRouterVersion = "7.0.1-pre.0";
7129
7129
  }
7130
7130
  } catch (e) {
7131
7131
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -119,7 +119,7 @@ import {
119
119
  useSearchParams,
120
120
  useSubmit,
121
121
  useViewTransitionState
122
- } from "./chunk-U6WQEHBI.mjs";
122
+ } from "./chunk-MFVUHSGM.mjs";
123
123
  export {
124
124
  Await,
125
125
  BrowserRouter,
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
6
6
  type RouteModule = {
7
7
  meta?: Func;
8
8
  links?: Func;
9
+ headers?: Func;
9
10
  loader?: Func;
10
11
  clientLoader?: Func;
11
12
  action?: Func;
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
42
43
  matches: MetaMatches<T["parents"]>;
43
44
  };
44
45
  type MetaDescriptors = MetaDescriptor[];
46
+ type HeadersArgs = {
47
+ loaderHeaders: Headers;
48
+ parentHeaders: Headers;
49
+ actionHeaders: Headers;
50
+ errorHeaders: Headers | undefined;
51
+ };
45
52
  type IsHydrate<ClientLoader> = ClientLoader extends {
46
53
  hydrate: true;
47
54
  } ? true : ClientLoader extends {
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
99
106
  actionData?: T["actionData"];
100
107
  };
101
108
 
102
- export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
109
+ export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
6
6
  type RouteModule = {
7
7
  meta?: Func;
8
8
  links?: Func;
9
+ headers?: Func;
9
10
  loader?: Func;
10
11
  clientLoader?: Func;
11
12
  action?: Func;
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
42
43
  matches: MetaMatches<T["parents"]>;
43
44
  };
44
45
  type MetaDescriptors = MetaDescriptor[];
46
+ type HeadersArgs = {
47
+ loaderHeaders: Headers;
48
+ parentHeaders: Headers;
49
+ actionHeaders: Headers;
50
+ errorHeaders: Headers | undefined;
51
+ };
45
52
  type IsHydrate<ClientLoader> = ClientLoader extends {
46
53
  hydrate: true;
47
54
  } ? true : ClientLoader extends {
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
99
106
  actionData?: T["actionData"];
100
107
  };
101
108
 
102
- export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
109
+ export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4214,7 +4214,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4214
4214
  let parentPath = parentRoute && parentRoute.path || "";
4215
4215
  warningOnce(
4216
4216
  parentPathname,
4217
- !parentRoute || parentPath.endsWith("*"),
4217
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
4218
4218
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4219
4219
 
4220
4220
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -6980,7 +6980,7 @@ function mergeRefs(...refs) {
6980
6980
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
6981
6981
  try {
6982
6982
  if (isBrowser) {
6983
- window.__reactRouterVersion = "7.0.0";
6983
+ window.__reactRouterVersion = "7.0.1-pre.0";
6984
6984
  }
6985
6985
  } catch (e) {
6986
6986
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3558,7 +3558,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
3558
3558
  let parentPath = parentRoute && parentRoute.path || "";
3559
3559
  warningOnce(
3560
3560
  parentPathname,
3561
- !parentRoute || parentPath.endsWith("*"),
3561
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
3562
3562
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3563
3563
 
3564
3564
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ import {
25
25
  matchRoutes,
26
26
  shouldHydrateRouteLoader,
27
27
  useFogOFWarDiscovery
28
- } from "./chunk-L6MGG5FJ.mjs";
28
+ } from "./chunk-U7UKN772.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4359,7 +4359,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4359
4359
  let parentPath = parentRoute && parentRoute.path || "";
4360
4360
  warningOnce(
4361
4361
  parentPathname,
4362
- !parentRoute || parentPath.endsWith("*"),
4362
+ !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"),
4363
4363
  `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${parentPathname}" (under <Route path="${parentPath}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
4364
4364
 
4365
4365
  Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
@@ -7125,7 +7125,7 @@ function mergeRefs(...refs) {
7125
7125
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7126
7126
  try {
7127
7127
  if (isBrowser) {
7128
- window.__reactRouterVersion = "7.0.0";
7128
+ window.__reactRouterVersion = "7.0.1-pre.0";
7129
7129
  }
7130
7130
  } catch (e) {
7131
7131
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -119,7 +119,7 @@ import {
119
119
  useSearchParams,
120
120
  useSubmit,
121
121
  useViewTransitionState
122
- } from "./chunk-L6MGG5FJ.mjs";
122
+ } from "./chunk-U7UKN772.mjs";
123
123
  export {
124
124
  Await,
125
125
  BrowserRouter,
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
6
6
  type RouteModule = {
7
7
  meta?: Func;
8
8
  links?: Func;
9
+ headers?: Func;
9
10
  loader?: Func;
10
11
  clientLoader?: Func;
11
12
  action?: Func;
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
42
43
  matches: MetaMatches<T["parents"]>;
43
44
  };
44
45
  type MetaDescriptors = MetaDescriptor[];
46
+ type HeadersArgs = {
47
+ loaderHeaders: Headers;
48
+ parentHeaders: Headers;
49
+ actionHeaders: Headers;
50
+ errorHeaders: Headers | undefined;
51
+ };
45
52
  type IsHydrate<ClientLoader> = ClientLoader extends {
46
53
  hydrate: true;
47
54
  } ? true : ClientLoader extends {
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
99
106
  actionData?: T["actionData"];
100
107
  };
101
108
 
102
- export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
109
+ export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
@@ -6,6 +6,7 @@ type IsDefined<T> = Equal<T, undefined> extends true ? false : true;
6
6
  type RouteModule = {
7
7
  meta?: Func;
8
8
  links?: Func;
9
+ headers?: Func;
9
10
  loader?: Func;
10
11
  clientLoader?: Func;
11
12
  action?: Func;
@@ -42,6 +43,12 @@ type CreateMetaArgs<T extends RouteInfo> = {
42
43
  matches: MetaMatches<T["parents"]>;
43
44
  };
44
45
  type MetaDescriptors = MetaDescriptor[];
46
+ type HeadersArgs = {
47
+ loaderHeaders: Headers;
48
+ parentHeaders: Headers;
49
+ actionHeaders: Headers;
50
+ errorHeaders: Headers | undefined;
51
+ };
45
52
  type IsHydrate<ClientLoader> = ClientLoader extends {
46
53
  hydrate: true;
47
54
  } ? true : ClientLoader extends {
@@ -99,4 +106,4 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
99
106
  actionData?: T["actionData"];
100
107
  };
101
108
 
102
- export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, LinkDescriptors, MetaDescriptors };
109
+ export type { CreateActionData, CreateClientActionArgs, CreateClientLoaderArgs, CreateComponentProps, CreateErrorBoundaryProps, CreateHydrateFallbackProps, CreateLoaderData, CreateMetaArgs, CreateServerActionArgs, CreateServerLoaderArgs, HeadersArgs, LinkDescriptors, MetaDescriptors };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.0.0
2
+ * react-router v7.0.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.0.0",
3
+ "version": "7.0.1-pre.0",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",