react-router 7.1.4 → 7.1.5

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,25 +1,23 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix regression introduced in `7.1.4` via [#12800](https://github.com/remix-run/react-router/pull/12800) that caused issues navigating to hash routes inside splat routes for applications using Lazy Route Discovery (`patchRoutesOnNavigation`) ([#12927](https://github.com/remix-run/react-router/pull/12927))
8
+
3
9
  ## 7.1.4
4
10
 
5
11
  ### Patch Changes
6
12
 
7
13
  - Internal reorg to clean up some duplicated route module types ([#12799](https://github.com/remix-run/react-router/pull/12799))
8
-
9
14
  - Properly handle status codes that cannot have a body in single fetch responses (204, etc.) ([#12760](https://github.com/remix-run/react-router/pull/12760))
10
-
11
15
  - Stop erroring on resource routes that return raw strings/objects and instead serialize them as `text/plain` or `application/json` responses ([#12848](https://github.com/remix-run/react-router/pull/12848))
12
-
13
16
  - This only applies when accessed as a resource route without the `.data` extension
14
17
  - When accessed from a Single Fetch `.data` request, they will still be encoded via `turbo-stream`
15
-
16
- - REMOVE: limit matchRoutes optimization to client side ([#12882](https://github.com/remix-run/react-router/pull/12882))
17
-
18
18
  - Optimize Lazy Route Discovery path discovery to favor a single `querySelectorAll` call at the `body` level instead of many calls at the sub-tree level ([#12731](https://github.com/remix-run/react-router/pull/12731))
19
-
20
- - - Properly bubble headers as `errorHeaders` when throwing a `data()` result ([#12846](https://github.com/remix-run/react-router/pull/12846))
19
+ - Properly bubble headers as `errorHeaders` when throwing a `data()` result ([#12846](https://github.com/remix-run/react-router/pull/12846))
21
20
  - Avoid duplication of `Set-Cookie` headers could be duplicated if also returned from `headers`
22
-
23
21
  - Optimize route matching by skipping redundant `matchRoutes` calls when possible ([#12800](https://github.com/remix-run/react-router/pull/12800))
24
22
 
25
23
  ## 7.1.3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1320,6 +1320,10 @@ function createRouter(init) {
1320
1320
  state.matches
1321
1321
  ) : matchRoutes(routesToUse, location, basename);
1322
1322
  let flushSync = (opts && opts.flushSync) === true;
1323
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1324
+ completeNavigation(location, { matches }, { flushSync });
1325
+ return;
1326
+ }
1323
1327
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1324
1328
  if (fogOfWar.active && fogOfWar.matches) {
1325
1329
  matches = fogOfWar.matches;
@@ -1341,10 +1345,6 @@ function createRouter(init) {
1341
1345
  );
1342
1346
  return;
1343
1347
  }
1344
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1345
- completeNavigation(location, { matches }, { flushSync });
1346
- return;
1347
- }
1348
1348
  pendingNavigationController = new AbortController();
1349
1349
  let request = createClientSideRequest(
1350
1350
  init.history,
@@ -6981,7 +6981,7 @@ function mergeRefs(...refs) {
6981
6981
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
6982
6982
  try {
6983
6983
  if (isBrowser) {
6984
- window.__reactRouterVersion = "7.1.4";
6984
+ window.__reactRouterVersion = "7.1.5";
6985
6985
  }
6986
6986
  } catch (e) {
6987
6987
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1177,6 +1177,10 @@ function createRouter(init) {
1177
1177
  state.matches
1178
1178
  ) : matchRoutes(routesToUse, location, basename);
1179
1179
  let flushSync2 = (opts && opts.flushSync) === true;
1180
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1181
+ completeNavigation(location, { matches }, { flushSync: flushSync2 });
1182
+ return;
1183
+ }
1180
1184
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1181
1185
  if (fogOfWar.active && fogOfWar.matches) {
1182
1186
  matches = fogOfWar.matches;
@@ -1198,10 +1202,6 @@ function createRouter(init) {
1198
1202
  );
1199
1203
  return;
1200
1204
  }
1201
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1202
- completeNavigation(location, { matches }, { flushSync: flushSync2 });
1203
- return;
1204
- }
1205
1205
  pendingNavigationController = new AbortController();
1206
1206
  let request = createClientSideRequest(
1207
1207
  init.history,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
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-W3FMU5Y5.mjs";
28
+ } from "./chunk-IR6S3I6Y.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.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1465,6 +1465,10 @@ function createRouter(init) {
1465
1465
  state.matches
1466
1466
  ) : matchRoutes(routesToUse, location, basename);
1467
1467
  let flushSync = (opts && opts.flushSync) === true;
1468
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1469
+ completeNavigation(location, { matches }, { flushSync });
1470
+ return;
1471
+ }
1468
1472
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1469
1473
  if (fogOfWar.active && fogOfWar.matches) {
1470
1474
  matches = fogOfWar.matches;
@@ -1486,10 +1490,6 @@ function createRouter(init) {
1486
1490
  );
1487
1491
  return;
1488
1492
  }
1489
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1490
- completeNavigation(location, { matches }, { flushSync });
1491
- return;
1492
- }
1493
1493
  pendingNavigationController = new AbortController();
1494
1494
  let request = createClientSideRequest(
1495
1495
  init.history,
@@ -7126,7 +7126,7 @@ function mergeRefs(...refs) {
7126
7126
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7127
7127
  try {
7128
7128
  if (isBrowser) {
7129
- window.__reactRouterVersion = "7.1.4";
7129
+ window.__reactRouterVersion = "7.1.5";
7130
7130
  }
7131
7131
  } catch (e) {
7132
7132
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -120,7 +120,7 @@ import {
120
120
  useSearchParams,
121
121
  useSubmit,
122
122
  useViewTransitionState
123
- } from "./chunk-W3FMU5Y5.mjs";
123
+ } from "./chunk-IR6S3I6Y.mjs";
124
124
  export {
125
125
  Await,
126
126
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1320,6 +1320,10 @@ function createRouter(init) {
1320
1320
  state.matches
1321
1321
  ) : matchRoutes(routesToUse, location, basename);
1322
1322
  let flushSync = (opts && opts.flushSync) === true;
1323
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1324
+ completeNavigation(location, { matches }, { flushSync });
1325
+ return;
1326
+ }
1323
1327
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1324
1328
  if (fogOfWar.active && fogOfWar.matches) {
1325
1329
  matches = fogOfWar.matches;
@@ -1341,10 +1345,6 @@ function createRouter(init) {
1341
1345
  );
1342
1346
  return;
1343
1347
  }
1344
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1345
- completeNavigation(location, { matches }, { flushSync });
1346
- return;
1347
- }
1348
1348
  pendingNavigationController = new AbortController();
1349
1349
  let request = createClientSideRequest(
1350
1350
  init.history,
@@ -6981,7 +6981,7 @@ function mergeRefs(...refs) {
6981
6981
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
6982
6982
  try {
6983
6983
  if (isBrowser) {
6984
- window.__reactRouterVersion = "7.1.4";
6984
+ window.__reactRouterVersion = "7.1.5";
6985
6985
  }
6986
6986
  } catch (e) {
6987
6987
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1177,6 +1177,10 @@ function createRouter(init) {
1177
1177
  state.matches
1178
1178
  ) : matchRoutes(routesToUse, location, basename);
1179
1179
  let flushSync2 = (opts && opts.flushSync) === true;
1180
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1181
+ completeNavigation(location, { matches }, { flushSync: flushSync2 });
1182
+ return;
1183
+ }
1180
1184
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1181
1185
  if (fogOfWar.active && fogOfWar.matches) {
1182
1186
  matches = fogOfWar.matches;
@@ -1198,10 +1202,6 @@ function createRouter(init) {
1198
1202
  );
1199
1203
  return;
1200
1204
  }
1201
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1202
- completeNavigation(location, { matches }, { flushSync: flushSync2 });
1203
- return;
1204
- }
1205
1205
  pendingNavigationController = new AbortController();
1206
1206
  let request = createClientSideRequest(
1207
1207
  init.history,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
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-FIUQORTV.mjs";
28
+ } from "./chunk-JRAGQQ3X.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.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1465,6 +1465,10 @@ function createRouter(init) {
1465
1465
  state.matches
1466
1466
  ) : matchRoutes(routesToUse, location, basename);
1467
1467
  let flushSync = (opts && opts.flushSync) === true;
1468
+ if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1469
+ completeNavigation(location, { matches }, { flushSync });
1470
+ return;
1471
+ }
1468
1472
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1469
1473
  if (fogOfWar.active && fogOfWar.matches) {
1470
1474
  matches = fogOfWar.matches;
@@ -1486,10 +1490,6 @@ function createRouter(init) {
1486
1490
  );
1487
1491
  return;
1488
1492
  }
1489
- if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1490
- completeNavigation(location, { matches }, { flushSync });
1491
- return;
1492
- }
1493
1493
  pendingNavigationController = new AbortController();
1494
1494
  let request = createClientSideRequest(
1495
1495
  init.history,
@@ -7126,7 +7126,7 @@ function mergeRefs(...refs) {
7126
7126
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7127
7127
  try {
7128
7128
  if (isBrowser) {
7129
- window.__reactRouterVersion = "7.1.4";
7129
+ window.__reactRouterVersion = "7.1.5";
7130
7130
  }
7131
7131
  } catch (e) {
7132
7132
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -120,7 +120,7 @@ import {
120
120
  useSearchParams,
121
121
  useSubmit,
122
122
  useViewTransitionState
123
- } from "./chunk-FIUQORTV.mjs";
123
+ } from "./chunk-JRAGQQ3X.mjs";
124
124
  export {
125
125
  Await,
126
126
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.4
2
+ * react-router v7.1.5
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.1.4",
3
+ "version": "7.1.5",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",