react-router 0.0.0-experimental-d431f1b65 → 0.0.0-experimental-e5dac68cb

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 (31) hide show
  1. package/dist/development/{browser-Dr0PjLWi.d.mts → browser-Bh26Omrk.d.mts} +8 -0
  2. package/dist/development/{chunk-F37344ZN.mjs → chunk-USQXBNSR.mjs} +22 -41
  3. package/dist/development/dom-export.d.mts +2 -1
  4. package/dist/development/dom-export.js +1 -1
  5. package/dist/development/dom-export.mjs +2 -2
  6. package/dist/development/index.d.mts +3 -2
  7. package/dist/development/index.d.ts +8 -0
  8. package/dist/development/index.js +22 -41
  9. package/dist/development/index.mjs +2 -2
  10. package/dist/development/lib/types/internal.js +1 -1
  11. package/dist/development/lib/types/internal.mjs +1 -1
  12. package/dist/development/rsc-export.d.mts +14 -3
  13. package/dist/development/rsc-export.d.ts +14 -3
  14. package/dist/development/rsc-export.js +96 -46
  15. package/dist/development/rsc-export.mjs +94 -44
  16. package/dist/production/{browser-Dr0PjLWi.d.mts → browser-Bh26Omrk.d.mts} +8 -0
  17. package/dist/production/{chunk-LTAAPV3T.mjs → chunk-SB3D2OAU.mjs} +22 -41
  18. package/dist/production/dom-export.d.mts +2 -1
  19. package/dist/production/dom-export.js +1 -1
  20. package/dist/production/dom-export.mjs +2 -2
  21. package/dist/production/index.d.mts +3 -2
  22. package/dist/production/index.d.ts +8 -0
  23. package/dist/production/index.js +22 -41
  24. package/dist/production/index.mjs +2 -2
  25. package/dist/production/lib/types/internal.js +1 -1
  26. package/dist/production/lib/types/internal.mjs +1 -1
  27. package/dist/production/rsc-export.d.mts +14 -3
  28. package/dist/production/rsc-export.d.ts +14 -3
  29. package/dist/production/rsc-export.js +96 -46
  30. package/dist/production/rsc-export.mjs +94 -44
  31. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { aR as RouteManifest, aS as ServerRouteModule, h as MiddlewareEnabled, a9 as unstable_RouterContextProvider, i as AppLoadContext, Y as LoaderFunctionArgs, y as ActionFunctionArgs, b as RouteModules, S as StaticHandlerContext, H as HydrationState, k as DataRouteObject, l as ClientLoaderFunction, T as To, aq as NavigateOptions, s as BlockerFunction, B as Blocker, aT as SerializeFrom, r as RelativeRoutingType, L as Location, _ as ParamParseKey, m as Path, a2 as PathPattern, a0 as PathMatch, a7 as UIMatch, p as Navigation, aa as Action, $ as Params, a as Router$1, c as RouteObject, e as IndexRouteObject, X as LazyRouteFunction, N as NonIndexRouteObject, R as RouterInit, F as FutureConfig$1, I as InitialEntry, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, ar as Navigator, at as RouteMatch, W as HTMLFormMethod, U as FormEncType, aB as PageLinkDescriptor, aU as History, n as GetScrollRestorationKeyFunction, o as Fetcher, au as ClientActionFunction, g as LinksFunction, M as MetaFunction, a5 as ShouldRevalidateFunction } from './route-data-C8_wxpLo.mjs';
2
2
  import * as React from 'react';
3
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
4
 
4
5
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
5
6
  interface ServerRoute extends Route$1 {
@@ -2134,6 +2135,12 @@ declare function useViewTransitionState(to: To, opts?: {
2134
2135
  relative?: RelativeRoutingType;
2135
2136
  }): boolean;
2136
2137
 
2138
+ type ServerContext = {
2139
+ redirect?: Response;
2140
+ };
2141
+ declare global {
2142
+ var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
2143
+ }
2137
2144
  type RenderedRoute = {
2138
2145
  clientAction?: ClientActionFunction;
2139
2146
  clientLoader?: ClientLoaderFunction;
@@ -2185,6 +2192,7 @@ type ServerRedirectPayload = {
2185
2192
  location: string;
2186
2193
  replace: boolean;
2187
2194
  reload: boolean;
2195
+ actionResult?: Promise<unknown>;
2188
2196
  };
2189
2197
  type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
2190
2198
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4845,10 +4845,6 @@ var DataRouterContext = React.createContext(null);
4845
4845
  DataRouterContext.displayName = "DataRouter";
4846
4846
  var DataRouterStateContext = React.createContext(null);
4847
4847
  DataRouterStateContext.displayName = "DataRouterState";
4848
- var RSCRouterContext = React.createContext(false);
4849
- function useIsRSCRouterContext() {
4850
- return React.useContext(RSCRouterContext);
4851
- }
4852
4848
  var ViewTransitionContext = React.createContext({
4853
4849
  isTransitioning: false
4854
4850
  });
@@ -5022,7 +5018,6 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
5022
5018
  // router loaded. We can help them understand how to avoid that.
5023
5019
  `useRoutes() may be used only in the context of a <Router> component.`
5024
5020
  );
5025
- let isRSCRouterContext = useIsRSCRouterContext();
5026
5021
  let { navigator } = React2.useContext(NavigationContext);
5027
5022
  let { matches: parentMatches } = React2.useContext(RouteContext);
5028
5023
  let routeMatch = parentMatches[parentMatches.length - 1];
@@ -5088,8 +5083,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
5088
5083
  ),
5089
5084
  parentMatches,
5090
5085
  dataRouterState,
5091
- future,
5092
- isRSCRouterContext
5086
+ future
5093
5087
  );
5094
5088
  if (locationArg && renderedMatches) {
5095
5089
  return /* @__PURE__ */ React2.createElement(
@@ -5180,7 +5174,7 @@ function RenderedRoute({ routeContext, match, children }) {
5180
5174
  }
5181
5175
  return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children);
5182
5176
  }
5183
- function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null, isRSCRouterContext = false) {
5177
+ function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
5184
5178
  if (matches == null) {
5185
5179
  if (!dataRouterState) {
5186
5180
  return null;
@@ -5270,9 +5264,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5270
5264
  } else {
5271
5265
  children = outlet;
5272
5266
  }
5273
- if (isRSCRouterContext) {
5274
- children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5275
- }
5276
5267
  return /* @__PURE__ */ React2.createElement(
5277
5268
  RenderedRoute,
5278
5269
  {
@@ -5299,19 +5290,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5299
5290
  ) : getChildren();
5300
5291
  }, null);
5301
5292
  }
5302
- var RedirectBoundary = class extends React2.Component {
5303
- // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5304
- // If it's anything else, re-throw to bubble it up.
5305
- static getDerivedStateFromError(error) {
5306
- if (error === Symbol.for("react-router.redirect")) {
5307
- return null;
5308
- }
5309
- throw error;
5310
- }
5311
- render() {
5312
- return this.props.children;
5313
- }
5314
- };
5315
5293
  function getDataRouterConsoleError(hookName) {
5316
5294
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5317
5295
  }
@@ -8804,7 +8782,7 @@ function mergeRefs(...refs) {
8804
8782
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8805
8783
  try {
8806
8784
  if (isBrowser) {
8807
- window.__reactRouterVersion = "0.0.0-experimental-d431f1b65";
8785
+ window.__reactRouterVersion = "0.0.0-experimental-e5dac68cb";
8808
8786
  }
8809
8787
  } catch (e) {
8810
8788
  }
@@ -11646,20 +11624,10 @@ function createCallServer({
11646
11624
  window.location.href = payload.location;
11647
11625
  return;
11648
11626
  }
11649
- let reject;
11650
- const promise = new Promise((resolve, rejectFn) => {
11651
- reject = rejectFn;
11652
- });
11653
- const unsubscribe = window.__router.subscribe(({ navigation }) => {
11654
- if (navigation.state === "idle") {
11655
- unsubscribe();
11656
- reject(Symbol.for("react-router.redirect"));
11657
- }
11658
- });
11659
11627
  window.__router.navigate(payload.location, {
11660
11628
  replace: payload.replace
11661
11629
  });
11662
- return promise;
11630
+ return payload.actionResult;
11663
11631
  }
11664
11632
  if (payload.type !== "action") {
11665
11633
  throw new Error("Unexpected payload type");
@@ -12000,7 +11968,7 @@ function RSCHydratedRouter({
12000
11968
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
12001
11969
  routeModules: {}
12002
11970
  };
12003
- return /* @__PURE__ */ React15.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
11971
+ return /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync })));
12004
11972
  }
12005
11973
  function createRouteFromServerManifest(match, payload) {
12006
11974
  let hasInitialData = payload && match.id in payload.loaderData;
@@ -12098,10 +12066,23 @@ var nextPaths2 = /* @__PURE__ */ new Set();
12098
12066
  var discoveredPathsMaxSize2 = 1e3;
12099
12067
  var discoveredPaths2 = /* @__PURE__ */ new Set();
12100
12068
  var URL_LIMIT2 = 7680;
12101
- async function fetchAndApplyManifestPatches2(paths, decode2, fetchImplementation, signal) {
12069
+ function getManifestUrl(paths) {
12070
+ if (paths.length === 0) {
12071
+ return null;
12072
+ }
12073
+ if (paths.length === 1) {
12074
+ return new URL(`${paths[0]}.manifest`, window.location.origin);
12075
+ }
12102
12076
  let basename = (window.__router.basename ?? "").replace(/^\/|\/$/g, "");
12103
12077
  let url = new URL(`${basename}/.manifest`, window.location.origin);
12104
12078
  paths.sort().forEach((path) => url.searchParams.append("p", path));
12079
+ return url;
12080
+ }
12081
+ async function fetchAndApplyManifestPatches2(paths, decode2, fetchImplementation, signal) {
12082
+ let url = getManifestUrl(paths);
12083
+ if (url == null) {
12084
+ return;
12085
+ }
12105
12086
  if (url.toString().length > URL_LIMIT2) {
12106
12087
  nextPaths2.clear();
12107
12088
  return;
@@ -12363,7 +12344,7 @@ function RSCStaticRouter({
12363
12344
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
12364
12345
  routeModules: {}
12365
12346
  };
12366
- return /* @__PURE__ */ React16.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
12347
+ return /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
12367
12348
  StaticRouterProvider,
12368
12349
  {
12369
12350
  context,
@@ -12371,7 +12352,7 @@ function RSCStaticRouter({
12371
12352
  hydrate: false,
12372
12353
  nonce: payload.nonce
12373
12354
  }
12374
- ))));
12355
+ )));
12375
12356
  }
12376
12357
  function isReactServerRequest(url) {
12377
12358
  return url.pathname.endsWith(".rsc");
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './browser-Dr0PjLWi.mjs';
2
+ import { R as RouterProviderProps$1 } from './browser-Bh26Omrk.mjs';
3
3
  import { R as RouterInit } from './route-data-C8_wxpLo.mjs';
4
+ import 'node:async_hooks';
4
5
 
5
6
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
6
7
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -26,7 +26,7 @@ import {
26
26
  invariant,
27
27
  mapRouteProperties,
28
28
  useFogOFWarDiscovery
29
- } from "./chunk-F37344ZN.mjs";
29
+ } from "./chunk-USQXBNSR.mjs";
30
30
 
31
31
  // lib/dom-export/dom-router-provider.tsx
32
32
  import * as React from "react";
@@ -1,13 +1,14 @@
1
1
  import { a as Router, b as RouteModules, D as DataStrategyFunction, L as Location, S as StaticHandlerContext, c as RouteObject, C as CreateStaticHandlerOptions$1, d as StaticHandler, F as FutureConfig, I as InitialEntry, H as HydrationState, e as IndexRouteObject, f as LoaderFunction, A as ActionFunction, M as MetaFunction, g as LinksFunction, N as NonIndexRouteObject, u as unstable_InitialContext, h as MiddlewareEnabled, i as AppLoadContext, E as Equal, j as RouterState, P as PatchRoutesOnNavigationFunction, k as DataRouteObject, l as ClientLoaderFunction, m as Path } from './route-data-C8_wxpLo.mjs';
2
2
  export { y as ActionFunctionArgs, B as Blocker, s as BlockerFunction, au as ClientActionFunction, av as ClientActionFunctionArgs, aw as ClientLoaderFunctionArgs, ap as DataRouteMatch, z as DataStrategyFunctionArgs, J as DataStrategyMatch, K as DataStrategyResult, Q as ErrorResponse, o as Fetcher, U as FormEncType, V as FormMethod, aE as Future, G as GetScrollPositionFunction, n as GetScrollRestorationKeyFunction, W as HTMLFormMethod, ax as HeadersArgs, ay as HeadersFunction, aC as HtmlLinkDescriptor, af as IDLE_BLOCKER, ae as IDLE_FETCHER, ad as IDLE_NAVIGATION, X as LazyRouteFunction, aD as LinkDescriptor, Y as LoaderFunctionArgs, az as MetaArgs, aA as MetaDescriptor, aq as NavigateOptions, p as Navigation, q as NavigationStates, aa as NavigationType, ar as Navigator, aB as PageLinkDescriptor, _ as ParamParseKey, $ as Params, as as PatchRoutesOnNavigationFunctionArgs, a0 as PathMatch, a1 as PathParam, a2 as PathPattern, a3 as RedirectFunction, r as RelativeRoutingType, x as RevalidationState, at as RouteMatch, w as RouterFetchOptions, R as RouterInit, v as RouterNavigateOptions, t as RouterSubscriber, a5 as ShouldRevalidateFunction, a6 as ShouldRevalidateFunctionArgs, T as To, a7 as UIMatch, aK as UNSAFE_DataRouterContext, aL as UNSAFE_DataRouterStateContext, O as UNSAFE_DataWithResponseInit, aJ as UNSAFE_ErrorResponseImpl, aM as UNSAFE_FetchersContext, aN as UNSAFE_LocationContext, aO as UNSAFE_NavigationContext, aP as UNSAFE_RouteContext, aQ as UNSAFE_ViewTransitionContext, aG as UNSAFE_createBrowserHistory, aI as UNSAFE_createRouter, aH as UNSAFE_invariant, ab as createPath, ag as data, ah as generatePath, ai as isRouteErrorResponse, aj as matchPath, ak as matchRoutes, ac as parsePath, al as redirect, am as redirectDocument, an as replace, ao as resolvePath, Z as unstable_MiddlewareFunction, a4 as unstable_RouterContext, a9 as unstable_RouterContextProvider, aF as unstable_SerializesTo, a8 as unstable_createContext } from './route-data-C8_wxpLo.mjs';
3
- import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, a as RouteComponentType, H as HydrateFallbackType, b as ErrorBoundaryType, S as ServerBuild, c as ServerPayload } from './browser-Dr0PjLWi.mjs';
4
- export { i as Await, d as AwaitProps, ag as BrowserRouter, a0 as BrowserRouterProps, a1 as DOMRouterOpts, a7 as FetcherFormProps, ac as FetcherSubmitFunction, aw as FetcherSubmitOptions, ad as FetcherWithComponents, al as Form, a8 as FormProps, aH as HandleDataRequestFunction, aI as HandleDocumentRequestFunction, aJ as HandleErrorFunction, ah as HashRouter, a2 as HashRouterProps, a3 as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, ai as Link, a4 as LinkProps, aD as Links, j as MemoryRouter, M as MemoryRouterOpts, e as MemoryRouterProps, aC as Meta, ak as NavLink, a5 as NavLinkProps, a6 as NavLinkRenderProps, k as Navigate, u as NavigateFunction, N as NavigateProps, l as Outlet, O as OutletProps, ax as ParamKeyValuePair, P as PathRouteProps, aF as PrefetchPageLinks, m as Route, f as RouteProps, n as Router, g as RouterProps, o as RouterProvider, R as RouterProviderProps, p as Routes, h as RoutesProps, aE as Scripts, aG as ScriptsProps, am as ScrollRestoration, a9 as ScrollRestorationProps, aK as ServerEntryModule, aa as SetURLSearchParams, ab as SubmitFunction, ay as SubmitOptions, aA as SubmitTarget, aV as UNSAFE_FrameworkContext, aW as UNSAFE_createClientRoutes, aX as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, aQ as UNSAFE_hydrationRouteProperties, aR as UNSAFE_mapRouteProperties, aY as UNSAFE_shouldHydrateRouteLoader, aZ as UNSAFE_useScrollRestoration, aS as UNSAFE_withComponentProps, aU as UNSAFE_withErrorBoundaryProps, aT as UNSAFE_withHydrateFallbackProps, az as URLSearchParamsInit, ae as createBrowserRouter, af as createHashRouter, q as createMemoryRouter, r as createRoutesFromChildren, s as createRoutesFromElements, aB as createSearchParams, t as renderMatches, aL as unstable_DecodeServerResponseFunction, aM as unstable_EncodeActionFunction, aj as unstable_HistoryRouter, aO as unstable_RSCHydratedRouter, aN as unstable_createCallServer, aP as unstable_getServerStream, au as unstable_usePrompt, w as useActionData, x as useAsyncError, y as useAsyncValue, at as useBeforeUnload, v as useBlocker, ar as useFetcher, as as useFetchers, aq as useFormAction, z as useHref, B as useInRouterContext, an as useLinkClickHandler, C as useLoaderData, D as useLocation, G as useMatch, J as useMatches, K as useNavigate, Q as useNavigation, T as useNavigationType, U as useOutlet, V as useOutletContext, W as useParams, X as useResolvedPath, Y as useRevalidator, Z as useRouteError, _ as useRouteLoaderData, $ as useRoutes, ao as useSearchParams, ap as useSubmit, av as useViewTransitionState } from './browser-Dr0PjLWi.mjs';
3
+ import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, a as RouteComponentType, H as HydrateFallbackType, b as ErrorBoundaryType, S as ServerBuild, c as ServerPayload } from './browser-Bh26Omrk.mjs';
4
+ export { i as Await, d as AwaitProps, ag as BrowserRouter, a0 as BrowserRouterProps, a1 as DOMRouterOpts, a7 as FetcherFormProps, ac as FetcherSubmitFunction, aw as FetcherSubmitOptions, ad as FetcherWithComponents, al as Form, a8 as FormProps, aH as HandleDataRequestFunction, aI as HandleDocumentRequestFunction, aJ as HandleErrorFunction, ah as HashRouter, a2 as HashRouterProps, a3 as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, ai as Link, a4 as LinkProps, aD as Links, j as MemoryRouter, M as MemoryRouterOpts, e as MemoryRouterProps, aC as Meta, ak as NavLink, a5 as NavLinkProps, a6 as NavLinkRenderProps, k as Navigate, u as NavigateFunction, N as NavigateProps, l as Outlet, O as OutletProps, ax as ParamKeyValuePair, P as PathRouteProps, aF as PrefetchPageLinks, m as Route, f as RouteProps, n as Router, g as RouterProps, o as RouterProvider, R as RouterProviderProps, p as Routes, h as RoutesProps, aE as Scripts, aG as ScriptsProps, am as ScrollRestoration, a9 as ScrollRestorationProps, aK as ServerEntryModule, aa as SetURLSearchParams, ab as SubmitFunction, ay as SubmitOptions, aA as SubmitTarget, aV as UNSAFE_FrameworkContext, aW as UNSAFE_createClientRoutes, aX as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, aQ as UNSAFE_hydrationRouteProperties, aR as UNSAFE_mapRouteProperties, aY as UNSAFE_shouldHydrateRouteLoader, aZ as UNSAFE_useScrollRestoration, aS as UNSAFE_withComponentProps, aU as UNSAFE_withErrorBoundaryProps, aT as UNSAFE_withHydrateFallbackProps, az as URLSearchParamsInit, ae as createBrowserRouter, af as createHashRouter, q as createMemoryRouter, r as createRoutesFromChildren, s as createRoutesFromElements, aB as createSearchParams, t as renderMatches, aL as unstable_DecodeServerResponseFunction, aM as unstable_EncodeActionFunction, aj as unstable_HistoryRouter, aO as unstable_RSCHydratedRouter, aN as unstable_createCallServer, aP as unstable_getServerStream, au as unstable_usePrompt, w as useActionData, x as useAsyncError, y as useAsyncValue, at as useBeforeUnload, v as useBlocker, ar as useFetcher, as as useFetchers, aq as useFormAction, z as useHref, B as useInRouterContext, an as useLinkClickHandler, C as useLoaderData, D as useLocation, G as useMatch, J as useMatches, K as useNavigate, Q as useNavigation, T as useNavigationType, U as useOutlet, V as useOutletContext, W as useParams, X as useResolvedPath, Y as useRevalidator, Z as useRouteError, _ as useRouteLoaderData, $ as useRoutes, ao as useSearchParams, ap as useSubmit, av as useViewTransitionState } from './browser-Bh26Omrk.mjs';
5
5
  import * as React from 'react';
6
6
  import React__default, { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
8
8
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
9
9
  import { P as Pages } from './register-DeIo2iHO.mjs';
10
10
  export { R as Register } from './register-DeIo2iHO.mjs';
11
+ import 'node:async_hooks';
11
12
 
12
13
  declare const SingleFetchRedirectSymbol: unique symbol;
13
14
  declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import React__default, { ReactElement } from 'react';
5
5
  import { ParseOptions, SerializeOptions } from 'cookie';
6
6
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
7
+ import { AsyncLocalStorage } from 'node:async_hooks';
7
8
 
8
9
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
9
10
  interface ServerRoute extends Route$1 {
@@ -2512,6 +2513,12 @@ type ToArgs<Params extends Record<string, string | undefined>> = Equal<Params, {
2512
2513
  */
2513
2514
  declare function href<Path extends keyof Args>(path: Path, ...args: Args[Path]): string;
2514
2515
 
2516
+ type ServerContext = {
2517
+ redirect?: Response;
2518
+ };
2519
+ declare global {
2520
+ var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
2521
+ }
2515
2522
  type RenderedRoute = {
2516
2523
  clientAction?: ClientActionFunction;
2517
2524
  clientLoader?: ClientLoaderFunction;
@@ -2563,6 +2570,7 @@ type ServerRedirectPayload = {
2563
2570
  location: string;
2564
2571
  replace: boolean;
2565
2572
  reload: boolean;
2573
+ actionResult?: Promise<unknown>;
2566
2574
  };
2567
2575
  type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
2568
2576
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5005,10 +5005,6 @@ var DataRouterContext = React.createContext(null);
5005
5005
  DataRouterContext.displayName = "DataRouter";
5006
5006
  var DataRouterStateContext = React.createContext(null);
5007
5007
  DataRouterStateContext.displayName = "DataRouterState";
5008
- var RSCRouterContext = React.createContext(false);
5009
- function useIsRSCRouterContext() {
5010
- return React.useContext(RSCRouterContext);
5011
- }
5012
5008
  var ViewTransitionContext = React.createContext({
5013
5009
  isTransitioning: false
5014
5010
  });
@@ -5182,7 +5178,6 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
5182
5178
  // router loaded. We can help them understand how to avoid that.
5183
5179
  `useRoutes() may be used only in the context of a <Router> component.`
5184
5180
  );
5185
- let isRSCRouterContext = useIsRSCRouterContext();
5186
5181
  let { navigator } = React2.useContext(NavigationContext);
5187
5182
  let { matches: parentMatches } = React2.useContext(RouteContext);
5188
5183
  let routeMatch = parentMatches[parentMatches.length - 1];
@@ -5248,8 +5243,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
5248
5243
  ),
5249
5244
  parentMatches,
5250
5245
  dataRouterState,
5251
- future,
5252
- isRSCRouterContext
5246
+ future
5253
5247
  );
5254
5248
  if (locationArg && renderedMatches) {
5255
5249
  return /* @__PURE__ */ React2.createElement(
@@ -5340,7 +5334,7 @@ function RenderedRoute({ routeContext, match, children }) {
5340
5334
  }
5341
5335
  return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children);
5342
5336
  }
5343
- function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null, isRSCRouterContext = false) {
5337
+ function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
5344
5338
  if (matches == null) {
5345
5339
  if (!dataRouterState) {
5346
5340
  return null;
@@ -5430,9 +5424,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5430
5424
  } else {
5431
5425
  children = outlet;
5432
5426
  }
5433
- if (isRSCRouterContext) {
5434
- children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5435
- }
5436
5427
  return /* @__PURE__ */ React2.createElement(
5437
5428
  RenderedRoute,
5438
5429
  {
@@ -5459,19 +5450,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5459
5450
  ) : getChildren();
5460
5451
  }, null);
5461
5452
  }
5462
- var RedirectBoundary = class extends React2.Component {
5463
- // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5464
- // If it's anything else, re-throw to bubble it up.
5465
- static getDerivedStateFromError(error) {
5466
- if (error === Symbol.for("react-router.redirect")) {
5467
- return null;
5468
- }
5469
- throw error;
5470
- }
5471
- render() {
5472
- return this.props.children;
5473
- }
5474
- };
5475
5453
  function getDataRouterConsoleError(hookName) {
5476
5454
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5477
5455
  }
@@ -8964,7 +8942,7 @@ function mergeRefs(...refs) {
8964
8942
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8965
8943
  try {
8966
8944
  if (isBrowser) {
8967
- window.__reactRouterVersion = "0.0.0-experimental-d431f1b65";
8945
+ window.__reactRouterVersion = "0.0.0-experimental-e5dac68cb";
8968
8946
  }
8969
8947
  } catch (e) {
8970
8948
  }
@@ -11806,20 +11784,10 @@ function createCallServer({
11806
11784
  window.location.href = payload.location;
11807
11785
  return;
11808
11786
  }
11809
- let reject;
11810
- const promise = new Promise((resolve, rejectFn) => {
11811
- reject = rejectFn;
11812
- });
11813
- const unsubscribe = window.__router.subscribe(({ navigation }) => {
11814
- if (navigation.state === "idle") {
11815
- unsubscribe();
11816
- reject(Symbol.for("react-router.redirect"));
11817
- }
11818
- });
11819
11787
  window.__router.navigate(payload.location, {
11820
11788
  replace: payload.replace
11821
11789
  });
11822
- return promise;
11790
+ return payload.actionResult;
11823
11791
  }
11824
11792
  if (payload.type !== "action") {
11825
11793
  throw new Error("Unexpected payload type");
@@ -12160,7 +12128,7 @@ function RSCHydratedRouter({
12160
12128
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
12161
12129
  routeModules: {}
12162
12130
  };
12163
- return /* @__PURE__ */ React15.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
12131
+ return /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync })));
12164
12132
  }
12165
12133
  function createRouteFromServerManifest(match, payload) {
12166
12134
  let hasInitialData = payload && match.id in payload.loaderData;
@@ -12258,10 +12226,23 @@ var nextPaths2 = /* @__PURE__ */ new Set();
12258
12226
  var discoveredPathsMaxSize2 = 1e3;
12259
12227
  var discoveredPaths2 = /* @__PURE__ */ new Set();
12260
12228
  var URL_LIMIT2 = 7680;
12261
- async function fetchAndApplyManifestPatches2(paths, decode2, fetchImplementation, signal) {
12229
+ function getManifestUrl(paths) {
12230
+ if (paths.length === 0) {
12231
+ return null;
12232
+ }
12233
+ if (paths.length === 1) {
12234
+ return new URL(`${paths[0]}.manifest`, window.location.origin);
12235
+ }
12262
12236
  let basename = (window.__router.basename ?? "").replace(/^\/|\/$/g, "");
12263
12237
  let url = new URL(`${basename}/.manifest`, window.location.origin);
12264
12238
  paths.sort().forEach((path) => url.searchParams.append("p", path));
12239
+ return url;
12240
+ }
12241
+ async function fetchAndApplyManifestPatches2(paths, decode2, fetchImplementation, signal) {
12242
+ let url = getManifestUrl(paths);
12243
+ if (url == null) {
12244
+ return;
12245
+ }
12265
12246
  if (url.toString().length > URL_LIMIT2) {
12266
12247
  nextPaths2.clear();
12267
12248
  return;
@@ -12523,7 +12504,7 @@ function RSCStaticRouter({
12523
12504
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
12524
12505
  routeModules: {}
12525
12506
  };
12526
- return /* @__PURE__ */ React16.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
12507
+ return /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
12527
12508
  StaticRouterProvider,
12528
12509
  {
12529
12510
  context,
@@ -12531,7 +12512,7 @@ function RSCStaticRouter({
12531
12512
  hydrate: false,
12532
12513
  nonce: payload.nonce
12533
12514
  }
12534
- ))));
12515
+ )));
12535
12516
  }
12536
12517
  function isReactServerRequest(url) {
12537
12518
  return url.pathname.endsWith(".rsc");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -135,7 +135,7 @@ import {
135
135
  withComponentProps,
136
136
  withErrorBoundaryProps,
137
137
  withHydrateFallbackProps
138
- } from "./chunk-F37344ZN.mjs";
138
+ } from "./chunk-USQXBNSR.mjs";
139
139
  export {
140
140
  Await,
141
141
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-d431f1b65
2
+ * react-router v0.0.0-experimental-e5dac68cb
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,6 @@
1
1
  import { ParseOptions, SerializeOptions } from 'cookie';
2
2
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
3
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
4
  import * as React from 'react';
4
5
 
5
6
  /**
@@ -579,7 +580,7 @@ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
579
580
  *
580
581
  * @category Utils
581
582
  */
582
- declare const redirect: RedirectFunction;
583
+ declare const redirect$1: RedirectFunction;
583
584
  /**
584
585
  * A redirect response that will force a document reload to the new location.
585
586
  * Sets the status code and the `Location` header.
@@ -587,7 +588,7 @@ declare const redirect: RedirectFunction;
587
588
  *
588
589
  * @category Utils
589
590
  */
590
- declare const redirectDocument: RedirectFunction;
591
+ declare const redirectDocument$1: RedirectFunction;
591
592
  /**
592
593
  * A redirect response that will perform a `history.replaceState` instead of a
593
594
  * `history.pushState` for client-side navigation redirects.
@@ -596,7 +597,7 @@ declare const redirectDocument: RedirectFunction;
596
597
  *
597
598
  * @category Utils
598
599
  */
599
- declare const replace: RedirectFunction;
600
+ declare const replace$1: RedirectFunction;
600
601
 
601
602
  /**
602
603
  * A Router instance manages all navigation and data loading/mutations
@@ -1737,6 +1738,15 @@ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
1737
1738
  */
1738
1739
  type RouteHandle = unknown;
1739
1740
 
1741
+ type ServerContext = {
1742
+ redirect?: Response;
1743
+ };
1744
+ declare global {
1745
+ var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
1746
+ }
1747
+ declare const redirect: typeof redirect$1;
1748
+ declare const redirectDocument: typeof redirectDocument$1;
1749
+ declare const replace: typeof replace$1;
1740
1750
  type ServerRouteObjectBase = {
1741
1751
  action?: ActionFunction;
1742
1752
  clientAction?: ClientActionFunction;
@@ -1818,6 +1828,7 @@ type ServerRedirectPayload = {
1818
1828
  location: string;
1819
1829
  replace: boolean;
1820
1830
  reload: boolean;
1831
+ actionResult?: Promise<unknown>;
1821
1832
  };
1822
1833
  type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
1823
1834
  type ServerMatch = {
@@ -1,5 +1,6 @@
1
1
  import { ParseOptions, SerializeOptions } from 'cookie';
2
2
  export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
3
+ import { AsyncLocalStorage } from 'node:async_hooks';
3
4
  import * as React from 'react';
4
5
 
5
6
  /**
@@ -579,7 +580,7 @@ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
579
580
  *
580
581
  * @category Utils
581
582
  */
582
- declare const redirect: RedirectFunction;
583
+ declare const redirect$1: RedirectFunction;
583
584
  /**
584
585
  * A redirect response that will force a document reload to the new location.
585
586
  * Sets the status code and the `Location` header.
@@ -587,7 +588,7 @@ declare const redirect: RedirectFunction;
587
588
  *
588
589
  * @category Utils
589
590
  */
590
- declare const redirectDocument: RedirectFunction;
591
+ declare const redirectDocument$1: RedirectFunction;
591
592
  /**
592
593
  * A redirect response that will perform a `history.replaceState` instead of a
593
594
  * `history.pushState` for client-side navigation redirects.
@@ -596,7 +597,7 @@ declare const redirectDocument: RedirectFunction;
596
597
  *
597
598
  * @category Utils
598
599
  */
599
- declare const replace: RedirectFunction;
600
+ declare const replace$1: RedirectFunction;
600
601
 
601
602
  /**
602
603
  * A Router instance manages all navigation and data loading/mutations
@@ -1737,6 +1738,15 @@ type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
1737
1738
  */
1738
1739
  type RouteHandle = unknown;
1739
1740
 
1741
+ type ServerContext = {
1742
+ redirect?: Response;
1743
+ };
1744
+ declare global {
1745
+ var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
1746
+ }
1747
+ declare const redirect: typeof redirect$1;
1748
+ declare const redirectDocument: typeof redirectDocument$1;
1749
+ declare const replace: typeof replace$1;
1740
1750
  type ServerRouteObjectBase = {
1741
1751
  action?: ActionFunction;
1742
1752
  clientAction?: ClientActionFunction;
@@ -1818,6 +1828,7 @@ type ServerRedirectPayload = {
1818
1828
  location: string;
1819
1829
  replace: boolean;
1820
1830
  reload: boolean;
1831
+ actionResult?: Promise<unknown>;
1821
1832
  };
1822
1833
  type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
1823
1834
  type ServerMatch = {