react-router 7.9.2 → 7.9.3-pre.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 (30) hide show
  1. package/CHANGELOG.md +10 -9
  2. package/dist/{production/chunk-DTPYDGNQ.mjs → development/chunk-HHJJZWWP.mjs} +6 -10
  3. package/dist/{production/chunk-Y7UMYKHT.js → development/chunk-MREZ7GBS.js} +134 -134
  4. package/dist/development/{chunk-6Z3LVDDH.js → chunk-OUSD3CXG.js} +7 -4
  5. package/dist/development/{chunk-TMI4QPZX.mjs → chunk-TZREDCP7.mjs} +8 -5
  6. package/dist/development/dom-export.js +3 -3
  7. package/dist/development/dom-export.mjs +3 -3
  8. package/dist/development/index-react-server-client.js +4 -4
  9. package/dist/development/index-react-server-client.mjs +2 -2
  10. package/dist/development/index-react-server.js +5 -2
  11. package/dist/development/index-react-server.mjs +5 -2
  12. package/dist/development/index.js +100 -104
  13. package/dist/development/index.mjs +3 -3
  14. package/dist/development/lib/types/internal.js +1 -1
  15. package/dist/development/lib/types/internal.mjs +1 -1
  16. package/dist/production/{chunk-6XOQCZSJ.js → chunk-AR4BV4G2.js} +7 -4
  17. package/dist/production/{chunk-WLGOH3FE.mjs → chunk-RX77WZIY.mjs} +8 -5
  18. package/dist/{development/chunk-VJDS7KU2.js → production/chunk-YE2RU2Y2.js} +134 -134
  19. package/dist/{development/chunk-I3JMK7SU.mjs → production/chunk-ZS4K3BVQ.mjs} +6 -10
  20. package/dist/production/dom-export.js +3 -3
  21. package/dist/production/dom-export.mjs +3 -3
  22. package/dist/production/index-react-server-client.js +4 -4
  23. package/dist/production/index-react-server-client.mjs +2 -2
  24. package/dist/production/index-react-server.js +5 -2
  25. package/dist/production/index-react-server.mjs +5 -2
  26. package/dist/production/index.js +100 -104
  27. package/dist/production/index.mjs +3 -3
  28. package/dist/production/lib/types/internal.js +1 -1
  29. package/dist/production/lib/types/internal.mjs +1 -1
  30. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.9.3-pre.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Do not try to use `turbo-stream` to decode CDN errors that never reached the server ([#14385](https://github.com/remix-run/react-router/pull/14385))
8
+ - We used to do this but lost this check with the adoption of single fetch
9
+
10
+ - Fix Data Mode regression causing a 404 during initial load in when `middleware` exists without any `loader` functions ([#14393](https://github.com/remix-run/react-router/pull/14393))
11
+
3
12
  ## 7.9.2
4
13
 
5
14
  ### Patch Changes
@@ -39,7 +48,6 @@
39
48
  - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
40
49
 
41
50
  We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
42
-
43
51
  - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
44
52
  - [`createContext`](https://reactrouter.com/api/utils/createContext)
45
53
  - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
@@ -66,7 +74,7 @@
66
74
 
67
75
  - \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
68
76
 
69
- - server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
77
+ - server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
70
78
 
71
79
  - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
72
80
 
@@ -115,7 +123,6 @@
115
123
  - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
116
124
 
117
125
  - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
118
-
119
126
  - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
120
127
  - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
121
128
  - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
@@ -149,7 +156,6 @@
149
156
  - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
150
157
 
151
158
  - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
152
-
153
159
  - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
154
160
  - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
155
161
  - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -795,7 +801,6 @@
795
801
  ```
796
802
 
797
803
  Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app:
798
-
799
804
  - Library mode - `createBrowserRouter(routes, { unstable_getContext })`
800
805
  - Framework mode - `<HydratedRouter unstable_getContext>`
801
806
 
@@ -983,7 +988,6 @@ _No changes_
983
988
  - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
984
989
 
985
990
  - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
986
-
987
991
  - `createCookie`
988
992
  - `createCookieSessionStorage`
989
993
  - `createMemorySessionStorage`
@@ -992,7 +996,6 @@ _No changes_
992
996
  For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
993
997
 
994
998
  Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
995
-
996
999
  - `createCookieFactory`
997
1000
  - `createSessionStorageFactory`
998
1001
  - `createCookieSessionStorageFactory`
@@ -1148,7 +1151,6 @@ _No changes_
1148
1151
  ```
1149
1152
 
1150
1153
  This initial implementation targets type inference for:
1151
-
1152
1154
  - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
1153
1155
  - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
1154
1156
  - `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -1163,7 +1165,6 @@ _No changes_
1163
1165
  ```
1164
1166
 
1165
1167
  Check out our docs for more:
1166
-
1167
1168
  - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
1168
1169
  - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
1169
1170
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.2
2
+ * react-router v7.9.3-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -60,7 +60,7 @@ import {
60
60
  withComponentProps,
61
61
  withErrorBoundaryProps,
62
62
  withHydrateFallbackProps
63
- } from "./chunk-WLGOH3FE.mjs";
63
+ } from "./chunk-TZREDCP7.mjs";
64
64
 
65
65
  // lib/dom/ssr/server.tsx
66
66
  import * as React from "react";
@@ -1459,7 +1459,6 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
1459
1459
  }
1460
1460
  function handleQueryRouteError(error) {
1461
1461
  if (isResponse(error)) {
1462
- error.headers.set("X-Remix-Catch", "yes");
1463
1462
  return error;
1464
1463
  }
1465
1464
  if (isRouteErrorResponse(error)) {
@@ -1486,10 +1485,7 @@ function errorResponseToJson(errorResponse, serverMode) {
1486
1485
  ),
1487
1486
  {
1488
1487
  status: errorResponse.status,
1489
- statusText: errorResponse.statusText,
1490
- headers: {
1491
- "X-Remix-Error": "yes"
1492
- }
1488
+ statusText: errorResponse.statusText
1493
1489
  }
1494
1490
  );
1495
1491
  }
@@ -2160,8 +2156,8 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
2160
2156
  let res = await fetchImplementation(
2161
2157
  new Request(url, await createRequestInit(request))
2162
2158
  );
2163
- if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
2164
- throw new ErrorResponseImpl(404, "Not Found", true);
2159
+ if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
2160
+ throw new ErrorResponseImpl(res.status, res.statusText, await res.text());
2165
2161
  }
2166
2162
  invariant(res.body, "No response body to decode");
2167
2163
  try {
@@ -2649,7 +2645,7 @@ async function routeRSCServerRequest({
2649
2645
  headers2.delete("Content-Encoding");
2650
2646
  headers2.delete("Content-Length");
2651
2647
  headers2.delete("Content-Type");
2652
- headers2.delete("x-remix-response");
2648
+ headers2.delete("X-Remix-Response");
2653
2649
  headers2.set("Location", payload.location);
2654
2650
  return new Response(serverResponseB?.body || "", {
2655
2651
  headers: headers2,