react-router 7.18.5 → 7.18.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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{production/chunk-K3NA4NUH.js → development/chunk-3QTLHDUO.js} +7 -7
  3. package/dist/{production/chunk-IAM5GYT3.mjs → development/chunk-E2PF4K4Z.mjs} +14 -5
  4. package/dist/development/{chunk-NDF5KBLP.js → chunk-QM7ETCUK.js} +109 -104
  5. package/dist/development/{chunk-2ZBLYC7V.js → chunk-S47XUPN5.js} +105 -65
  6. package/dist/development/{chunk-6KYCQHYJ.mjs → chunk-YDNE64FV.mjs} +107 -63
  7. package/dist/development/dom-export.js +37 -35
  8. package/dist/development/dom-export.mjs +6 -4
  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 +72 -3
  12. package/dist/development/index-react-server.mjs +72 -3
  13. package/dist/development/index.d.mts +1 -1
  14. package/dist/development/index.d.ts +1 -1
  15. package/dist/development/index.js +111 -102
  16. package/dist/development/index.mjs +3 -3
  17. package/dist/development/lib/types/internal.js +1 -1
  18. package/dist/development/lib/types/internal.mjs +1 -1
  19. package/dist/production/{chunk-75HN637G.js → chunk-2WUBOUFU.js} +109 -104
  20. package/dist/{development/chunk-IFHLIXZW.js → production/chunk-3IBQ4CTZ.js} +7 -7
  21. package/dist/production/{chunk-HNBICOIU.js → chunk-AC65NKOP.js} +105 -65
  22. package/dist/production/{chunk-7RTFRKQW.mjs → chunk-HEAXLYUI.mjs} +107 -63
  23. package/dist/{development/chunk-JAHXRPFV.mjs → production/chunk-JRCXCPLA.mjs} +14 -5
  24. package/dist/production/dom-export.js +37 -35
  25. package/dist/production/dom-export.mjs +6 -4
  26. package/dist/production/index-react-server-client.js +4 -4
  27. package/dist/production/index-react-server-client.mjs +2 -2
  28. package/dist/production/index-react-server.js +72 -3
  29. package/dist/production/index-react-server.mjs +72 -3
  30. package/dist/production/index.d.mts +1 -1
  31. package/dist/production/index.d.ts +1 -1
  32. package/dist/production/index.js +111 -102
  33. package/dist/production/index.mjs +3 -3
  34. package/dist/production/lib/types/internal.js +1 -1
  35. package/dist/production/lib/types/internal.mjs +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # `react-router`
2
2
 
3
+ ## v7.18.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix hydration of streamed `Suspense` boundaries in development with `future.v8_viteEnvironmentApi` ([#15747](https://github.com/remix-run/react-router/pull/15747))
8
+
9
+ - Preserve server-rendered content while lazy client code loads by clearing critical CSS in a transition
10
+
11
+ - Handle `HEAD` response bodies consistently in Framework, RSC Framework, and RSC Data modes, preserving response metadata and deferred data handling ([#15784](https://github.com/remix-run/react-router/pull/15784))
12
+
13
+ - Improve path generation and URL validation across `href()`, `generatePath()`, links, forms, fetchers, and redirects ([#15787](https://github.com/remix-run/react-router/pull/15787))
14
+
15
+ - Preserve route parameters ending in `.data` in Single Fetch loader and action requests when `future.v8_passThroughRequests` is disabled ([#15734](https://github.com/remix-run/react-router/pull/15734))
16
+
3
17
  ## v7.18.5
4
18
 
5
19
  ### Patch Changes
@@ -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.18.5
2
+ * react-router v7.18.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkHNBICOIUjs = require('./chunk-HNBICOIU.js');
17
+ var _chunkS47XUPN5js = require('./chunk-S47XUPN5.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 = _chunkHNBICOIUjs.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkS47XUPN5js.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 (_chunkHNBICOIUjs.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkS47XUPN5js.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 (_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkS47XUPN5js.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
- _chunkHNBICOIUjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkS47XUPN5js.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 = _chunkHNBICOIUjs.useRouteError.call(void 0, );
149
+ let error = _chunkS47XUPN5js.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.18.5
2
+ * react-router v7.18.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -54,11 +54,12 @@ import {
54
54
  shouldUseInitialRouteDiscovery,
55
55
  stripBasename,
56
56
  useRouteError,
57
+ validateDocumentNavigationTarget,
57
58
  warnOnce,
58
59
  withComponentProps,
59
60
  withErrorBoundaryProps,
60
61
  withHydrateFallbackProps
61
- } from "./chunk-7RTFRKQW.mjs";
62
+ } from "./chunk-YDNE64FV.mjs";
62
63
 
63
64
  // lib/dom/ssr/server.tsx
64
65
  import * as React from "react";
@@ -887,7 +888,9 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
887
888
  return handleQueryError(error);
888
889
  }
889
890
  } : void 0,
890
- normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
891
+ // Normalize the original request because handlerRequest may already have
892
+ // its .data suffix removed when v8_passThroughRequests is disabled.
893
+ normalizePath: () => getNormalizedPath(request, build.basename, build.future)
891
894
  });
892
895
  return handleQueryResult(result);
893
896
  } catch (error) {
@@ -952,7 +955,9 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
952
955
  return handleQueryError(error);
953
956
  }
954
957
  } : void 0,
955
- normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
958
+ // Normalize the original request because handlerRequest may already have
959
+ // its .data suffix removed when v8_passThroughRequests is disabled.
960
+ normalizePath: () => getNormalizedPath(request, build.basename, build.future)
956
961
  });
957
962
  return handleQueryResult(result);
958
963
  } catch (error) {
@@ -1307,6 +1312,8 @@ function derive(build, mode) {
1307
1312
  );
1308
1313
  }
1309
1314
  if (request.method === "HEAD") {
1315
+ response.body?.cancel().catch(() => {
1316
+ });
1310
1317
  return new Response(null, {
1311
1318
  headers: response.headers,
1312
1319
  status: response.status,
@@ -1819,7 +1826,9 @@ function href(path, ...args) {
1819
1826
  result += "/" + value;
1820
1827
  }
1821
1828
  }
1822
- return result || "/";
1829
+ result = result.replace(/^[\\/]{2,}/, "/") || "/";
1830
+ validateDocumentNavigationTarget(result);
1831
+ return result;
1823
1832
  }
1824
1833
  function trimTrailingSplat(path) {
1825
1834
  let i = path.length - 1;