react-router 7.9.6-pre.0 → 7.9.6

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 (32) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/dist/development/{chunk-7TW6LJC6.mjs → chunk-4WY6JWTD.mjs} +26 -5
  3. package/dist/development/{chunk-TUTX3ERH.js → chunk-AMVS5XVJ.js} +25 -4
  4. package/dist/{production/chunk-4MBU4DF6.mjs → development/chunk-G3INQAYP.mjs} +2 -2
  5. package/dist/{production/chunk-ZHTTD7UY.js → development/chunk-O4JVZSOY.js} +93 -93
  6. package/dist/{production/chunk-MKF3AQDO.js → development/chunk-PZWDWJAY.js} +7 -7
  7. package/dist/development/dom-export.js +26 -26
  8. package/dist/development/dom-export.mjs +3 -3
  9. package/dist/development/index-react-server-client.js +4 -4
  10. package/dist/development/index-react-server-client.mjs +2 -2
  11. package/dist/development/index-react-server.js +25 -4
  12. package/dist/development/index-react-server.mjs +25 -4
  13. package/dist/development/index.js +76 -76
  14. package/dist/development/index.mjs +3 -3
  15. package/dist/development/lib/types/internal.js +1 -1
  16. package/dist/development/lib/types/internal.mjs +1 -1
  17. package/dist/production/{chunk-RBZEEJIK.js → chunk-EAIF67OW.js} +25 -4
  18. package/dist/{development/chunk-P6ZEAD4C.mjs → production/chunk-FDUMZGKM.mjs} +2 -2
  19. package/dist/production/{chunk-GG2LAVOQ.mjs → chunk-FUSXQSWG.mjs} +26 -5
  20. package/dist/{development/chunk-DB25NZIA.js → production/chunk-G5A35OQU.js} +7 -7
  21. package/dist/{development/chunk-IR7LYQCC.js → production/chunk-QN64DHI4.js} +93 -93
  22. package/dist/production/dom-export.js +26 -26
  23. package/dist/production/dom-export.mjs +3 -3
  24. package/dist/production/index-react-server-client.js +4 -4
  25. package/dist/production/index-react-server-client.mjs +2 -2
  26. package/dist/production/index-react-server.js +25 -4
  27. package/dist/production/index-react-server.mjs +25 -4
  28. package/dist/production/index.js +76 -76
  29. package/dist/production/index.mjs +3 -3
  30. package/dist/production/lib/types/internal.js +1 -1
  31. package/dist/production/lib/types/internal.mjs +1 -1
  32. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v7.9.6-pre.0
2
+ * react-router v7.9.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -811,13 +811,36 @@ function prependBasename({
811
811
  }) {
812
812
  return pathname === "/" ? basename : joinPaths([basename, pathname]);
813
813
  }
814
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
815
+ var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
814
816
  function resolvePath(to, fromPathname = "/") {
815
817
  let {
816
818
  pathname: toPathname,
817
819
  search = "",
818
820
  hash = ""
819
821
  } = typeof to === "string" ? parsePath(to) : to;
820
- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
822
+ let pathname;
823
+ if (toPathname) {
824
+ if (isAbsoluteUrl(toPathname)) {
825
+ pathname = toPathname;
826
+ } else {
827
+ if (toPathname.includes("//")) {
828
+ let oldPathname = toPathname;
829
+ toPathname = toPathname.replace(/\/\/+/g, "/");
830
+ warning(
831
+ false,
832
+ `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
833
+ );
834
+ }
835
+ if (toPathname.startsWith("/")) {
836
+ pathname = resolvePathname(toPathname.substring(1), "/");
837
+ } else {
838
+ pathname = resolvePathname(toPathname, fromPathname);
839
+ }
840
+ }
841
+ } else {
842
+ pathname = fromPathname;
843
+ }
821
844
  return {
822
845
  pathname,
823
846
  search: normalizeSearch(search),
@@ -1265,8 +1288,6 @@ var IDLE_BLOCKER = {
1265
1288
  reset: void 0,
1266
1289
  location: void 0
1267
1290
  };
1268
- var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1269
- var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
1270
1291
  var defaultMapRouteProperties = (route) => ({
1271
1292
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
1272
1293
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.6-pre.0
2
+ * react-router v7.9.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -49,7 +49,7 @@ import {
49
49
  withComponentProps,
50
50
  withErrorBoundaryProps,
51
51
  withHydrateFallbackProps
52
- } from "./chunk-7TW6LJC6.mjs";
52
+ } from "./chunk-FUSXQSWG.mjs";
53
53
 
54
54
  // lib/dom/ssr/server.tsx
55
55
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.6-pre.0
2
+ * react-router v7.9.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -811,13 +811,36 @@ function prependBasename({
811
811
  }) {
812
812
  return pathname === "/" ? basename : joinPaths([basename, pathname]);
813
813
  }
814
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
815
+ var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
814
816
  function resolvePath(to, fromPathname = "/") {
815
817
  let {
816
818
  pathname: toPathname,
817
819
  search = "",
818
820
  hash = ""
819
821
  } = typeof to === "string" ? parsePath(to) : to;
820
- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
822
+ let pathname;
823
+ if (toPathname) {
824
+ if (isAbsoluteUrl(toPathname)) {
825
+ pathname = toPathname;
826
+ } else {
827
+ if (toPathname.includes("//")) {
828
+ let oldPathname = toPathname;
829
+ toPathname = toPathname.replace(/\/\/+/g, "/");
830
+ warning(
831
+ false,
832
+ `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
833
+ );
834
+ }
835
+ if (toPathname.startsWith("/")) {
836
+ pathname = resolvePathname(toPathname.substring(1), "/");
837
+ } else {
838
+ pathname = resolvePathname(toPathname, fromPathname);
839
+ }
840
+ }
841
+ } else {
842
+ pathname = fromPathname;
843
+ }
821
844
  return {
822
845
  pathname,
823
846
  search: normalizeSearch(search),
@@ -1265,8 +1288,6 @@ var IDLE_BLOCKER = {
1265
1288
  reset: void 0,
1266
1289
  location: void 0
1267
1290
  };
1268
- var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1269
- var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
1270
1291
  var defaultMapRouteProperties = (route) => ({
1271
1292
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
1272
1293
  });
@@ -9517,7 +9538,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
9517
9538
  try {
9518
9539
  if (isBrowser) {
9519
9540
  window.__reactRouterVersion = // @ts-expect-error
9520
- "7.9.6-pre.0";
9541
+ "7.9.6";
9521
9542
  }
9522
9543
  } catch (e) {
9523
9544
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
2
- * react-router v7.9.6-pre.0
2
+ * react-router v7.9.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkTUTX3ERHjs = require('./chunk-TUTX3ERH.js');
17
+ var _chunkEAIF67OWjs = require('./chunk-EAIF67OW.js');
18
18
 
19
19
  // lib/dom/ssr/hydration.tsx
20
20
  function getHydrationData({
@@ -29,12 +29,12 @@ function getHydrationData({
29
29
  ...state,
30
30
  loaderData: { ...state.loaderData }
31
31
  };
32
- let initialMatches = _chunkTUTX3ERHjs.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkEAIF67OWjs.matchRoutes.call(void 0, routes, location, basename);
33
33
  if (initialMatches) {
34
34
  for (let match of initialMatches) {
35
35
  let routeId = match.route.id;
36
36
  let routeInfo = getRouteInfo(routeId);
37
- if (_chunkTUTX3ERHjs.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkEAIF67OWjs.shouldHydrateRouteLoader.call(void 0,
38
38
  routeId,
39
39
  routeInfo.clientLoader,
40
40
  routeInfo.hasLoader,
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
112
112
  }
113
113
  }
114
114
  );
115
- if (_chunkTUTX3ERHjs.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkEAIF67OWjs.isRouteErrorResponse.call(void 0, error)) {
116
116
  return /* @__PURE__ */ _react2.default.createElement(
117
117
  ErrorWrapper,
118
118
  {
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
120
120
  title: "Unhandled Thrown Response!"
121
121
  },
122
122
  /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
123
- _chunkTUTX3ERHjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkEAIF67OWjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
124
124
  );
125
125
  }
126
126
  let errorInstance;
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
146
146
  function RSCDefaultRootErrorBoundary({
147
147
  hasRootLayout
148
148
  }) {
149
- let error = _chunkTUTX3ERHjs.useRouteError.call(void 0, );
149
+ let error = _chunkEAIF67OWjs.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }