react-router 6.28.2 → 6.28.3-pre-v6.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # `react-router`
2
2
 
3
+ ## 6.28.3-pre-v6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Limit matchRoutes optimization to client side routers ([#12881](https://github.com/remix-run/react-router/pull/12881))
8
+
9
+ ## 6.28.3-pre-v6.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Do not log v7 deprecation warnings in production builds ([#12794](https://github.com/remix-run/react-router/pull/12794))
14
+ - Optimize route matching by skipping redundant `matchRoutes` calls when possible ([#12169](https://github.com/remix-run/react-router/pull/12169))
15
+ - Updated dependencies:
16
+ - `@remix-run/router@1.21.2-pre-v6.0`
17
+
3
18
  ## 6.28.2
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.28.2
2
+ * React Router v6.28.3-pre-v6.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -327,7 +327,8 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
327
327
  // router loaded. We can help them understand how to avoid that.
328
328
  "useRoutes() may be used only in the context of a <Router> component.") : UNSAFE_invariant(false) : void 0;
329
329
  let {
330
- navigator
330
+ navigator,
331
+ static: isStatic
331
332
  } = React.useContext(NavigationContext);
332
333
  let {
333
334
  matches: parentMatches
@@ -392,7 +393,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
392
393
  let segments = pathname.replace(/^\//, "").split("/");
393
394
  remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
394
395
  }
395
- let matches = matchRoutes(routes, {
396
+ let matches = !isStatic && dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, {
396
397
  pathname: remainingPathname
397
398
  });
398
399
  if (process.env.NODE_ENV !== "production") {
@@ -930,7 +931,7 @@ function warningOnce(key, cond, message) {
930
931
 
931
932
  const alreadyWarned = {};
932
933
  function warnOnce(key, message) {
933
- if (!alreadyWarned[message]) {
934
+ if (process.env.NODE_ENV !== "production" && !alreadyWarned[message]) {
934
935
  alreadyWarned[message] = true;
935
936
  console.warn(message);
936
937
  }