react-router 7.8.0-pre.1 → 7.8.0-pre.2

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 (42) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/development/{chunk-I22FVTOY.mjs → chunk-3D24XHV2.mjs} +19 -4
  3. package/dist/development/{chunk-NGF2R4G7.js → chunk-74TFO7SN.js} +1 -1
  4. package/dist/{production/chunk-4PESVXQ2.js → development/chunk-HQ37R3FK.js} +130 -130
  5. package/dist/development/{chunk-XFFANEXU.mjs → chunk-WSV33ENW.mjs} +2 -2
  6. package/dist/development/dom-export.js +3 -3
  7. package/dist/development/dom-export.mjs +3 -3
  8. package/dist/{production/index-react-server-client-BzBbJLAD.d.ts → development/index-react-server-client-CMphySRb.d.ts} +18 -1
  9. package/dist/{production/index-react-server-client-CuajY2vy.d.mts → development/index-react-server-client-DXb0OgpJ.d.mts} +18 -1
  10. package/dist/development/index-react-server-client.d.mts +1 -1
  11. package/dist/development/index-react-server-client.d.ts +1 -1
  12. package/dist/development/index-react-server-client.js +4 -4
  13. package/dist/development/index-react-server-client.mjs +2 -2
  14. package/dist/development/index-react-server.js +39 -25
  15. package/dist/development/index-react-server.mjs +39 -25
  16. package/dist/development/index.d.mts +2 -2
  17. package/dist/development/index.d.ts +2 -2
  18. package/dist/development/index.js +117 -102
  19. package/dist/development/index.mjs +3 -3
  20. package/dist/development/lib/types/internal.js +1 -1
  21. package/dist/development/lib/types/internal.mjs +1 -1
  22. package/dist/production/{chunk-RLJ23MYZ.js → chunk-DDK3XFL6.js} +1 -1
  23. package/dist/{development/chunk-4EVDZJGM.js → production/chunk-GSF7DANI.js} +130 -130
  24. package/dist/production/{chunk-P2ZJHOXZ.mjs → chunk-IEIDJVF4.mjs} +2 -2
  25. package/dist/production/{chunk-JJOMWYJ4.mjs → chunk-Q6IGLNPQ.mjs} +19 -4
  26. package/dist/production/dom-export.js +3 -3
  27. package/dist/production/dom-export.mjs +3 -3
  28. package/dist/{development/index-react-server-client-BzBbJLAD.d.ts → production/index-react-server-client-CMphySRb.d.ts} +18 -1
  29. package/dist/{development/index-react-server-client-CuajY2vy.d.mts → production/index-react-server-client-DXb0OgpJ.d.mts} +18 -1
  30. package/dist/production/index-react-server-client.d.mts +1 -1
  31. package/dist/production/index-react-server-client.d.ts +1 -1
  32. package/dist/production/index-react-server-client.js +4 -4
  33. package/dist/production/index-react-server-client.mjs +2 -2
  34. package/dist/production/index-react-server.js +39 -25
  35. package/dist/production/index-react-server.mjs +39 -25
  36. package/dist/production/index.d.mts +2 -2
  37. package/dist/production/index.d.ts +2 -2
  38. package/dist/production/index.js +117 -102
  39. package/dist/production/index.mjs +3 -3
  40. package/dist/production/lib/types/internal.js +1 -1
  41. package/dist/production/lib/types/internal.mjs +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.8.0-pre.2
4
+
5
+ ### Patch Changes
6
+
7
+ - proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
8
+
3
9
  ## 7.8.0-pre.1
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.8.0-pre.1
2
+ * react-router v7.8.0-pre.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -57,7 +57,7 @@ import {
57
57
  withComponentProps,
58
58
  withErrorBoundaryProps,
59
59
  withHydrateFallbackProps
60
- } from "./chunk-XFFANEXU.mjs";
60
+ } from "./chunk-WSV33ENW.mjs";
61
61
 
62
62
  // lib/dom/ssr/server.tsx
63
63
  import * as React from "react";
@@ -703,7 +703,7 @@ function getDocumentHeaders(context, build) {
703
703
  return route.module.headers;
704
704
  });
705
705
  }
706
- function getDocumentHeadersImpl(context, getRouteHeadersFn) {
706
+ function getDocumentHeadersImpl(context, getRouteHeadersFn, _defaultHeaders) {
707
707
  let boundaryIdx = context.errors ? context.matches.findIndex((m) => context.errors[m.route.id]) : -1;
708
708
  let matches = boundaryIdx >= 0 ? context.matches.slice(0, boundaryIdx + 1) : context.matches;
709
709
  let errorHeaders;
@@ -719,6 +719,7 @@ function getDocumentHeadersImpl(context, getRouteHeadersFn) {
719
719
  return errorHeaders != null;
720
720
  });
721
721
  }
722
+ const defaultHeaders = new Headers(_defaultHeaders);
722
723
  return matches.reduce((parentHeaders, match, idx) => {
723
724
  let { id } = match.route;
724
725
  let loaderHeaders = context.loaderHeaders[id] || new Headers();
@@ -750,7 +751,7 @@ function getDocumentHeadersImpl(context, getRouteHeadersFn) {
750
751
  prependCookies(loaderHeaders, headers);
751
752
  prependCookies(parentHeaders, headers);
752
753
  return headers;
753
- }, new Headers());
754
+ }, new Headers(defaultHeaders));
754
755
  }
755
756
  function prependCookies(parentHeaders, childHeaders) {
756
757
  let parentSetCookieString = parentHeaders.get("Set-Cookie");
@@ -2512,6 +2513,20 @@ async function routeRSCServerRequest({
2512
2513
  return payloadPromise;
2513
2514
  };
2514
2515
  try {
2516
+ const payload = await getPayload();
2517
+ if (serverResponse.status === SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
2518
+ const headers2 = new Headers(serverResponse.headers);
2519
+ headers2.delete("Content-Encoding");
2520
+ headers2.delete("Content-Length");
2521
+ headers2.delete("Content-Type");
2522
+ headers2.delete("x-remix-response");
2523
+ headers2.set("Location", payload.location);
2524
+ return new Response(serverResponseB?.body || "", {
2525
+ headers: headers2,
2526
+ status: payload.status,
2527
+ statusText: serverResponse.statusText
2528
+ });
2529
+ }
2515
2530
  const html = await renderHTML(getPayload);
2516
2531
  const headers = new Headers(serverResponse.headers);
2517
2532
  headers.set("Content-Type", "text/html");
@@ -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.8.0-pre.1
2
+ * react-router v7.8.0-pre.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *