react-router 7.12.0 → 7.13.0

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 (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{production/chunk-QCD7HIN2.mjs → development/chunk-4LKRSAEJ.mjs} +21 -15
  3. package/dist/development/{chunk-G2I2SRFA.js → chunk-7PAHGFS4.js} +7 -7
  4. package/dist/development/{chunk-7ZCBDOCZ.js → chunk-HMDR2CVH.js} +96 -96
  5. package/dist/development/{chunk-EPOLDU6W.mjs → chunk-JZWAC4HX.mjs} +36 -21
  6. package/dist/development/{chunk-2BEI23B2.js → chunk-WICQJKU6.js} +35 -20
  7. package/dist/development/dom-export.js +27 -27
  8. package/dist/development/dom-export.mjs +3 -3
  9. package/dist/development/{index-react-server-client-gGyf-7Xp.d.ts → index-react-server-client-1TI9M9o1.d.ts} +8 -1
  10. package/dist/development/{index-react-server-client-IoJGLOqV.d.mts → index-react-server-client-MKTlCGL3.d.mts} +8 -1
  11. package/dist/development/index-react-server-client.d.mts +1 -1
  12. package/dist/development/index-react-server-client.d.ts +1 -1
  13. package/dist/development/index-react-server-client.js +4 -4
  14. package/dist/development/index-react-server-client.mjs +2 -2
  15. package/dist/development/index-react-server.js +5 -19
  16. package/dist/development/index-react-server.mjs +5 -19
  17. package/dist/development/index.d.mts +2 -2
  18. package/dist/development/index.d.ts +2 -2
  19. package/dist/development/index.js +101 -95
  20. package/dist/development/index.mjs +3 -3
  21. package/dist/development/lib/types/internal.js +1 -1
  22. package/dist/development/lib/types/internal.mjs +1 -1
  23. package/dist/{development/chunk-FNSCYPCZ.mjs → production/chunk-GSFLVUYQ.mjs} +21 -15
  24. package/dist/production/{chunk-Y62AB6TB.js → chunk-N2HZAAIG.js} +96 -96
  25. package/dist/production/{chunk-337Z4Y65.js → chunk-NGWWS4QJ.js} +7 -7
  26. package/dist/production/{chunk-Z47B263N.js → chunk-QSNCZFX5.js} +35 -20
  27. package/dist/production/{chunk-DZM3VO5F.mjs → chunk-Y3R63HEB.mjs} +36 -21
  28. package/dist/production/dom-export.js +27 -27
  29. package/dist/production/dom-export.mjs +3 -3
  30. package/dist/production/{index-react-server-client-gGyf-7Xp.d.ts → index-react-server-client-1TI9M9o1.d.ts} +8 -1
  31. package/dist/production/{index-react-server-client-IoJGLOqV.d.mts → index-react-server-client-MKTlCGL3.d.mts} +8 -1
  32. package/dist/production/index-react-server-client.d.mts +1 -1
  33. package/dist/production/index-react-server-client.d.ts +1 -1
  34. package/dist/production/index-react-server-client.js +4 -4
  35. package/dist/production/index-react-server-client.mjs +2 -2
  36. package/dist/production/index-react-server.js +5 -19
  37. package/dist/production/index-react-server.mjs +5 -19
  38. package/dist/production/index.d.mts +2 -2
  39. package/dist/production/index.d.ts +2 -2
  40. package/dist/production/index.js +101 -95
  41. package/dist/production/index.mjs +3 -3
  42. package/dist/production/lib/types/internal.js +1 -1
  43. package/dist/production/lib/types/internal.mjs +1 -1
  44. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `crossOrigin` prop to `Links` component ([#14687](https://github.com/remix-run/react-router/pull/14687))
8
+
9
+ ### Patch Changes
10
+
11
+ - Fix double slash normalization for useNavigate colon urls ([#14718](https://github.com/remix-run/react-router/pull/14718))
12
+ - Update failed origin checks to return a 400 status instead of a 500 ([#14737](https://github.com/remix-run/react-router/pull/14737))
13
+ - Bugfix #14666: Inline criticalCss is missing nonce ([#14691](https://github.com/remix-run/react-router/pull/14691))
14
+ - Loosen `allowedActionOrigins` glob check so `**` matches all domains ([#14722](https://github.com/remix-run/react-router/pull/14722))
15
+
3
16
  ## 7.12.0
4
17
 
5
18
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.12.0
2
+ * react-router v7.13.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -51,7 +51,7 @@ import {
51
51
  withComponentProps,
52
52
  withErrorBoundaryProps,
53
53
  withHydrateFallbackProps
54
- } from "./chunk-DZM3VO5F.mjs";
54
+ } from "./chunk-JZWAC4HX.mjs";
55
55
 
56
56
  // lib/dom/ssr/server.tsx
57
57
  import * as React from "react";
@@ -783,9 +783,6 @@ function matchWildcardDomain(domain, pattern) {
783
783
  if (domainParts.length < patternParts.length) {
784
784
  return false;
785
785
  }
786
- if (patternParts.length === 1 && (patternParts[0] === "*" || patternParts[0] === "**")) {
787
- return false;
788
- }
789
786
  while (patternParts.length) {
790
787
  const patternPart = patternParts.pop();
791
788
  const domainPart = domainParts.pop();
@@ -841,10 +838,14 @@ var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
841
838
  ]);
842
839
  async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
843
840
  try {
844
- throwIfPotentialCSRFAttack(
845
- request.headers,
846
- Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
847
- );
841
+ try {
842
+ throwIfPotentialCSRFAttack(
843
+ request.headers,
844
+ Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
845
+ );
846
+ } catch (e) {
847
+ return handleQueryError(new Error("Bad Request"), 400);
848
+ }
848
849
  let handlerRequest = new Request(handlerUrl, {
849
850
  method: request.method,
850
851
  body: request.body,
@@ -872,12 +873,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
872
873
  function handleQueryResult(result) {
873
874
  return isResponse(result) ? result : staticContextToResponse(result);
874
875
  }
875
- function handleQueryError(error) {
876
+ function handleQueryError(error, status = 500) {
876
877
  handleError(error);
877
878
  return generateSingleFetchResponse(request, build, serverMode, {
878
879
  result: { error },
879
880
  headers: new Headers(),
880
- status: 500
881
+ status
881
882
  });
882
883
  }
883
884
  function staticContextToResponse(context) {
@@ -1396,10 +1397,15 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
1396
1397
  async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
1397
1398
  try {
1398
1399
  if (request.method === "POST") {
1399
- throwIfPotentialCSRFAttack(
1400
- request.headers,
1401
- Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
1402
- );
1400
+ try {
1401
+ throwIfPotentialCSRFAttack(
1402
+ request.headers,
1403
+ Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
1404
+ );
1405
+ } catch (e) {
1406
+ handleError(e);
1407
+ return new Response("Bad Request", { status: 400 });
1408
+ }
1403
1409
  }
1404
1410
  let result = await staticHandler.query(request, {
1405
1411
  requestContext: loadContext,
@@ -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.12.0
2
+ * react-router v7.13.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunk2BEI23B2js = require('./chunk-2BEI23B2.js');
17
+ var _chunkWICQJKU6js = require('./chunk-WICQJKU6.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 = _chunk2BEI23B2js.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkWICQJKU6js.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 (_chunk2BEI23B2js.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkWICQJKU6js.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 (_chunk2BEI23B2js.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkWICQJKU6js.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
- _chunk2BEI23B2js.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkWICQJKU6js.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 = _chunk2BEI23B2js.useRouteError.call(void 0, );
149
+ let error = _chunkWICQJKU6js.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }