react-router 7.2.0-pre.1 → 7.2.0-pre.3

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 (36) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/development/{chunk-FXE4ZOSB.mjs → chunk-YJVE32LY.mjs} +19 -20
  3. package/dist/development/dom-export.d.mts +2 -2
  4. package/dist/development/dom-export.d.ts +2 -2
  5. package/dist/development/dom-export.js +18 -19
  6. package/dist/development/dom-export.mjs +2 -2
  7. package/dist/{production/fog-of-war-rn7nVSAv.d.ts → development/fog-of-war-D_yo3J7q.d.ts} +1 -1
  8. package/dist/development/{fog-of-war-yKFj2vdd.d.mts → fog-of-war-NSBQ-FR3.d.mts} +1 -1
  9. package/dist/development/index.d.mts +4 -4
  10. package/dist/development/index.d.ts +4 -4
  11. package/dist/development/index.js +19 -20
  12. package/dist/development/index.mjs +2 -2
  13. package/dist/development/lib/types/route-module.d.mts +1 -1
  14. package/dist/development/lib/types/route-module.d.ts +1 -1
  15. package/dist/development/lib/types/route-module.js +1 -1
  16. package/dist/development/lib/types/route-module.mjs +1 -1
  17. package/dist/development/{route-data-CfLfC_Bh.d.ts → route-data-B_Qv26O_.d.mts} +12 -2
  18. package/dist/{production/route-data-CfLfC_Bh.d.mts → development/route-data-B_Qv26O_.d.ts} +12 -2
  19. package/dist/production/{chunk-3BG6WSY4.mjs → chunk-LDDZALL2.mjs} +19 -20
  20. package/dist/production/dom-export.d.mts +2 -2
  21. package/dist/production/dom-export.d.ts +2 -2
  22. package/dist/production/dom-export.js +18 -19
  23. package/dist/production/dom-export.mjs +2 -2
  24. package/dist/{development/fog-of-war-rn7nVSAv.d.ts → production/fog-of-war-D_yo3J7q.d.ts} +1 -1
  25. package/dist/production/{fog-of-war-yKFj2vdd.d.mts → fog-of-war-NSBQ-FR3.d.mts} +1 -1
  26. package/dist/production/index.d.mts +4 -4
  27. package/dist/production/index.d.ts +4 -4
  28. package/dist/production/index.js +19 -20
  29. package/dist/production/index.mjs +2 -2
  30. package/dist/production/lib/types/route-module.d.mts +1 -1
  31. package/dist/production/lib/types/route-module.d.ts +1 -1
  32. package/dist/production/lib/types/route-module.js +1 -1
  33. package/dist/production/lib/types/route-module.mjs +1 -1
  34. package/dist/production/{route-data-CfLfC_Bh.d.ts → route-data-B_Qv26O_.d.mts} +12 -2
  35. package/dist/{development/route-data-CfLfC_Bh.d.mts → production/route-data-B_Qv26O_.d.ts} +12 -2
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.2.0-pre.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `unstable_SerializesTo` brand type for library authors to register types serializable by React Router's streaming format (`turbo-stream`) ([`ab5b05b02`](https://github.com/remix-run/react-router/commit/ab5b05b02f99f062edb3c536c392197c88eb6c77))
8
+
9
+ ## 7.2.0-pre.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Properly handle revalidations to across a prerender/SPA boundary ([#13021](https://github.com/remix-run/react-router/pull/13021))
14
+
15
+ - In "hybrid" applications where some routes are pre-rendered and some are served from a SPA fallback, we need to avoid making `.data` requests if the path wasn't pre-rendered because the request will 404
16
+ - We don't know all the pre-rendered paths client-side, however:
17
+ - All `loader` data in `ssr:false` mode is static because it's generated at build time
18
+ - A route must use a `clientLoader` to do anything dynamic
19
+ - Therefore, if a route only has a `loader` and not a `clientLoader`, we disable revalidation by default because there is no new data to retrieve
20
+ - We short circuit and skip single fetch `.data` request logic if there are no server loaders with `shouldLoad=true` in our single fetch `dataStrategy`
21
+ - This ensures that the route doesn't cause a `.data` request that would 404 after a submission
22
+
23
+ - Error at build time in `ssr:false` + `prerender` apps for the edge case scenario of: ([#13021](https://github.com/remix-run/react-router/pull/13021))
24
+
25
+ - A parent route has only a `loader` (does not have a `clientLoader`)
26
+ - The parent route is pre-rendered
27
+ - The parent route has children routes which are not prerendered
28
+ - This means that when the child paths are loaded via the SPA fallback, the parent won't have any `loaderData` because there is no server on which to run the `loader`
29
+ - This can be resolved by either adding a parent `clientLoader` or pre-rendering the child paths
30
+ - If you add a `clientLoader`, calling the `serverLoader()` on non-prerendered paths will throw a 404
31
+
3
32
  ## 7.2.0-pre.1
4
33
 
5
34
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5670,10 +5670,10 @@ function getSingleFetchDataStrategy(manifest, routeModules, ssr, getRouter) {
5670
5670
  return singleFetchActionStrategy(request, matches);
5671
5671
  }
5672
5672
  if (!ssr) {
5673
- let foundLoaderBelowRoot = matches.some(
5674
- (m) => m.route.id !== "root" && manifest.routes[m.route.id]?.hasLoader
5673
+ let foundRevalidatingServerLoader = matches.some(
5674
+ (m) => m.shouldLoad && manifest.routes[m.route.id]?.hasLoader && !manifest.routes[m.route.id]?.hasClientLoader
5675
5675
  );
5676
- if (!foundLoaderBelowRoot) {
5676
+ if (!foundRevalidatingServerLoader) {
5677
5677
  let matchesToLoad = matches.filter((m) => m.shouldLoad);
5678
5678
  let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
5679
5679
  return results.reduce(
@@ -6168,13 +6168,7 @@ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest
6168
6168
  needsRevalidation
6169
6169
  );
6170
6170
  }
6171
- function preventInvalidServerHandlerCall(type, route, isSpaMode) {
6172
- if (isSpaMode) {
6173
- let fn = type === "action" ? "serverAction()" : "serverLoader()";
6174
- let msg = `You cannot call ${fn} in SPA Mode (routeId: "${route.id}")`;
6175
- console.error(msg);
6176
- throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
6177
- }
6171
+ function preventInvalidServerHandlerCall(type, route) {
6178
6172
  if (type === "loader" && !route.hasLoader || type === "action" && !route.hasAction) {
6179
6173
  let fn = type === "action" ? "serverAction()" : "serverLoader()";
6180
6174
  let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
@@ -6268,7 +6262,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6268
6262
  request,
6269
6263
  params,
6270
6264
  async serverLoader() {
6271
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6265
+ preventInvalidServerHandlerCall("loader", route);
6272
6266
  if (isHydrationRequest) {
6273
6267
  if (hasInitialData) {
6274
6268
  return initialData;
@@ -6307,7 +6301,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6307
6301
  request,
6308
6302
  params,
6309
6303
  async serverAction() {
6310
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6304
+ preventInvalidServerHandlerCall("action", route);
6311
6305
  return fetchServerAction(singleFetch);
6312
6306
  }
6313
6307
  });
@@ -6329,7 +6323,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6329
6323
  return clientLoader({
6330
6324
  ...args,
6331
6325
  async serverLoader() {
6332
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6326
+ preventInvalidServerHandlerCall("loader", route);
6333
6327
  return fetchServerLoader(singleFetch);
6334
6328
  }
6335
6329
  });
@@ -6354,7 +6348,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6354
6348
  return clientAction({
6355
6349
  ...args,
6356
6350
  async serverAction() {
6357
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6351
+ preventInvalidServerHandlerCall("action", route);
6358
6352
  return fetchServerAction(singleFetch);
6359
6353
  }
6360
6354
  });
@@ -6376,7 +6370,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6376
6370
  lazyRoute.loader = (args, singleFetch) => clientLoader({
6377
6371
  ...args,
6378
6372
  async serverLoader() {
6379
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6373
+ preventInvalidServerHandlerCall("loader", route);
6380
6374
  return fetchServerLoader(singleFetch);
6381
6375
  }
6382
6376
  });
@@ -6386,7 +6380,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6386
6380
  lazyRoute.action = (args, singleFetch) => clientAction({
6387
6381
  ...args,
6388
6382
  async serverAction() {
6389
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6383
+ preventInvalidServerHandlerCall("action", route);
6390
6384
  return fetchServerAction(singleFetch);
6391
6385
  }
6392
6386
  });
@@ -6431,8 +6425,13 @@ function getShouldRevalidateFunction(route, manifestRoute, ssr, needsRevalidatio
6431
6425
  needsRevalidation
6432
6426
  );
6433
6427
  }
6434
- if (!ssr && manifestRoute.id === "root" && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
6435
- return () => false;
6428
+ if (!ssr && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
6429
+ if (route.shouldRevalidate) {
6430
+ let fn = route.shouldRevalidate;
6431
+ return (opts) => fn({ ...opts, defaultShouldRevalidate: false });
6432
+ } else {
6433
+ return () => false;
6434
+ }
6436
6435
  }
6437
6436
  if (ssr && route.shouldRevalidate) {
6438
6437
  let fn = route.shouldRevalidate;
@@ -7108,7 +7107,7 @@ function mergeRefs(...refs) {
7108
7107
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7109
7108
  try {
7110
7109
  if (isBrowser) {
7111
- window.__reactRouterVersion = "7.2.0-pre.1";
7110
+ window.__reactRouterVersion = "7.2.0-pre.3";
7112
7111
  }
7113
7112
  } catch (e) {
7114
7113
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './fog-of-war-yKFj2vdd.mjs';
3
- import './route-data-CfLfC_Bh.mjs';
2
+ import { R as RouterProviderProps$1 } from './fog-of-war-NSBQ-FR3.mjs';
3
+ import './route-data-B_Qv26O_.mjs';
4
4
 
5
5
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
6
6
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './fog-of-war-rn7nVSAv.js';
3
- import './route-data-CfLfC_Bh.js';
2
+ import { R as RouterProviderProps$1 } from './fog-of-war-D_yo3J7q.js';
3
+ import './route-data-B_Qv26O_.js';
4
4
 
5
5
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
6
6
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4359,10 +4359,10 @@ function getSingleFetchDataStrategy(manifest, routeModules, ssr, getRouter) {
4359
4359
  return singleFetchActionStrategy(request, matches);
4360
4360
  }
4361
4361
  if (!ssr) {
4362
- let foundLoaderBelowRoot = matches.some(
4363
- (m) => m.route.id !== "root" && manifest.routes[m.route.id]?.hasLoader
4362
+ let foundRevalidatingServerLoader = matches.some(
4363
+ (m) => m.shouldLoad && manifest.routes[m.route.id]?.hasLoader && !manifest.routes[m.route.id]?.hasClientLoader
4364
4364
  );
4365
- if (!foundLoaderBelowRoot) {
4365
+ if (!foundRevalidatingServerLoader) {
4366
4366
  let matchesToLoad = matches.filter((m) => m.shouldLoad);
4367
4367
  let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
4368
4368
  return results.reduce(
@@ -4817,13 +4817,7 @@ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest
4817
4817
  needsRevalidation
4818
4818
  );
4819
4819
  }
4820
- function preventInvalidServerHandlerCall(type, route, isSpaMode) {
4821
- if (isSpaMode) {
4822
- let fn = type === "action" ? "serverAction()" : "serverLoader()";
4823
- let msg = `You cannot call ${fn} in SPA Mode (routeId: "${route.id}")`;
4824
- console.error(msg);
4825
- throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
4826
- }
4820
+ function preventInvalidServerHandlerCall(type, route) {
4827
4821
  if (type === "loader" && !route.hasLoader || type === "action" && !route.hasAction) {
4828
4822
  let fn = type === "action" ? "serverAction()" : "serverLoader()";
4829
4823
  let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
@@ -4917,7 +4911,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
4917
4911
  request,
4918
4912
  params,
4919
4913
  async serverLoader() {
4920
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
4914
+ preventInvalidServerHandlerCall("loader", route);
4921
4915
  if (isHydrationRequest) {
4922
4916
  if (hasInitialData) {
4923
4917
  return initialData;
@@ -4956,7 +4950,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
4956
4950
  request,
4957
4951
  params,
4958
4952
  async serverAction() {
4959
- preventInvalidServerHandlerCall("action", route, isSpaMode);
4953
+ preventInvalidServerHandlerCall("action", route);
4960
4954
  return fetchServerAction(singleFetch);
4961
4955
  }
4962
4956
  });
@@ -4978,7 +4972,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
4978
4972
  return clientLoader({
4979
4973
  ...args,
4980
4974
  async serverLoader() {
4981
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
4975
+ preventInvalidServerHandlerCall("loader", route);
4982
4976
  return fetchServerLoader(singleFetch);
4983
4977
  }
4984
4978
  });
@@ -5003,7 +4997,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
5003
4997
  return clientAction({
5004
4998
  ...args,
5005
4999
  async serverAction() {
5006
- preventInvalidServerHandlerCall("action", route, isSpaMode);
5000
+ preventInvalidServerHandlerCall("action", route);
5007
5001
  return fetchServerAction(singleFetch);
5008
5002
  }
5009
5003
  });
@@ -5025,7 +5019,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
5025
5019
  lazyRoute.loader = (args, singleFetch) => clientLoader({
5026
5020
  ...args,
5027
5021
  async serverLoader() {
5028
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
5022
+ preventInvalidServerHandlerCall("loader", route);
5029
5023
  return fetchServerLoader(singleFetch);
5030
5024
  }
5031
5025
  });
@@ -5035,7 +5029,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
5035
5029
  lazyRoute.action = (args, singleFetch) => clientAction({
5036
5030
  ...args,
5037
5031
  async serverAction() {
5038
- preventInvalidServerHandlerCall("action", route, isSpaMode);
5032
+ preventInvalidServerHandlerCall("action", route);
5039
5033
  return fetchServerAction(singleFetch);
5040
5034
  }
5041
5035
  });
@@ -5080,8 +5074,13 @@ function getShouldRevalidateFunction(route, manifestRoute, ssr, needsRevalidatio
5080
5074
  needsRevalidation
5081
5075
  );
5082
5076
  }
5083
- if (!ssr && manifestRoute.id === "root" && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
5084
- return () => false;
5077
+ if (!ssr && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
5078
+ if (route.shouldRevalidate) {
5079
+ let fn = route.shouldRevalidate;
5080
+ return (opts) => fn({ ...opts, defaultShouldRevalidate: false });
5081
+ } else {
5082
+ return () => false;
5083
+ }
5085
5084
  }
5086
5085
  if (ssr && route.shouldRevalidate) {
5087
5086
  let fn = route.shouldRevalidate;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ import {
25
25
  matchRoutes,
26
26
  shouldHydrateRouteLoader,
27
27
  useFogOFWarDiscovery
28
- } from "./chunk-FXE4ZOSB.mjs";
28
+ } from "./chunk-YJVE32LY.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aL as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aM as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-CfLfC_Bh.js';
2
+ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aM as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aN as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-B_Qv26O_.js';
3
3
 
4
4
  /**
5
5
  * @private
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aL as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aM as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-CfLfC_Bh.mjs';
2
+ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, a0 as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, al as Navigator, ao as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, ak as DataRouteObject, aM as RouteModule, $ as HTMLFormMethod, Z as FormEncType, ax as PageLinkDescriptor, aN as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-B_Qv26O_.mjs';
3
3
 
4
4
  /**
5
5
  * @private
@@ -1,7 +1,7 @@
1
- import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-CfLfC_Bh.mjs';
2
- export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aE as UNSAFE_DataRouterContext, aF as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aD as UNSAFE_ErrorResponseImpl, aG as UNSAFE_FetchersContext, aH as UNSAFE_LocationContext, aI as UNSAFE_NavigationContext, aJ as UNSAFE_RouteContext, aK as UNSAFE_ViewTransitionContext, aA as UNSAFE_createBrowserHistory, aC as UNSAFE_createRouter, aB as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-CfLfC_Bh.mjs';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-yKFj2vdd.mjs';
4
- export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-yKFj2vdd.mjs';
1
+ import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-B_Qv26O_.mjs';
2
+ export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aF as UNSAFE_DataRouterContext, aG as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aE as UNSAFE_ErrorResponseImpl, aH as UNSAFE_FetchersContext, aI as UNSAFE_LocationContext, aJ as UNSAFE_NavigationContext, aK as UNSAFE_RouteContext, aL as UNSAFE_ViewTransitionContext, aB as UNSAFE_createBrowserHistory, aD as UNSAFE_createRouter, aC as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath, aA as unstable_SerializesTo } from './route-data-B_Qv26O_.mjs';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-NSBQ-FR3.mjs';
4
+ export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-NSBQ-FR3.mjs';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -1,7 +1,7 @@
1
- import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-CfLfC_Bh.js';
2
- export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aE as UNSAFE_DataRouterContext, aF as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aD as UNSAFE_ErrorResponseImpl, aG as UNSAFE_FetchersContext, aH as UNSAFE_LocationContext, aI as UNSAFE_NavigationContext, aJ as UNSAFE_RouteContext, aK as UNSAFE_ViewTransitionContext, aA as UNSAFE_createBrowserHistory, aC as UNSAFE_createRouter, aB as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-CfLfC_Bh.js';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-rn7nVSAv.js';
4
- export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-rn7nVSAv.js';
1
+ import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params$1, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, E as Equal, v as RouterState } from './route-data-B_Qv26O_.js';
2
+ export { ap as ClientActionFunction, aq as ClientActionFunctionArgs, ar as ClientLoaderFunction, as as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, x as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, at as HeadersArgs, au as HeadersFunction, ay as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, az as LinkDescriptor, av as MetaArgs, aw as MetaDescriptor, y as NavigationStates, al as Navigator, ax as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, z as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aF as UNSAFE_DataRouterContext, aG as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, aE as UNSAFE_ErrorResponseImpl, aH as UNSAFE_FetchersContext, aI as UNSAFE_LocationContext, aJ as UNSAFE_NavigationContext, aK as UNSAFE_RouteContext, aL as UNSAFE_ViewTransitionContext, aB as UNSAFE_createBrowserHistory, aD as UNSAFE_createRouter, aC as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath, aA as unstable_SerializesTo } from './route-data-B_Qv26O_.js';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-D_yo3J7q.js';
4
+ export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-D_yo3J7q.js';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5816,10 +5816,10 @@ function getSingleFetchDataStrategy(manifest, routeModules, ssr, getRouter) {
5816
5816
  return singleFetchActionStrategy(request, matches);
5817
5817
  }
5818
5818
  if (!ssr) {
5819
- let foundLoaderBelowRoot = matches.some(
5820
- (m) => m.route.id !== "root" && manifest.routes[m.route.id]?.hasLoader
5819
+ let foundRevalidatingServerLoader = matches.some(
5820
+ (m) => m.shouldLoad && manifest.routes[m.route.id]?.hasLoader && !manifest.routes[m.route.id]?.hasClientLoader
5821
5821
  );
5822
- if (!foundLoaderBelowRoot) {
5822
+ if (!foundRevalidatingServerLoader) {
5823
5823
  let matchesToLoad = matches.filter((m) => m.shouldLoad);
5824
5824
  let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
5825
5825
  return results.reduce(
@@ -6314,13 +6314,7 @@ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest
6314
6314
  needsRevalidation
6315
6315
  );
6316
6316
  }
6317
- function preventInvalidServerHandlerCall(type, route, isSpaMode) {
6318
- if (isSpaMode) {
6319
- let fn = type === "action" ? "serverAction()" : "serverLoader()";
6320
- let msg = `You cannot call ${fn} in SPA Mode (routeId: "${route.id}")`;
6321
- console.error(msg);
6322
- throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
6323
- }
6317
+ function preventInvalidServerHandlerCall(type, route) {
6324
6318
  if (type === "loader" && !route.hasLoader || type === "action" && !route.hasAction) {
6325
6319
  let fn = type === "action" ? "serverAction()" : "serverLoader()";
6326
6320
  let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
@@ -6414,7 +6408,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6414
6408
  request,
6415
6409
  params,
6416
6410
  async serverLoader() {
6417
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6411
+ preventInvalidServerHandlerCall("loader", route);
6418
6412
  if (isHydrationRequest) {
6419
6413
  if (hasInitialData) {
6420
6414
  return initialData;
@@ -6453,7 +6447,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6453
6447
  request,
6454
6448
  params,
6455
6449
  async serverAction() {
6456
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6450
+ preventInvalidServerHandlerCall("action", route);
6457
6451
  return fetchServerAction(singleFetch);
6458
6452
  }
6459
6453
  });
@@ -6475,7 +6469,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6475
6469
  return clientLoader({
6476
6470
  ...args,
6477
6471
  async serverLoader() {
6478
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6472
+ preventInvalidServerHandlerCall("loader", route);
6479
6473
  return fetchServerLoader(singleFetch);
6480
6474
  }
6481
6475
  });
@@ -6500,7 +6494,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6500
6494
  return clientAction({
6501
6495
  ...args,
6502
6496
  async serverAction() {
6503
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6497
+ preventInvalidServerHandlerCall("action", route);
6504
6498
  return fetchServerAction(singleFetch);
6505
6499
  }
6506
6500
  });
@@ -6522,7 +6516,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6522
6516
  lazyRoute.loader = (args, singleFetch) => clientLoader({
6523
6517
  ...args,
6524
6518
  async serverLoader() {
6525
- preventInvalidServerHandlerCall("loader", route, isSpaMode);
6519
+ preventInvalidServerHandlerCall("loader", route);
6526
6520
  return fetchServerLoader(singleFetch);
6527
6521
  }
6528
6522
  });
@@ -6532,7 +6526,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
6532
6526
  lazyRoute.action = (args, singleFetch) => clientAction({
6533
6527
  ...args,
6534
6528
  async serverAction() {
6535
- preventInvalidServerHandlerCall("action", route, isSpaMode);
6529
+ preventInvalidServerHandlerCall("action", route);
6536
6530
  return fetchServerAction(singleFetch);
6537
6531
  }
6538
6532
  });
@@ -6577,8 +6571,13 @@ function getShouldRevalidateFunction(route, manifestRoute, ssr, needsRevalidatio
6577
6571
  needsRevalidation
6578
6572
  );
6579
6573
  }
6580
- if (!ssr && manifestRoute.id === "root" && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
6581
- return () => false;
6574
+ if (!ssr && manifestRoute.hasLoader && !manifestRoute.hasClientLoader) {
6575
+ if (route.shouldRevalidate) {
6576
+ let fn = route.shouldRevalidate;
6577
+ return (opts) => fn({ ...opts, defaultShouldRevalidate: false });
6578
+ } else {
6579
+ return () => false;
6580
+ }
6582
6581
  }
6583
6582
  if (ssr && route.shouldRevalidate) {
6584
6583
  let fn = route.shouldRevalidate;
@@ -7254,7 +7253,7 @@ function mergeRefs(...refs) {
7254
7253
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7255
7254
  try {
7256
7255
  if (isBrowser) {
7257
- window.__reactRouterVersion = "7.2.0-pre.1";
7256
+ window.__reactRouterVersion = "7.2.0-pre.3";
7258
7257
  }
7259
7258
  } catch (e) {
7260
7259
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -121,7 +121,7 @@ import {
121
121
  useSearchParams,
122
122
  useSubmit,
123
123
  useViewTransitionState
124
- } from "./chunk-FXE4ZOSB.mjs";
124
+ } from "./chunk-YJVE32LY.mjs";
125
125
  export {
126
126
  Await,
127
127
  BrowserRouter,
@@ -1,4 +1,4 @@
1
- import { az as LinkDescriptor, aw as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, E as Equal, aQ as Pretty } from '../../route-data-CfLfC_Bh.mjs';
1
+ import { az as LinkDescriptor, aw as MetaDescriptor, aO as ServerDataFrom, aP as ClientDataFrom, aQ as Func, E as Equal, aR as Pretty } from '../../route-data-B_Qv26O_.mjs';
2
2
  import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
3
3
  import 'react';
4
4
 
@@ -1,4 +1,4 @@
1
- import { az as LinkDescriptor, aw as MetaDescriptor, aN as ServerDataFrom, aO as ClientDataFrom, aP as Func, E as Equal, aQ as Pretty } from '../../route-data-CfLfC_Bh.js';
1
+ import { az as LinkDescriptor, aw as MetaDescriptor, aO as ServerDataFrom, aP as ClientDataFrom, aQ as Func, E as Equal, aR as Pretty } from '../../route-data-B_Qv26O_.js';
2
2
  import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
3
3
  import 'react';
4
4
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.2.0-pre.1
2
+ * react-router v7.2.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1558,6 +1558,16 @@ type Serializable = undefined | null | boolean | string | symbol | number | Arra
1558
1558
  [key: PropertyKey]: Serializable;
1559
1559
  } | bigint | Date | URL | RegExp | Error | Map<Serializable, Serializable> | Set<Serializable> | Promise<Serializable>;
1560
1560
 
1561
+ /**
1562
+ * A brand that can be applied to a type to indicate that it will serialize
1563
+ * to a specific type when transported to the client from a loader.
1564
+ * Only use this if you have additional serialization/deserialization logic
1565
+ * in your application.
1566
+ */
1567
+ type unstable_SerializesTo<T> = {
1568
+ unstable__ReactRouter_SerializesTo?: [T];
1569
+ };
1570
+
1561
1571
  type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
1562
1572
  type IsAny<T> = 0 extends 1 & T ? true : false;
1563
1573
  type Func = (...args: any[]) => unknown;
@@ -1565,7 +1575,7 @@ type Pretty<T> = {
1565
1575
  [K in keyof T]: T[K];
1566
1576
  } & {};
1567
1577
 
1568
- type Serialize<T> = T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
1578
+ type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
1569
1579
  [K in keyof T]: Serialize<T[K]>;
1570
1580
  } : undefined;
1571
1581
  type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
@@ -1576,4 +1586,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
1576
1586
  type ClientDataFrom<T> = ClientData<DataFrom<T>>;
1577
1587
  type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
1578
1588
 
1579
- export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, createBrowserHistory as aA, invariant as aB, createRouter as aC, ErrorResponseImpl as aD, DataRouterContext as aE, DataRouterStateContext as aF, FetchersContext as aG, LocationContext as aH, NavigationContext as aI, RouteContext as aJ, ViewTransitionContext as aK, type RouteModule as aL, type History as aM, type ServerDataFrom as aN, type ClientDataFrom as aO, type Func as aP, type Pretty as aQ, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };
1589
+ export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, type unstable_SerializesTo as aA, createBrowserHistory as aB, invariant as aC, createRouter as aD, ErrorResponseImpl as aE, DataRouterContext as aF, DataRouterStateContext as aG, FetchersContext as aH, LocationContext as aI, NavigationContext as aJ, RouteContext as aK, ViewTransitionContext as aL, type RouteModule as aM, type History as aN, type ServerDataFrom as aO, type ClientDataFrom as aP, type Func as aQ, type Pretty as aR, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };
@@ -1558,6 +1558,16 @@ type Serializable = undefined | null | boolean | string | symbol | number | Arra
1558
1558
  [key: PropertyKey]: Serializable;
1559
1559
  } | bigint | Date | URL | RegExp | Error | Map<Serializable, Serializable> | Set<Serializable> | Promise<Serializable>;
1560
1560
 
1561
+ /**
1562
+ * A brand that can be applied to a type to indicate that it will serialize
1563
+ * to a specific type when transported to the client from a loader.
1564
+ * Only use this if you have additional serialization/deserialization logic
1565
+ * in your application.
1566
+ */
1567
+ type unstable_SerializesTo<T> = {
1568
+ unstable__ReactRouter_SerializesTo?: [T];
1569
+ };
1570
+
1561
1571
  type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
1562
1572
  type IsAny<T> = 0 extends 1 & T ? true : false;
1563
1573
  type Func = (...args: any[]) => unknown;
@@ -1565,7 +1575,7 @@ type Pretty<T> = {
1565
1575
  [K in keyof T]: T[K];
1566
1576
  } & {};
1567
1577
 
1568
- type Serialize<T> = T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
1578
+ type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends (...args: any[]) => unknown ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? {
1569
1579
  [K in keyof T]: Serialize<T[K]>;
1570
1580
  } : undefined;
1571
1581
  type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
@@ -1576,4 +1586,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
1576
1586
  type ClientDataFrom<T> = ClientData<DataFrom<T>>;
1577
1587
  type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
1578
1588
 
1579
- export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, createBrowserHistory as aA, invariant as aB, createRouter as aC, ErrorResponseImpl as aD, DataRouterContext as aE, DataRouterStateContext as aF, FetchersContext as aG, LocationContext as aH, NavigationContext as aI, RouteContext as aJ, ViewTransitionContext as aK, type RouteModule as aL, type History as aM, type ServerDataFrom as aN, type ClientDataFrom as aO, type Func as aP, type Pretty as aQ, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };
1589
+ export { type HTMLFormMethod as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type RouterSubscriber as J, type RouterNavigateOptions as K, type LoaderFunctionArgs as L, type MetaFunction as M, type NavigateOptions as N, type RouterFetchOptions as O, type ParamParseKey as P, type DataStrategyFunctionArgs as Q, type RouteModules as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type DataStrategyMatch as V, type DataStrategyResult as W, DataWithResponseInit as X, type ErrorResponse as Y, type FormEncType as Z, type FormMethod as _, type Router as a, type LazyRouteFunction as a0, type PathParam as a1, type RedirectFunction as a2, type ShouldRevalidateFunction as a3, type ShouldRevalidateFunctionArgs as a4, createPath as a5, parsePath as a6, IDLE_NAVIGATION as a7, IDLE_FETCHER as a8, IDLE_BLOCKER as a9, type unstable_SerializesTo as aA, createBrowserHistory as aB, invariant as aC, createRouter as aD, ErrorResponseImpl as aE, DataRouterContext as aF, DataRouterStateContext as aG, FetchersContext as aH, LocationContext as aI, NavigationContext as aJ, RouteContext as aK, ViewTransitionContext as aL, type RouteModule as aM, type History as aN, type ServerDataFrom as aO, type ClientDataFrom as aP, type Func as aQ, type Pretty as aR, data as aa, generatePath as ab, isRouteErrorResponse as ac, matchPath as ad, matchRoutes as ae, redirect as af, redirectDocument as ag, replace as ah, resolvePath as ai, type DataRouteMatch as aj, type DataRouteObject as ak, type Navigator as al, type PatchRoutesOnNavigationFunction as am, type PatchRoutesOnNavigationFunctionArgs as an, type RouteMatch as ao, type ClientActionFunction as ap, type ClientActionFunctionArgs as aq, type ClientLoaderFunction as ar, type ClientLoaderFunctionArgs as as, type HeadersArgs as at, type HeadersFunction as au, type MetaArgs as av, type MetaDescriptor as aw, type PageLinkDescriptor as ax, type HtmlLinkDescriptor as ay, type LinkDescriptor as az, type RouteManifest as b, type RelativeRoutingType as c, type Location as d, Action as e, type Path as f, type PathPattern as g, type PathMatch as h, type Params as i, type RouteObject as j, type Navigation as k, type RevalidationState as l, type SerializeFrom as m, type Blocker as n, type StaticHandlerContext as o, type StaticHandler as p, type IndexRouteObject as q, type LoaderFunction as r, type ActionFunction as s, type LinksFunction as t, type NonIndexRouteObject as u, type RouterState as v, type GetScrollRestorationKeyFunction as w, type Fetcher as x, type NavigationStates as y, type RouterInit as z };