react-router 7.18.4 → 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 (60) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/development/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
  3. package/dist/development/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
  4. package/dist/development/{chunk-LVPI3KDG.js → chunk-3QTLHDUO.js} +7 -7
  5. package/dist/{production/chunk-G2MPF4YY.mjs → development/chunk-E2PF4K4Z.mjs} +25 -7
  6. package/dist/development/{chunk-HQO5H5CC.js → chunk-QM7ETCUK.js} +109 -104
  7. package/dist/development/{chunk-GR4NQCSD.js → chunk-S47XUPN5.js} +133 -66
  8. package/dist/development/{chunk-OB3PAWPO.mjs → chunk-YDNE64FV.mjs} +135 -64
  9. package/dist/{production/context-nqAapj74.d.mts → development/context-BlYKn1tE.d.mts} +2 -0
  10. package/dist/development/dom-export.d.mts +2 -2
  11. package/dist/development/dom-export.d.ts +2 -2
  12. package/dist/development/dom-export.js +37 -35
  13. package/dist/development/dom-export.mjs +6 -4
  14. package/dist/development/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
  15. package/dist/development/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
  16. package/dist/development/index-react-server-client.d.mts +2 -2
  17. package/dist/development/index-react-server-client.d.ts +2 -2
  18. package/dist/development/index-react-server-client.js +4 -4
  19. package/dist/development/index-react-server-client.mjs +2 -2
  20. package/dist/development/index-react-server.d.mts +2 -0
  21. package/dist/development/index-react-server.d.ts +2 -0
  22. package/dist/development/index-react-server.js +109 -17
  23. package/dist/development/index-react-server.mjs +109 -17
  24. package/dist/development/index.d.mts +7 -7
  25. package/dist/development/index.d.ts +7 -7
  26. package/dist/development/index.js +121 -103
  27. package/dist/development/index.mjs +3 -3
  28. package/dist/{production/instrumentation-B7w3_Eo9.d.ts → development/instrumentation-CPkMwccd.d.ts} +2 -0
  29. package/dist/development/lib/types/internal.js +1 -1
  30. package/dist/development/lib/types/internal.mjs +1 -1
  31. package/dist/production/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
  32. package/dist/production/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
  33. package/dist/production/{chunk-AOOKMWND.js → chunk-2WUBOUFU.js} +109 -104
  34. package/dist/production/{chunk-QURBR4FZ.js → chunk-3IBQ4CTZ.js} +7 -7
  35. package/dist/production/{chunk-YNGRUB6F.js → chunk-AC65NKOP.js} +133 -66
  36. package/dist/production/{chunk-Q34X6AWR.mjs → chunk-HEAXLYUI.mjs} +135 -64
  37. package/dist/{development/chunk-H4DAEOV7.mjs → production/chunk-JRCXCPLA.mjs} +25 -7
  38. package/dist/{development/context-nqAapj74.d.mts → production/context-BlYKn1tE.d.mts} +2 -0
  39. package/dist/production/dom-export.d.mts +2 -2
  40. package/dist/production/dom-export.d.ts +2 -2
  41. package/dist/production/dom-export.js +37 -35
  42. package/dist/production/dom-export.mjs +6 -4
  43. package/dist/production/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
  44. package/dist/production/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
  45. package/dist/production/index-react-server-client.d.mts +2 -2
  46. package/dist/production/index-react-server-client.d.ts +2 -2
  47. package/dist/production/index-react-server-client.js +4 -4
  48. package/dist/production/index-react-server-client.mjs +2 -2
  49. package/dist/production/index-react-server.d.mts +2 -0
  50. package/dist/production/index-react-server.d.ts +2 -0
  51. package/dist/production/index-react-server.js +109 -17
  52. package/dist/production/index-react-server.mjs +109 -17
  53. package/dist/production/index.d.mts +7 -7
  54. package/dist/production/index.d.ts +7 -7
  55. package/dist/production/index.js +121 -103
  56. package/dist/production/index.mjs +3 -3
  57. package/dist/{development/instrumentation-B7w3_Eo9.d.ts → production/instrumentation-CPkMwccd.d.ts} +2 -0
  58. package/dist/production/lib/types/internal.js +1 -1
  59. package/dist/production/lib/types/internal.mjs +1 -1
  60. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
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
+
17
+ ## v7.18.5
18
+
19
+ ### Patch Changes
20
+
21
+ - Bound route manifest processing during server rendering and RSC document/data requests by falling back to initial route discovery for paths with expensive ancestor expansion, accounting for the number and depth of candidate branches when using regex matching ([#15704](https://github.com/remix-run/react-router/pull/15704))
22
+ - Improve turbo-stream decoding validation and object property handling ([d7223c0](https://github.com/remix-run/react-router/commit/d7223c0))
23
+
3
24
  ## v7.18.4
4
25
 
5
26
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './instrumentation-B7w3_Eo9.js';
2
+ import { R as RouterInit } from './instrumentation-CPkMwccd.js';
3
3
  import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './data-CjO11-hU.js';
4
4
 
5
5
  declare function getRequest(): Request;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './context-nqAapj74.mjs';
2
+ import { R as RouterInit } from './context-BlYKn1tE.mjs';
3
3
  import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './data-DEjBmEfD.mjs';
4
4
 
5
5
  declare function getRequest(): Request;
@@ -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.4
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 _chunkGR4NQCSDjs = require('./chunk-GR4NQCSD.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 = _chunkGR4NQCSDjs.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 (_chunkGR4NQCSDjs.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 (_chunkGR4NQCSDjs.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
- _chunkGR4NQCSDjs.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 = _chunkGR4NQCSDjs.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.4
2
+ * react-router v7.18.6
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -39,6 +39,7 @@ import {
39
39
  hasInvalidProtocol,
40
40
  instrumentHandler,
41
41
  isDataWithResponseInit,
42
+ isFogOfWarEnabled,
42
43
  isMutationMethod,
43
44
  isRedirectResponse,
44
45
  isRedirectStatusCode,
@@ -50,13 +51,15 @@ import {
50
51
  redirectDocument,
51
52
  replace,
52
53
  shouldHydrateRouteLoader,
54
+ shouldUseInitialRouteDiscovery,
53
55
  stripBasename,
54
56
  useRouteError,
57
+ validateDocumentNavigationTarget,
55
58
  warnOnce,
56
59
  withComponentProps,
57
60
  withErrorBoundaryProps,
58
61
  withHydrateFallbackProps
59
- } from "./chunk-Q34X6AWR.mjs";
62
+ } from "./chunk-YDNE64FV.mjs";
60
63
 
61
64
  // lib/dom/ssr/server.tsx
62
65
  import * as React from "react";
@@ -885,7 +888,9 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
885
888
  return handleQueryError(error);
886
889
  }
887
890
  } : void 0,
888
- 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)
889
894
  });
890
895
  return handleQueryResult(result);
891
896
  } catch (error) {
@@ -950,7 +955,9 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
950
955
  return handleQueryError(error);
951
956
  }
952
957
  } : void 0,
953
- 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)
954
961
  });
955
962
  return handleQueryResult(result);
956
963
  } catch (error) {
@@ -1305,6 +1312,8 @@ function derive(build, mode) {
1305
1312
  );
1306
1313
  }
1307
1314
  if (request.method === "HEAD") {
1315
+ response.body?.cancel().catch(() => {
1316
+ });
1308
1317
  return new Response(null, {
1309
1318
  headers: response.headers,
1310
1319
  status: response.status,
@@ -1475,10 +1484,17 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
1475
1484
  actionData: context.actionData,
1476
1485
  errors: context.errors
1477
1486
  };
1487
+ let routeDiscovery = build.routeDiscovery;
1488
+ if (isFogOfWarEnabled(routeDiscovery, build.ssr) && shouldUseInitialRouteDiscovery(
1489
+ context.location.pathname,
1490
+ staticHandler._matchCost
1491
+ )) {
1492
+ routeDiscovery = { ...routeDiscovery, mode: "initial" };
1493
+ }
1478
1494
  let baseServerHandoff = {
1479
1495
  basename: build.basename,
1480
1496
  future: build.future,
1481
- routeDiscovery: build.routeDiscovery,
1497
+ routeDiscovery,
1482
1498
  ssr: build.ssr,
1483
1499
  isSpaMode: isSpaMode2
1484
1500
  };
@@ -1501,7 +1517,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
1501
1517
  renderMeta: {},
1502
1518
  future: build.future,
1503
1519
  ssr: build.ssr,
1504
- routeDiscovery: build.routeDiscovery,
1520
+ routeDiscovery,
1505
1521
  isSpaMode: isSpaMode2,
1506
1522
  serializeError: (err) => serializeError(err, serverMode)
1507
1523
  };
@@ -1810,7 +1826,9 @@ function href(path, ...args) {
1810
1826
  result += "/" + value;
1811
1827
  }
1812
1828
  }
1813
- return result || "/";
1829
+ result = result.replace(/^[\\/]{2,}/, "/") || "/";
1830
+ validateDocumentNavigationTarget(result);
1831
+ return result;
1814
1832
  }
1815
1833
  function trimTrailingSplat(path) {
1816
1834
  let i = path.length - 1;