react-router 7.10.1 → 7.11.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 (68) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/development/{browser-BpxEZgZC.d.ts → browser-Cv4JZyZ5.d.mts} +4 -3
  3. package/dist/{production/browser-BpxEZgZC.d.ts → development/browser-o-qhcuhA.d.ts} +4 -3
  4. package/dist/{production/chunk-B3F6YMOF.js → development/chunk-2JY4UAJA.js} +111 -121
  5. package/dist/{production/chunk-YO5R3LGQ.js → development/chunk-GNDLROV6.js} +7 -7
  6. package/dist/development/{chunk-WWGJGFF6.mjs → chunk-JMJ3UQ3L.mjs} +231 -74
  7. package/dist/development/{chunk-RBZI3ZHD.js → chunk-SZQUWNVJ.js} +279 -110
  8. package/dist/development/{chunk-PMGK554W.mjs → chunk-YNUBSHFH.mjs} +147 -38
  9. package/dist/development/dom-export.d.mts +11 -10
  10. package/dist/development/dom-export.d.ts +12 -11
  11. package/dist/development/dom-export.js +30 -31
  12. package/dist/development/dom-export.mjs +6 -7
  13. package/dist/{production/index-react-server-client-CCjKYJTH.d.ts → development/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  14. package/dist/development/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +4 -2
  20. package/dist/development/index-react-server.d.ts +4 -2
  21. package/dist/development/index-react-server.js +72 -19
  22. package/dist/development/index-react-server.mjs +72 -19
  23. package/dist/development/index.d.mts +17 -16
  24. package/dist/development/index.d.ts +17 -16
  25. package/dist/development/index.js +220 -111
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-BB0wRuqz.d.ts → development/instrumentation-BlrVzjbg.d.ts} +30 -15
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  33. package/dist/development/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  34. package/dist/development/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  35. package/dist/{development/browser-C5z6FZmz.d.mts → production/browser-Cv4JZyZ5.d.mts} +4 -3
  36. package/dist/production/{browser-C5z6FZmz.d.mts → browser-o-qhcuhA.d.ts} +4 -3
  37. package/dist/production/{chunk-UQPBOMFP.js → chunk-2HFJAX7U.js} +279 -110
  38. package/dist/{development/chunk-FKYGG5Z2.js → production/chunk-BEXOWXJO.js} +7 -7
  39. package/dist/production/{chunk-TDCOAFPJ.mjs → chunk-E6GYEQUT.mjs} +147 -38
  40. package/dist/production/{chunk-ANIOYBQK.mjs → chunk-TINMVEA2.mjs} +231 -74
  41. package/dist/{development/chunk-HMTWJNYB.js → production/chunk-ZMYPVUNZ.js} +111 -121
  42. package/dist/production/dom-export.d.mts +11 -10
  43. package/dist/production/dom-export.d.ts +12 -11
  44. package/dist/production/dom-export.js +30 -31
  45. package/dist/production/dom-export.mjs +6 -7
  46. package/dist/{development/index-react-server-client-CCjKYJTH.d.ts → production/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  47. package/dist/production/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +4 -2
  53. package/dist/production/index-react-server.d.ts +4 -2
  54. package/dist/production/index-react-server.js +72 -19
  55. package/dist/production/index-react-server.mjs +72 -19
  56. package/dist/production/index.d.mts +17 -16
  57. package/dist/production/index.d.ts +17 -16
  58. package/dist/production/index.js +220 -111
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-BB0wRuqz.d.ts → production/instrumentation-BlrVzjbg.d.ts} +30 -15
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  66. package/dist/production/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  67. package/dist/production/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  68. package/package.json +5 -4
@@ -6,7 +6,7 @@ export { BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLi
6
6
  import { serialize, parse } from 'cookie';
7
7
 
8
8
  /**
9
- * react-router v7.10.1
9
+ * react-router v7.11.0
10
10
  *
11
11
  * Copyright (c) Remix Software Inc.
12
12
  *
@@ -1829,7 +1829,7 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties, manifest, request,
1829
1829
  handler: lazyRoutePromises.lazyHandlerPromise
1830
1830
  };
1831
1831
  }
1832
- function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null) {
1832
+ function getDataStrategyMatch(mapRouteProperties, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
1833
1833
  let isUsingNewApi = false;
1834
1834
  let _lazyPromises = getDataStrategyMatchLazyPromises(
1835
1835
  mapRouteProperties,
@@ -2372,6 +2372,43 @@ function prependCookies(parentHeaders, childHeaders) {
2372
2372
  }
2373
2373
  }
2374
2374
  var SINGLE_FETCH_REDIRECT_STATUS = 202;
2375
+
2376
+ // lib/errors.ts
2377
+ var ERROR_DIGEST_BASE = "REACT_ROUTER_ERROR";
2378
+ var ERROR_DIGEST_REDIRECT = "REDIRECT";
2379
+ var ERROR_DIGEST_ROUTE_ERROR_RESPONSE = "ROUTE_ERROR_RESPONSE";
2380
+ function createRedirectErrorDigest(response) {
2381
+ return `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:${JSON.stringify({
2382
+ status: response.status,
2383
+ statusText: response.statusText,
2384
+ location: response.headers.get("Location"),
2385
+ reloadDocument: response.headers.get("X-Remix-Reload-Document") === "true",
2386
+ replace: response.headers.get("X-Remix-Replace") === "true"
2387
+ })}`;
2388
+ }
2389
+ function createRouteErrorResponseDigest(response) {
2390
+ let status = 500;
2391
+ let statusText = "";
2392
+ let data2;
2393
+ if (isDataWithResponseInit(response)) {
2394
+ status = response.init?.status ?? status;
2395
+ statusText = response.init?.statusText ?? statusText;
2396
+ data2 = response.data;
2397
+ } else {
2398
+ status = response.status;
2399
+ statusText = response.statusText;
2400
+ data2 = void 0;
2401
+ }
2402
+ return `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:${JSON.stringify(
2403
+ {
2404
+ status,
2405
+ statusText,
2406
+ data: data2
2407
+ }
2408
+ )}`;
2409
+ }
2410
+
2411
+ // lib/rsc/server.rsc.ts
2375
2412
  var Outlet = Outlet$1;
2376
2413
  var WithComponentProps = UNSAFE_WithComponentProps;
2377
2414
  var WithErrorBoundaryProps = UNSAFE_WithErrorBoundaryProps;
@@ -2443,8 +2480,28 @@ async function matchRSCServerRequest({
2443
2480
  routes,
2444
2481
  generateResponse
2445
2482
  }) {
2446
- let requestUrl = new URL(request.url);
2483
+ let url = new URL(request.url);
2484
+ basename = basename || "/";
2485
+ let normalizedPath = url.pathname;
2486
+ if (stripBasename(normalizedPath, basename) === "/_root.rsc") {
2487
+ normalizedPath = basename;
2488
+ } else if (normalizedPath.endsWith(".rsc")) {
2489
+ normalizedPath = normalizedPath.replace(/\.rsc$/, "");
2490
+ }
2491
+ if (stripBasename(normalizedPath, basename) !== "/" && normalizedPath.endsWith("/")) {
2492
+ normalizedPath = normalizedPath.slice(0, -1);
2493
+ }
2494
+ url.pathname = normalizedPath;
2495
+ basename = basename.length > normalizedPath.length ? normalizedPath : basename;
2496
+ let routerRequest = new Request(url.toString(), {
2497
+ method: request.method,
2498
+ headers: request.headers,
2499
+ body: request.body,
2500
+ signal: request.signal,
2501
+ duplex: request.body ? "half" : void 0
2502
+ });
2447
2503
  const temporaryReferences = createTemporaryReferenceSet();
2504
+ const requestUrl = new URL(request.url);
2448
2505
  if (isManifestRequest(requestUrl)) {
2449
2506
  let response2 = await generateManifestResponse(
2450
2507
  routes,
@@ -2456,18 +2513,6 @@ async function matchRSCServerRequest({
2456
2513
  return response2;
2457
2514
  }
2458
2515
  let isDataRequest = isReactServerRequest(requestUrl);
2459
- const url = new URL(request.url);
2460
- let routerRequest = request;
2461
- if (isDataRequest) {
2462
- url.pathname = url.pathname.replace(/(_root)?\.rsc$/, "");
2463
- routerRequest = new Request(url.toString(), {
2464
- method: request.method,
2465
- headers: request.headers,
2466
- body: request.body,
2467
- signal: request.signal,
2468
- duplex: request.body ? "half" : void 0
2469
- });
2470
- }
2471
2516
  let matches = matchRoutes(routes, url.pathname, basename);
2472
2517
  if (matches) {
2473
2518
  await Promise.all(matches.map((m) => explodeLazyRoute(m.route)));
@@ -2539,7 +2584,7 @@ async function generateManifestResponse(routes, basename, request, generateRespo
2539
2584
  }),
2540
2585
  payload
2541
2586
  },
2542
- { temporaryReferences }
2587
+ { temporaryReferences, onError: defaultOnError }
2543
2588
  );
2544
2589
  }
2545
2590
  function prependBasenameToRedirectResponse(response, basename = "/") {
@@ -2817,7 +2862,7 @@ function generateRedirectResponse(response, actionResult, basename, isDataReques
2817
2862
  headers,
2818
2863
  payload
2819
2864
  },
2820
- { temporaryReferences }
2865
+ { temporaryReferences, onError: defaultOnError }
2821
2866
  );
2822
2867
  }
2823
2868
  async function generateStaticContextResponse(routes, basename, generateResponse, statusCode, routeIdsToLoad, isDataRequest, isSubmission, actionResult, formState, staticContext, temporaryReferences, skipRevalidation, sideEffectRedirectHeaders) {
@@ -2847,7 +2892,7 @@ async function generateStaticContextResponse(routes, basename, generateResponse,
2847
2892
  headers.delete("Content-Length");
2848
2893
  const baseRenderPayload = {
2849
2894
  type: "render",
2850
- basename,
2895
+ basename: staticContext.basename,
2851
2896
  actionData: staticContext.actionData,
2852
2897
  errors: staticContext.errors,
2853
2898
  loaderData: staticContext.loaderData,
@@ -2884,7 +2929,7 @@ async function generateStaticContextResponse(routes, basename, generateResponse,
2884
2929
  headers,
2885
2930
  payload
2886
2931
  },
2887
- { temporaryReferences }
2932
+ { temporaryReferences, onError: defaultOnError }
2888
2933
  );
2889
2934
  }
2890
2935
  async function getRenderPayload(baseRenderPayload, routes, basename, routeIdsToLoad, isDataRequest, staticContext) {
@@ -3095,6 +3140,14 @@ function isReactServerRequest(url) {
3095
3140
  function isManifestRequest(url) {
3096
3141
  return url.pathname.endsWith(".manifest");
3097
3142
  }
3143
+ function defaultOnError(error) {
3144
+ if (isRedirectResponse(error)) {
3145
+ return createRedirectErrorDigest(error);
3146
+ }
3147
+ if (isResponse(error) || isDataWithResponseInit(error)) {
3148
+ return createRouteErrorResponseDigest(error);
3149
+ }
3150
+ }
3098
3151
  function isClientReference(x) {
3099
3152
  try {
3100
3153
  return x.$$typeof === Symbol.for("react.client.reference");
@@ -1,15 +1,15 @@
1
- import { p as Router, q as RouteModules, r as DataStrategyFunction, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, T as To, v as NavigateOptions, B as BlockerFunction, w as Blocker, x as SerializeFrom, y as RelativeRoutingType, L as Location, z as ParamParseKey, E as Path, I as PathPattern, J as PathMatch, U as UIMatch, K as Navigation, O as Action, P as Params, Q as RouteObject, G as GetLoaderData, o as GetActionData, V as InitialEntry, W as HydrationState, X as IndexRouteObject, Y as RouteComponentType, Z as HydrateFallbackType, _ as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, $ as NonIndexRouteObject, a0 as Equal, a1 as RouterState, a2 as PatchRoutesOnNavigationFunction, a3 as DataRouteObject, a as ClientLoaderFunction } from './router-CwNp5l9u.mjs';
2
- export { ae as ActionFunctionArgs, b1 as Await, aS as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aN as DataRouteMatch, af as DataStrategyFunctionArgs, ag as DataStrategyMatch, D as DataStrategyResult, ai as ErrorResponse, a8 as Fetcher, aj as FormEncType, ak as FormMethod, bj as Future, a5 as GetScrollPositionFunction, a6 as GetScrollRestorationKeyFunction, al as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aD as IDLE_BLOCKER, aC as IDLE_FETCHER, aB as IDLE_NAVIGATION, aT as IndexRouteProps, aU as LayoutRouteProps, am as LazyRouteFunction, h as LinkDescriptor, an as LoaderFunctionArgs, b2 as MemoryRouter, aV as MemoryRouterOpts, aW as MemoryRouterProps, bg as MetaArgs, j as MetaDescriptor, ao as MiddlewareFunction, b3 as Navigate, aX as NavigateProps, a9 as NavigationStates, aO as Navigator, b4 as Outlet, aY as OutletProps, bh as PageLinkDescriptor, aP as PatchRoutesOnNavigationFunctionArgs, ap as PathParam, aZ as PathRouteProps, aq as RedirectFunction, ad as RevalidationState, b5 as Route, aQ as RouteMatch, a_ as RouteProps, b6 as Router, ar as RouterContext, ac as RouterFetchOptions, e as RouterInit, ab as RouterNavigateOptions, a$ as RouterProps, b7 as RouterProvider, f as RouterProviderProps, aa as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, as as ShouldRevalidateFunctionArgs, a4 as StaticHandler, a7 as StaticHandlerContext, aR as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, ah as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, at as createContext, b9 as createMemoryRouter, au as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aE as data, aF as generatePath, aG as isRouteErrorResponse, aH as matchPath, aI as matchRoutes, av as parsePath, aJ as redirect, aK as redirectDocument, bc as renderMatches, aL as replace, aM as resolvePath, u as unstable_ClientInstrumentation, g as unstable_ClientOnErrorFunction, ax as unstable_InstrumentRequestHandlerFunction, az as unstable_InstrumentRouteFunction, ay as unstable_InstrumentRouterFunction, aA as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, aw as unstable_ServerInstrumentation } from './router-CwNp5l9u.mjs';
1
+ import { p as Router, q as RouteModules, r as DataStrategyFunction, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, T as To, v as NavigateOptions, B as BlockerFunction, w as Blocker, x as SerializeFrom, y as RelativeRoutingType, L as Location, z as ParamParseKey, E as Path, I as PathPattern, J as PathMatch, U as UIMatch, K as Navigation, O as Action, P as Params, Q as RouteObject, G as GetLoaderData, o as GetActionData, V as InitialEntry, W as HydrationState, X as IndexRouteObject, Y as RouteComponentType, Z as HydrateFallbackType, _ as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, $ as NonIndexRouteObject, a0 as Equal, a1 as RouterState, a2 as PatchRoutesOnNavigationFunction, a3 as DataRouteObject, a as ClientLoaderFunction } from './router-5fbeEIMQ.mjs';
2
+ export { ae as ActionFunctionArgs, b1 as Await, aS as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, g as ClientOnErrorFunction, aN as DataRouteMatch, af as DataStrategyFunctionArgs, ag as DataStrategyMatch, D as DataStrategyResult, ai as ErrorResponse, a8 as Fetcher, aj as FormEncType, ak as FormMethod, bj as Future, a5 as GetScrollPositionFunction, a6 as GetScrollRestorationKeyFunction, al as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aD as IDLE_BLOCKER, aC as IDLE_FETCHER, aB as IDLE_NAVIGATION, aT as IndexRouteProps, aU as LayoutRouteProps, am as LazyRouteFunction, h as LinkDescriptor, an as LoaderFunctionArgs, b2 as MemoryRouter, aV as MemoryRouterOpts, aW as MemoryRouterProps, bg as MetaArgs, j as MetaDescriptor, ao as MiddlewareFunction, b3 as Navigate, aX as NavigateProps, a9 as NavigationStates, aO as Navigator, b4 as Outlet, aY as OutletProps, bh as PageLinkDescriptor, aP as PatchRoutesOnNavigationFunctionArgs, ap as PathParam, aZ as PathRouteProps, aq as RedirectFunction, ad as RevalidationState, b5 as Route, aQ as RouteMatch, a_ as RouteProps, b6 as Router, ar as RouterContext, ac as RouterFetchOptions, e as RouterInit, ab as RouterNavigateOptions, a$ as RouterProps, b7 as RouterProvider, f as RouterProviderProps, aa as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, as as ShouldRevalidateFunctionArgs, a4 as StaticHandler, a7 as StaticHandlerContext, aR as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, ah as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, at as createContext, b9 as createMemoryRouter, au as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aE as data, aF as generatePath, aG as isRouteErrorResponse, aH as matchPath, aI as matchRoutes, av as parsePath, aJ as redirect, aK as redirectDocument, bc as renderMatches, aL as replace, aM as resolvePath, u as unstable_ClientInstrumentation, ax as unstable_InstrumentRequestHandlerFunction, az as unstable_InstrumentRouteFunction, ay as unstable_InstrumentRouterFunction, aA as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, aw as unstable_ServerInstrumentation } from './router-5fbeEIMQ.mjs';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactElement } from 'react';
5
- import { a as RouteModules$1, P as Pages } from './register-C1RwVJAt.mjs';
6
- export { b as Register } from './register-C1RwVJAt.mjs';
7
- import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-CipGfVBI.mjs';
8
- export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-CipGfVBI.mjs';
5
+ import { a as RouteModules$1, P as Pages } from './register-DTJJbt1o.mjs';
6
+ export { b as Register } from './register-DTJJbt1o.mjs';
7
+ import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-P7VgYu6T.mjs';
8
+ export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-P7VgYu6T.mjs';
9
9
  import { ParseOptions, SerializeOptions } from 'cookie';
10
10
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
11
- import { e as RSCPayload, m as matchRSCServerRequest } from './browser-C5z6FZmz.mjs';
12
- export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-C5z6FZmz.mjs';
11
+ import { e as RSCPayload, m as matchRSCServerRequest } from './browser-Cv4JZyZ5.mjs';
12
+ export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-Cv4JZyZ5.mjs';
13
13
 
14
14
  declare const SingleFetchRedirectSymbol: unique symbol;
15
15
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -1236,7 +1236,7 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1236
1236
  *
1237
1237
  * routeRSCServerRequest({
1238
1238
  * request,
1239
- * fetchServer,
1239
+ * serverResponse,
1240
1240
  * createFromReadableStream,
1241
1241
  * async renderHTML(getPayload) {
1242
1242
  * const payload = getPayload();
@@ -1258,9 +1258,7 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1258
1258
  * @param opts Options
1259
1259
  * @param opts.createFromReadableStream Your `react-server-dom-xyz/client`'s
1260
1260
  * `createFromReadableStream` function, used to decode payloads from the server.
1261
- * @param opts.fetchServer A function that forwards a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
1262
- * to the [RSC](https://react.dev/reference/rsc/server-components) handler
1263
- * and returns a `Promise<Response>` containing a serialized {@link unstable_RSCPayload}.
1261
+ * @param opts.serverResponse A Response or partial response generated by the [RSC](https://react.dev/reference/rsc/server-components) handler containing a serialized {@link unstable_RSCPayload}.
1264
1262
  * @param opts.hydrate Whether to hydrate the server response with the RSC payload.
1265
1263
  * Defaults to `true`.
1266
1264
  * @param opts.renderHTML A function that renders the {@link unstable_RSCPayload} to
@@ -1270,11 +1268,14 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1270
1268
  * that either contains the [RSC](https://react.dev/reference/rsc/server-components)
1271
1269
  * payload for data requests, or renders the HTML for document requests.
1272
1270
  */
1273
- declare function routeRSCServerRequest({ request, fetchServer, createFromReadableStream, renderHTML, hydrate, }: {
1271
+ declare function routeRSCServerRequest({ request, serverResponse, createFromReadableStream, renderHTML, hydrate, }: {
1274
1272
  request: Request;
1275
- fetchServer: (request: Request) => Promise<Response>;
1273
+ serverResponse: Response;
1276
1274
  createFromReadableStream: SSRCreateFromReadableStreamFunction;
1277
- renderHTML: (getPayload: () => DecodedPayload) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
1275
+ renderHTML: (getPayload: () => DecodedPayload, options: {
1276
+ onError(error: unknown): string | undefined;
1277
+ onHeaders(headers: Headers): void;
1278
+ }) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
1278
1279
  hydrate?: boolean;
1279
1280
  }): Promise<Response>;
1280
1281
  /**
@@ -1304,7 +1305,7 @@ interface RSCStaticRouterProps {
1304
1305
  *
1305
1306
  * routeRSCServerRequest({
1306
1307
  * request,
1307
- * fetchServer,
1308
+ * serverResponse,
1308
1309
  * createFromReadableStream,
1309
1310
  * async renderHTML(getPayload) {
1310
1311
  * const payload = getPayload();
@@ -1,15 +1,15 @@
1
- import { n as Router, o as RouteModules, p as DataStrategyFunction, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, T as To, s as NavigateOptions, B as BlockerFunction, t as Blocker, v as SerializeFrom, w as RelativeRoutingType, L as Location, x as ParamParseKey, y as Path, z as PathPattern, E as PathMatch, U as UIMatch, I as Navigation, J as Action, P as Params, K as RouteObject, G as GetLoaderData, m as GetActionData, O as InitialEntry, Q as HydrationState, V as IndexRouteObject, W as RouteComponentType, X as HydrateFallbackType, Y as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, Z as NonIndexRouteObject, _ as Equal, $ as RouterState, a0 as PatchRoutesOnNavigationFunction, a1 as DataRouteObject, a as ClientLoaderFunction } from './instrumentation-BB0wRuqz.js';
2
- export { ac as ActionFunctionArgs, b1 as Await, aQ as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aL as DataRouteMatch, ad as DataStrategyFunctionArgs, ae as DataStrategyMatch, D as DataStrategyResult, ag as ErrorResponse, a6 as Fetcher, ah as FormEncType, ai as FormMethod, bj as Future, a3 as GetScrollPositionFunction, a4 as GetScrollRestorationKeyFunction, aj as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aB as IDLE_BLOCKER, aA as IDLE_FETCHER, az as IDLE_NAVIGATION, aR as IndexRouteProps, aT as LayoutRouteProps, ak as LazyRouteFunction, f as LinkDescriptor, al as LoaderFunctionArgs, b2 as MemoryRouter, aU as MemoryRouterOpts, aV as MemoryRouterProps, bg as MetaArgs, h as MetaDescriptor, am as MiddlewareFunction, b3 as Navigate, aW as NavigateProps, a7 as NavigationStates, aM as Navigator, b4 as Outlet, aX as OutletProps, bh as PageLinkDescriptor, aN as PatchRoutesOnNavigationFunctionArgs, an as PathParam, aY as PathRouteProps, ao as RedirectFunction, ab as RevalidationState, b5 as Route, aO as RouteMatch, aZ as RouteProps, b6 as Router, ap as RouterContext, aa as RouterFetchOptions, e as RouterInit, a9 as RouterNavigateOptions, a_ as RouterProps, b7 as RouterProvider, a$ as RouterProviderProps, a8 as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, aq as ShouldRevalidateFunctionArgs, a2 as StaticHandler, a5 as StaticHandlerContext, aP as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, af as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, ar as createContext, b9 as createMemoryRouter, as as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aC as data, aD as generatePath, aE as isRouteErrorResponse, aF as matchPath, aG as matchRoutes, at as parsePath, aH as redirect, aI as redirectDocument, bc as renderMatches, aJ as replace, aK as resolvePath, u as unstable_ClientInstrumentation, aS as unstable_ClientOnErrorFunction, av as unstable_InstrumentRequestHandlerFunction, ax as unstable_InstrumentRouteFunction, aw as unstable_InstrumentRouterFunction, ay as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, au as unstable_ServerInstrumentation } from './instrumentation-BB0wRuqz.js';
1
+ import { n as Router, o as RouteModules, p as DataStrategyFunction, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, T as To, s as NavigateOptions, B as BlockerFunction, t as Blocker, v as SerializeFrom, w as RelativeRoutingType, L as Location, x as ParamParseKey, y as Path, z as PathPattern, E as PathMatch, U as UIMatch, I as Navigation, J as Action, P as Params, K as RouteObject, G as GetLoaderData, m as GetActionData, O as InitialEntry, Q as HydrationState, V as IndexRouteObject, W as RouteComponentType, X as HydrateFallbackType, Y as ErrorBoundaryType, d as LoaderFunction, A as ActionFunction, M as MetaFunction, b as LinksFunction, Z as NonIndexRouteObject, _ as Equal, $ as RouterState, a0 as PatchRoutesOnNavigationFunction, a1 as DataRouteObject, a as ClientLoaderFunction } from './instrumentation-BlrVzjbg.js';
2
+ export { ac as ActionFunctionArgs, b1 as Await, aQ as AwaitProps, C as ClientActionFunction, bd as ClientActionFunctionArgs, be as ClientLoaderFunctionArgs, aS as ClientOnErrorFunction, aL as DataRouteMatch, ad as DataStrategyFunctionArgs, ae as DataStrategyMatch, D as DataStrategyResult, ag as ErrorResponse, a6 as Fetcher, ah as FormEncType, ai as FormMethod, bj as Future, a3 as GetScrollPositionFunction, a4 as GetScrollRestorationKeyFunction, aj as HTMLFormMethod, bf as HeadersArgs, H as HeadersFunction, bi as HtmlLinkDescriptor, aB as IDLE_BLOCKER, aA as IDLE_FETCHER, az as IDLE_NAVIGATION, aR as IndexRouteProps, aT as LayoutRouteProps, ak as LazyRouteFunction, f as LinkDescriptor, al as LoaderFunctionArgs, b2 as MemoryRouter, aU as MemoryRouterOpts, aV as MemoryRouterProps, bg as MetaArgs, h as MetaDescriptor, am as MiddlewareFunction, b3 as Navigate, aW as NavigateProps, a7 as NavigationStates, aM as Navigator, b4 as Outlet, aX as OutletProps, bh as PageLinkDescriptor, aN as PatchRoutesOnNavigationFunctionArgs, an as PathParam, aY as PathRouteProps, ao as RedirectFunction, ab as RevalidationState, b5 as Route, aO as RouteMatch, aZ as RouteProps, b6 as Router, ap as RouterContext, aa as RouterFetchOptions, e as RouterInit, a9 as RouterNavigateOptions, a_ as RouterProps, b7 as RouterProvider, a$ as RouterProviderProps, a8 as RouterSubscriber, b8 as Routes, b0 as RoutesProps, S as ShouldRevalidateFunction, aq as ShouldRevalidateFunctionArgs, a2 as StaticHandler, a5 as StaticHandlerContext, aP as UNSAFE_AwaitContextProvider, bp as UNSAFE_DataRouterContext, bq as UNSAFE_DataRouterStateContext, af as UNSAFE_DataWithResponseInit, bo as UNSAFE_ErrorResponseImpl, br as UNSAFE_FetchersContext, bs as UNSAFE_LocationContext, bt as UNSAFE_NavigationContext, bu as UNSAFE_RouteContext, bv as UNSAFE_ViewTransitionContext, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps, bl as UNSAFE_createBrowserHistory, bn as UNSAFE_createRouter, bw as UNSAFE_hydrationRouteProperties, bm as UNSAFE_invariant, bx as UNSAFE_mapRouteProperties, bz as UNSAFE_withComponentProps, bD as UNSAFE_withErrorBoundaryProps, bB as UNSAFE_withHydrateFallbackProps, ar as createContext, b9 as createMemoryRouter, as as createPath, ba as createRoutesFromChildren, bb as createRoutesFromElements, aC as data, aD as generatePath, aE as isRouteErrorResponse, aF as matchPath, aG as matchRoutes, at as parsePath, aH as redirect, aI as redirectDocument, bc as renderMatches, aJ as replace, aK as resolvePath, u as unstable_ClientInstrumentation, av as unstable_InstrumentRequestHandlerFunction, ax as unstable_InstrumentRouteFunction, aw as unstable_InstrumentRouterFunction, ay as unstable_InstrumentationHandlerResult, bk as unstable_SerializesTo, au as unstable_ServerInstrumentation } from './instrumentation-BlrVzjbg.js';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactElement } from 'react';
5
- import { a as RouteModules$1, P as Pages } from './register-ODDAAYlf.js';
6
- export { b as Register } from './register-ODDAAYlf.js';
7
- import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-CCjKYJTH.js';
8
- export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-CCjKYJTH.js';
5
+ import { a as RouteModules$1, P as Pages } from './register-BGQUMCK4.js';
6
+ export { b as Register } from './register-BGQUMCK4.js';
7
+ import { A as AssetsManifest, S as ServerBuild, E as EntryContext, F as FutureConfig } from './index-react-server-client-Cv5Q9lf0.js';
8
+ export { l as BrowserRouter, B as BrowserRouterProps, D as DOMRouterOpts, a1 as DiscoverBehavior, c as FetcherFormProps, h as FetcherSubmitFunction, G as FetcherSubmitOptions, i as FetcherWithComponents, q as Form, d as FormProps, a2 as HandleDataRequestFunction, a3 as HandleDocumentRequestFunction, a4 as HandleErrorFunction, m as HashRouter, H as HashRouterProps, a as HistoryRouterProps, n as Link, L as LinkProps, X as Links, _ as LinksProps, W as Meta, p as NavLink, N as NavLinkProps, b as NavLinkRenderProps, P as ParamKeyValuePair, a0 as PrefetchBehavior, Z as PrefetchPageLinks, Y as Scripts, $ as ScriptsProps, r as ScrollRestoration, e as ScrollRestorationProps, a5 as ServerEntryModule, f as SetURLSearchParams, T as StaticRouter, M as StaticRouterProps, V as StaticRouterProvider, O as StaticRouterProviderProps, g as SubmitFunction, I as SubmitOptions, J as SubmitTarget, a6 as UNSAFE_FrameworkContext, a7 as UNSAFE_createClientRoutes, a8 as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, a9 as UNSAFE_shouldHydrateRouteLoader, aa as UNSAFE_useScrollRestoration, U as URLSearchParamsInit, j as createBrowserRouter, k as createHashRouter, K as createSearchParams, Q as createStaticHandler, R as createStaticRouter, o as unstable_HistoryRouter, z as unstable_usePrompt, y as useBeforeUnload, w as useFetcher, x as useFetchers, v as useFormAction, u as useLinkClickHandler, s as useSearchParams, t as useSubmit, C as useViewTransitionState } from './index-react-server-client-Cv5Q9lf0.js';
9
9
  import { ParseOptions, SerializeOptions } from 'cookie';
10
10
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
11
- import { e as RSCPayload, m as matchRSCServerRequest } from './browser-BpxEZgZC.js';
12
- export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-BpxEZgZC.js';
11
+ import { e as RSCPayload, m as matchRSCServerRequest } from './browser-o-qhcuhA.js';
12
+ export { B as unstable_BrowserCreateFromReadableStreamFunction, D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, E as unstable_EncodeReplyFunction, L as unstable_LoadServerActionFunction, g as unstable_RSCHydratedRouterProps, d as unstable_RSCManifestPayload, h as unstable_RSCMatch, f as unstable_RSCRenderPayload, l as unstable_RSCRouteConfig, k as unstable_RSCRouteConfigEntry, i as unstable_RSCRouteManifest, j as unstable_RSCRouteMatch } from './browser-o-qhcuhA.js';
13
13
 
14
14
  declare const SingleFetchRedirectSymbol: unique symbol;
15
15
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -1236,7 +1236,7 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1236
1236
  *
1237
1237
  * routeRSCServerRequest({
1238
1238
  * request,
1239
- * fetchServer,
1239
+ * serverResponse,
1240
1240
  * createFromReadableStream,
1241
1241
  * async renderHTML(getPayload) {
1242
1242
  * const payload = getPayload();
@@ -1258,9 +1258,7 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1258
1258
  * @param opts Options
1259
1259
  * @param opts.createFromReadableStream Your `react-server-dom-xyz/client`'s
1260
1260
  * `createFromReadableStream` function, used to decode payloads from the server.
1261
- * @param opts.fetchServer A function that forwards a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
1262
- * to the [RSC](https://react.dev/reference/rsc/server-components) handler
1263
- * and returns a `Promise<Response>` containing a serialized {@link unstable_RSCPayload}.
1261
+ * @param opts.serverResponse A Response or partial response generated by the [RSC](https://react.dev/reference/rsc/server-components) handler containing a serialized {@link unstable_RSCPayload}.
1264
1262
  * @param opts.hydrate Whether to hydrate the server response with the RSC payload.
1265
1263
  * Defaults to `true`.
1266
1264
  * @param opts.renderHTML A function that renders the {@link unstable_RSCPayload} to
@@ -1270,11 +1268,14 @@ type SSRCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>) =>
1270
1268
  * that either contains the [RSC](https://react.dev/reference/rsc/server-components)
1271
1269
  * payload for data requests, or renders the HTML for document requests.
1272
1270
  */
1273
- declare function routeRSCServerRequest({ request, fetchServer, createFromReadableStream, renderHTML, hydrate, }: {
1271
+ declare function routeRSCServerRequest({ request, serverResponse, createFromReadableStream, renderHTML, hydrate, }: {
1274
1272
  request: Request;
1275
- fetchServer: (request: Request) => Promise<Response>;
1273
+ serverResponse: Response;
1276
1274
  createFromReadableStream: SSRCreateFromReadableStreamFunction;
1277
- renderHTML: (getPayload: () => DecodedPayload) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
1275
+ renderHTML: (getPayload: () => DecodedPayload, options: {
1276
+ onError(error: unknown): string | undefined;
1277
+ onHeaders(headers: Headers): void;
1278
+ }) => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
1278
1279
  hydrate?: boolean;
1279
1280
  }): Promise<Response>;
1280
1281
  /**
@@ -1304,7 +1305,7 @@ interface RSCStaticRouterProps {
1304
1305
  *
1305
1306
  * routeRSCServerRequest({
1306
1307
  * request,
1307
- * fetchServer,
1308
+ * serverResponse,
1308
1309
  * createFromReadableStream,
1309
1310
  * async renderHTML(getPayload) {
1310
1311
  * const payload = getPayload();