react-router 7.15.0 → 7.16.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 (72) hide show
  1. package/CHANGELOG.md +67 -10
  2. package/dist/development/{browser-wDl1FZEL.d.ts → browser-D3uq9sI1.d.ts} +2 -2
  3. package/dist/development/{browser-CRsXgNrY.d.mts → browser-nIQ4Nsyi.d.mts} +2 -2
  4. package/dist/development/{chunk-Z5YQYACE.js → chunk-IBI7OMNB.js} +107 -103
  5. package/dist/development/{chunk-5KNZJZUH.mjs → chunk-QUQL4437.mjs} +240 -122
  6. package/dist/development/{chunk-RMD3H4O3.mjs → chunk-S54KXAEJ.mjs} +26 -25
  7. package/dist/development/{chunk-AM3XM4LS.js → chunk-SRID2YZ2.js} +260 -146
  8. package/dist/{production/chunk-7YXKJMLN.js → development/chunk-XEJDWL2B.js} +7 -7
  9. package/dist/{production/context-BQs41HrG.d.mts → development/context-m8rizgnE.d.mts} +8 -2
  10. package/dist/development/{data-BqZ2x964.d.ts → data-D4xhSy90.d.ts} +1 -1
  11. package/dist/{production/data-BVUf681J.d.mts → development/data-U8FS-wNn.d.mts} +1 -1
  12. package/dist/development/dom-export.d.mts +3 -3
  13. package/dist/development/dom-export.d.ts +3 -3
  14. package/dist/development/dom-export.js +50 -52
  15. package/dist/development/dom-export.mjs +25 -27
  16. package/dist/{production/index-react-server-client-CSv-KZBk.d.ts → development/index-react-server-client-BLiUx67a.d.ts} +12 -4
  17. package/dist/{production/index-react-server-client-Ck_yZ1qL.d.mts → development/index-react-server-client-CdKROblb.d.mts} +12 -4
  18. package/dist/development/index-react-server-client.d.mts +3 -3
  19. package/dist/development/index-react-server-client.d.ts +3 -3
  20. package/dist/development/index-react-server-client.js +4 -4
  21. package/dist/development/index-react-server-client.mjs +2 -2
  22. package/dist/development/index-react-server.d.mts +7 -1
  23. package/dist/development/index-react-server.d.ts +7 -1
  24. package/dist/development/index-react-server.js +4 -4
  25. package/dist/development/index-react-server.mjs +4 -4
  26. package/dist/development/index.d.mts +100 -12
  27. package/dist/development/index.d.ts +100 -12
  28. package/dist/development/index.js +107 -104
  29. package/dist/development/index.mjs +5 -3
  30. package/dist/{production/instrumentation-DlJ2QV7d.d.ts → development/instrumentation-1q4YhLGP.d.ts} +8 -2
  31. package/dist/development/lib/types/internal.d.mts +2 -2
  32. package/dist/development/lib/types/internal.d.ts +2 -2
  33. package/dist/development/lib/types/internal.js +1 -1
  34. package/dist/development/lib/types/internal.mjs +1 -1
  35. package/dist/development/{register-Bsscfj79.d.ts → register-CNAx3TXj.d.ts} +1 -1
  36. package/dist/development/{register-Df8okEea.d.mts → register-CqK96Zfk.d.mts} +1 -1
  37. package/dist/production/{browser-wDl1FZEL.d.ts → browser-D3uq9sI1.d.ts} +2 -2
  38. package/dist/production/{browser-CRsXgNrY.d.mts → browser-nIQ4Nsyi.d.mts} +2 -2
  39. package/dist/{development/chunk-2D5H3HU3.js → production/chunk-EAQNHM3N.js} +7 -7
  40. package/dist/production/{chunk-23ZOHYE5.mjs → chunk-NALGHHKE.mjs} +26 -25
  41. package/dist/production/{chunk-GM3PW4GX.mjs → chunk-Q65P7S7Y.mjs} +240 -122
  42. package/dist/production/{chunk-YBQJ3ABE.js → chunk-SKEDDLRM.js} +107 -103
  43. package/dist/production/{chunk-LCJTIOKZ.js → chunk-Y7DNFQZP.js} +260 -146
  44. package/dist/{development/context-BQs41HrG.d.mts → production/context-m8rizgnE.d.mts} +8 -2
  45. package/dist/production/{data-BqZ2x964.d.ts → data-D4xhSy90.d.ts} +1 -1
  46. package/dist/{development/data-BVUf681J.d.mts → production/data-U8FS-wNn.d.mts} +1 -1
  47. package/dist/production/dom-export.d.mts +3 -3
  48. package/dist/production/dom-export.d.ts +3 -3
  49. package/dist/production/dom-export.js +50 -52
  50. package/dist/production/dom-export.mjs +25 -27
  51. package/dist/{development/index-react-server-client-CSv-KZBk.d.ts → production/index-react-server-client-BLiUx67a.d.ts} +12 -4
  52. package/dist/{development/index-react-server-client-Ck_yZ1qL.d.mts → production/index-react-server-client-CdKROblb.d.mts} +12 -4
  53. package/dist/production/index-react-server-client.d.mts +3 -3
  54. package/dist/production/index-react-server-client.d.ts +3 -3
  55. package/dist/production/index-react-server-client.js +4 -4
  56. package/dist/production/index-react-server-client.mjs +2 -2
  57. package/dist/production/index-react-server.d.mts +7 -1
  58. package/dist/production/index-react-server.d.ts +7 -1
  59. package/dist/production/index-react-server.js +4 -4
  60. package/dist/production/index-react-server.mjs +4 -4
  61. package/dist/production/index.d.mts +100 -12
  62. package/dist/production/index.d.ts +100 -12
  63. package/dist/production/index.js +107 -104
  64. package/dist/production/index.mjs +5 -3
  65. package/dist/{development/instrumentation-DlJ2QV7d.d.ts → production/instrumentation-1q4YhLGP.d.ts} +8 -2
  66. package/dist/production/lib/types/internal.d.mts +2 -2
  67. package/dist/production/lib/types/internal.d.ts +2 -2
  68. package/dist/production/lib/types/internal.js +1 -1
  69. package/dist/production/lib/types/internal.mjs +1 -1
  70. package/dist/production/{register-Bsscfj79.d.ts → register-CNAx3TXj.d.ts} +1 -1
  71. package/dist/production/{register-Df8okEea.d.mts → register-CqK96Zfk.d.mts} +1 -1
  72. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.15.0
2
+ * react-router v7.16.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -28,7 +28,7 @@ import {
28
28
  isSession,
29
29
  routeRSCServerRequest,
30
30
  setDevServerHooks
31
- } from "./chunk-RMD3H4O3.mjs";
31
+ } from "./chunk-S54KXAEJ.mjs";
32
32
  import {
33
33
  Action,
34
34
  Await,
@@ -133,6 +133,7 @@ import {
133
133
  useRoute,
134
134
  useRouteError,
135
135
  useRouteLoaderData,
136
+ useRouterState,
136
137
  useRoutes,
137
138
  useScrollRestoration,
138
139
  useSearchParams,
@@ -141,7 +142,7 @@ import {
141
142
  withComponentProps,
142
143
  withErrorBoundaryProps,
143
144
  withHydrateFallbackProps
144
- } from "./chunk-5KNZJZUH.mjs";
145
+ } from "./chunk-QUQL4437.mjs";
145
146
  export {
146
147
  Await,
147
148
  BrowserRouter,
@@ -243,6 +244,7 @@ export {
243
244
  setDevServerHooks as unstable_setDevServerHooks,
244
245
  usePrompt as unstable_usePrompt,
245
246
  useRoute as unstable_useRoute,
247
+ useRouterState as unstable_useRouterState,
246
248
  useActionData,
247
249
  useAsyncError,
248
250
  useAsyncValue,
@@ -1,4 +1,4 @@
1
- import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, o as RouteBranch, p as RouteManifest, U as UIMatch, T as To, q as HTMLFormMethod, F as FormEncType, r as Path, s as LoaderFunctionArgs, t as MiddlewareEnabled, u as AppLoadContext } from './data-BqZ2x964.js';
1
+ import { e as RouteObject, f as History, g as MaybePromise, c as RouterContextProvider, h as MapRoutePropertiesFunction, i as Action, L as Location, D as DataRouteMatch, j as Submission, k as RouteData, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, n as DataRouteObject, o as RouteBranch, p as RouteManifest, U as UIMatch, T as To, q as HTMLFormMethod, F as FormEncType, r as Path, s as LoaderFunctionArgs, t as MiddlewareEnabled, u as AppLoadContext } from './data-D4xhSy90.js';
2
2
 
3
3
  /**
4
4
  * A Router instance manages all navigation and data loading/mutations
@@ -480,6 +480,8 @@ type NavigationStates = {
480
480
  Idle: {
481
481
  state: "idle";
482
482
  location: undefined;
483
+ matches: undefined;
484
+ historyAction: undefined;
483
485
  formMethod: undefined;
484
486
  formAction: undefined;
485
487
  formEncType: undefined;
@@ -490,6 +492,8 @@ type NavigationStates = {
490
492
  Loading: {
491
493
  state: "loading";
492
494
  location: Location;
495
+ matches: DataRouteMatch[];
496
+ historyAction: Action;
493
497
  formMethod: Submission["formMethod"] | undefined;
494
498
  formAction: Submission["formAction"] | undefined;
495
499
  formEncType: Submission["formEncType"] | undefined;
@@ -500,6 +504,8 @@ type NavigationStates = {
500
504
  Submitting: {
501
505
  state: "submitting";
502
506
  location: Location;
507
+ matches: DataRouteMatch[];
508
+ historyAction: Action;
503
509
  formMethod: Submission["formMethod"];
504
510
  formAction: Submission["formAction"];
505
511
  formEncType: Submission["formEncType"];
@@ -706,4 +712,4 @@ type RequestHandlerInstrumentationInfo = Readonly<{
706
712
  context: ReadonlyContext | undefined;
707
713
  }>;
708
714
 
709
- export { type BlockerFunction as B, type ClientInstrumentation as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, type InstrumentRequestHandlerFunction as I, type Navigation as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type RouterState as d, type GetScrollRestorationKeyFunction as e, type StaticHandlerContext as f, type NavigationStates as g, type RouterSubscriber as h, type RouterNavigateOptions as i, type RouterFetchOptions as j, type RevalidationState as k, type ServerInstrumentation as l, type InstrumentRouterFunction as m, type InstrumentRouteFunction as n, type InstrumentationHandlerResult as o, IDLE_NAVIGATION as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type CreateStaticHandlerOptions as u };
715
+ export { type BlockerFunction as B, type ClientInstrumentation as C, type Fetcher as F, type GetScrollPositionFunction as G, type HydrationState as H, type InstrumentRequestHandlerFunction as I, type NavigationStates as N, type RouterInit as R, type StaticHandler as S, type Router as a, type Blocker as b, type RelativeRoutingType as c, type RouterState as d, type GetScrollRestorationKeyFunction as e, type StaticHandlerContext as f, type Navigation as g, type RouterSubscriber as h, type RouterNavigateOptions as i, type RouterFetchOptions as j, type RevalidationState as k, type ServerInstrumentation as l, type InstrumentRouterFunction as m, type InstrumentRouteFunction as n, type InstrumentationHandlerResult as o, IDLE_NAVIGATION as p, IDLE_FETCHER as q, IDLE_BLOCKER as r, createRouter as s, type FutureConfig as t, type CreateStaticHandlerOptions as u };
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../data-BVUf681J.mjs';
2
- import { R as RouteFiles, P as Pages } from '../../register-Df8okEea.mjs';
1
+ import { R as RouteModule, e as LinkDescriptor, L as Location, F as Func, f as Pretty, g as MetaDescriptor, G as GetLoaderData, h as ServerDataFunctionArgs, i as MiddlewareNextFunction, j as ClientDataFunctionArgs, D as DataStrategyResult, k as ServerDataFrom, N as Normalize, l as GetActionData } from '../../data-U8FS-wNn.mjs';
2
+ import { R as RouteFiles, P as Pages } from '../../register-CqK96Zfk.mjs';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, v as LinkDescriptor, L as Location, w as Func, x as Pretty, y as MetaDescriptor, G as GetLoaderData, z as ServerDataFunctionArgs, B as MiddlewareNextFunction, E as ClientDataFunctionArgs, I as DataStrategyResult, J as ServerDataFrom, N as Normalize, K as GetActionData } from '../../data-BqZ2x964.js';
2
- import { R as RouteFiles, P as Pages } from '../../register-Bsscfj79.js';
1
+ import { R as RouteModule, v as LinkDescriptor, L as Location, w as Func, x as Pretty, y as MetaDescriptor, G as GetLoaderData, z as ServerDataFunctionArgs, B as MiddlewareNextFunction, E as ClientDataFunctionArgs, I as DataStrategyResult, J as ServerDataFrom, N as Normalize, K as GetActionData } from '../../data-D4xhSy90.js';
2
+ import { R as RouteFiles, P as Pages } from '../../register-CNAx3TXj.js';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * react-router v7.15.0
2
+ * react-router v7.16.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.15.0
2
+ * react-router v7.16.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './data-BqZ2x964.js';
1
+ import { R as RouteModule } from './data-D4xhSy90.js';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './data-BVUf681J.mjs';
1
+ import { R as RouteModule } from './data-U8FS-wNn.mjs';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './instrumentation-DlJ2QV7d.js';
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-BqZ2x964.js';
2
+ import { R as RouterInit } from './instrumentation-1q4YhLGP.js';
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-D4xhSy90.js';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './context-BQs41HrG.mjs';
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-BVUf681J.mjs';
2
+ import { R as RouterInit } from './context-m8rizgnE.mjs';
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-U8FS-wNn.mjs';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {
@@ -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.15.0
2
+ * react-router v7.16.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkAM3XM4LSjs = require('./chunk-AM3XM4LS.js');
17
+ var _chunkY7DNFQZPjs = require('./chunk-Y7DNFQZP.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 = _chunkAM3XM4LSjs.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkY7DNFQZPjs.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 (_chunkAM3XM4LSjs.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkY7DNFQZPjs.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 (_chunkAM3XM4LSjs.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkY7DNFQZPjs.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
- _chunkAM3XM4LSjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkY7DNFQZPjs.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 = _chunkAM3XM4LSjs.useRouteError.call(void 0, );
149
+ let error = _chunkY7DNFQZPjs.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.15.0
2
+ * react-router v7.16.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -37,6 +37,7 @@ import {
37
37
  getStaticContextFromError,
38
38
  instrumentHandler,
39
39
  isDataWithResponseInit,
40
+ isMutationMethod,
40
41
  isRedirectResponse,
41
42
  isRedirectStatusCode,
42
43
  isResponse,
@@ -53,7 +54,7 @@ import {
53
54
  withComponentProps,
54
55
  withErrorBoundaryProps,
55
56
  withHydrateFallbackProps
56
- } from "./chunk-GM3PW4GX.mjs";
57
+ } from "./chunk-Q65P7S7Y.mjs";
57
58
 
58
59
  // lib/dom/ssr/server.tsx
59
60
  import * as React from "react";
@@ -143,7 +144,7 @@ function createRoutesStub(routes, _context) {
143
144
  future: {
144
145
  v8_passThroughRequests: future?.v8_passThroughRequests === true,
145
146
  v8_middleware: future?.v8_middleware === true,
146
- unstable_trailingSlashAwareDataRequests: future?.unstable_trailingSlashAwareDataRequests === true
147
+ v8_trailingSlashAwareDataRequests: future?.v8_trailingSlashAwareDataRequests === true
147
148
  },
148
149
  manifest: {
149
150
  routes: {},
@@ -266,7 +267,7 @@ var unsign = async (cookie, secret) => {
266
267
  let signature = byteStringToUint8Array(atob(hash));
267
268
  let valid = await crypto.subtle.verify("HMAC", key, signature, data2);
268
269
  return valid ? value : false;
269
- } catch (error) {
270
+ } catch (e) {
270
271
  return false;
271
272
  }
272
273
  };
@@ -358,7 +359,7 @@ function encodeData(value) {
358
359
  function decodeData(value) {
359
360
  try {
360
361
  return JSON.parse(decodeURIComponent(myEscape(atob(value))));
361
- } catch (error) {
362
+ } catch (e) {
362
363
  return {};
363
364
  }
364
365
  }
@@ -855,7 +856,7 @@ function getNormalizedPath(request, basename, future) {
855
856
  basename = basename || "/";
856
857
  let url = new URL(request.url);
857
858
  let pathname = url.pathname;
858
- if (future?.unstable_trailingSlashAwareDataRequests) {
859
+ if (future?.v8_trailingSlashAwareDataRequests) {
859
860
  if (pathname.endsWith("/_.data")) {
860
861
  pathname = pathname.replace(/_\.data$/, "");
861
862
  } else {
@@ -1251,7 +1252,7 @@ function derive(build, mode) {
1251
1252
  build.routeDiscovery.manifestPath,
1252
1253
  build.basename
1253
1254
  );
1254
- if (requestUrl.pathname === manifestUrl) {
1255
+ if (build.routeDiscovery.mode === "lazy" && requestUrl.pathname === manifestUrl) {
1255
1256
  try {
1256
1257
  let res = await handleManifestRequest(
1257
1258
  build,
@@ -1443,7 +1444,7 @@ async function handleManifestRequest(build, dataRoutes, branches, url) {
1443
1444
  async function handleSingleFetchRequest(serverMode, build, staticHandler, request, normalizedPath, loadContext, handleError) {
1444
1445
  let handlerUrl = new URL(request.url);
1445
1446
  handlerUrl.pathname = normalizedPath;
1446
- let response = request.method !== "GET" ? await singleFetchAction(
1447
+ let response = isMutationMethod(request.method) ? await singleFetchAction(
1447
1448
  build,
1448
1449
  serverMode,
1449
1450
  staticHandler,
@@ -1464,7 +1465,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
1464
1465
  }
1465
1466
  async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
1466
1467
  try {
1467
- if (request.method === "POST") {
1468
+ if (isMutationMethod(request.method)) {
1468
1469
  try {
1469
1470
  throwIfPotentialCSRFAttack(
1470
1471
  request.headers,
@@ -1927,7 +1928,7 @@ async function writeRSCStream(rscStream, controller) {
1927
1928
  JSON.stringify(decoder.decode(chunk, { stream: true })),
1928
1929
  controller
1929
1930
  );
1930
- } catch (err) {
1931
+ } catch (e) {
1931
1932
  let base64 = JSON.stringify(btoa(String.fromCodePoint(...chunk)));
1932
1933
  writeChunk(
1933
1934
  `Uint8Array.from(atob(${base64}), m => m.codePointAt(0))`,
@@ -2253,9 +2254,9 @@ async function routeRSCServerRequest({
2253
2254
  statusText,
2254
2255
  headers
2255
2256
  });
2256
- } catch (reason) {
2257
- if (reason instanceof Response) {
2258
- return reason;
2257
+ } catch (error) {
2258
+ if (error instanceof Response) {
2259
+ return error;
2259
2260
  }
2260
2261
  if (renderRedirect) {
2261
2262
  return new Response(`Redirect: ${renderRedirect.location}`, {
@@ -2266,8 +2267,8 @@ async function routeRSCServerRequest({
2266
2267
  });
2267
2268
  }
2268
2269
  try {
2269
- reason = renderError ?? reason;
2270
- let [status, statusText] = isRouteErrorResponse(reason) ? [reason.status, reason.statusText] : [500, ""];
2270
+ let normalizedError = renderError ?? error;
2271
+ let [status, statusText] = isRouteErrorResponse(normalizedError) ? [normalizedError.status, normalizedError.statusText] : [500, ""];
2271
2272
  let retryRedirect;
2272
2273
  let reactHeaders = new Headers();
2273
2274
  const html = await renderHTML(
@@ -2279,7 +2280,7 @@ async function routeRSCServerRequest({
2279
2280
  (payload) => Object.assign(payload, {
2280
2281
  status,
2281
2282
  errors: deepestRenderedBoundaryId ? {
2282
- [deepestRenderedBoundaryId]: reason
2283
+ [deepestRenderedBoundaryId]: normalizedError
2283
2284
  } : {}
2284
2285
  })
2285
2286
  );
@@ -2302,19 +2303,19 @@ async function routeRSCServerRequest({
2302
2303
  });
2303
2304
  },
2304
2305
  {
2305
- onError(error) {
2306
- if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
2307
- retryRedirect = decodeRedirectErrorDigest(error.digest);
2306
+ onError(error2) {
2307
+ if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
2308
+ retryRedirect = decodeRedirectErrorDigest(error2.digest);
2308
2309
  if (retryRedirect) {
2309
- return error.digest;
2310
+ return error2.digest;
2310
2311
  }
2311
2312
  let routeErrorResponse = decodeRouteErrorResponseDigest(
2312
- error.digest
2313
+ error2.digest
2313
2314
  );
2314
2315
  if (routeErrorResponse) {
2315
2316
  status = routeErrorResponse.status;
2316
2317
  statusText = routeErrorResponse.statusText;
2317
- return error.digest;
2318
+ return error2.digest;
2318
2319
  }
2319
2320
  }
2320
2321
  },
@@ -2364,9 +2365,9 @@ async function routeRSCServerRequest({
2364
2365
  statusText,
2365
2366
  headers
2366
2367
  });
2367
- } catch {
2368
+ } catch (error2) {
2368
2369
  }
2369
- throw reason;
2370
+ throw error;
2370
2371
  }
2371
2372
  }
2372
2373
  function RSCStaticRouter({ getPayload }) {
@@ -2450,7 +2451,7 @@ function RSCStaticRouter({ getPayload }) {
2450
2451
  // These flags have no runtime impact so can always be false. If we add
2451
2452
  // flags that drive runtime behavior they'll need to be proxied through.
2452
2453
  v8_middleware: false,
2453
- unstable_trailingSlashAwareDataRequests: true,
2454
+ v8_trailingSlashAwareDataRequests: true,
2454
2455
  // always on for RSC
2455
2456
  v8_passThroughRequests: true
2456
2457
  // always on for RSC