react-router 0.0.0-experimental-b9cf540fe → 0.0.0-experimental-902325fda

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 (27) hide show
  1. package/dist/development/{chunk-T4L7PBNQ.mjs → chunk-XX7SEIOE.mjs} +47 -21
  2. package/dist/development/dom-export.d.mts +1 -1
  3. package/dist/development/dom-export.d.ts +1 -1
  4. package/dist/development/dom-export.js +43 -18
  5. package/dist/development/dom-export.mjs +4 -2
  6. package/dist/development/{fog-of-war-DjxZtxiP.d.ts → fog-of-war-Ax4Jg2xL.d.ts} +2 -2
  7. package/dist/{production/fog-of-war-D8U3moAU.d.mts → development/fog-of-war-Cyo_TZuh.d.mts} +2 -2
  8. package/dist/development/index.d.mts +3 -3
  9. package/dist/development/index.d.ts +3 -3
  10. package/dist/development/index.js +47 -21
  11. package/dist/development/index.mjs +2 -2
  12. package/dist/development/lib/types/route-module.js +1 -1
  13. package/dist/development/lib/types/route-module.mjs +1 -1
  14. package/dist/production/{chunk-JOASWB7J.mjs → chunk-IS6LEE6H.mjs} +47 -21
  15. package/dist/production/dom-export.d.mts +1 -1
  16. package/dist/production/dom-export.d.ts +1 -1
  17. package/dist/production/dom-export.js +43 -18
  18. package/dist/production/dom-export.mjs +4 -2
  19. package/dist/production/{fog-of-war-DjxZtxiP.d.ts → fog-of-war-Ax4Jg2xL.d.ts} +2 -2
  20. package/dist/{development/fog-of-war-D8U3moAU.d.mts → production/fog-of-war-Cyo_TZuh.d.mts} +2 -2
  21. package/dist/production/index.d.mts +3 -3
  22. package/dist/production/index.d.ts +3 -3
  23. package/dist/production/index.js +47 -21
  24. package/dist/production/index.mjs +2 -2
  25. package/dist/production/lib/types/route-module.js +1 -1
  26. package/dist/production/lib/types/route-module.mjs +1 -1
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-b9cf540fe
2
+ * react-router v0.0.0-experimental-902325fda
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5664,11 +5664,24 @@ function StreamTransfer({
5664
5664
  )));
5665
5665
  }
5666
5666
  }
5667
- function getSingleFetchDataStrategy(manifest, routeModules, getRouter) {
5667
+ function getSingleFetchDataStrategy(manifest, routeModules, ssr, getRouter) {
5668
5668
  return async ({ request, matches, fetcherKey }) => {
5669
5669
  if (request.method !== "GET") {
5670
5670
  return singleFetchActionStrategy(request, matches);
5671
5671
  }
5672
+ if (!ssr) {
5673
+ let foundLoaderBelowRoot = matches.some(
5674
+ (m) => m.route.id !== "root" && manifest.routes[m.route.id]?.hasLoader
5675
+ );
5676
+ if (!foundLoaderBelowRoot) {
5677
+ let matchesToLoad = matches.filter((m) => m.shouldLoad);
5678
+ let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
5679
+ return results.reduce(
5680
+ (acc, result, i) => Object.assign(acc, { [matchesToLoad[i].route.id]: result }),
5681
+ {}
5682
+ );
5683
+ }
5684
+ }
5672
5685
  if (fetcherKey) {
5673
5686
  return singleFetchLoaderFetcherStrategy(request, matches);
5674
5687
  }
@@ -6142,11 +6155,12 @@ function createServerRoutes(manifest, routeModules, future, isSpaMode, parentId
6142
6155
  return dataRoute;
6143
6156
  });
6144
6157
  }
6145
- function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, future, isSpaMode) {
6158
+ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, ssr, isSpaMode) {
6146
6159
  return createClientRoutes(
6147
6160
  manifest,
6148
6161
  routeModulesCache,
6149
6162
  initialState,
6163
+ ssr,
6150
6164
  isSpaMode,
6151
6165
  "",
6152
6166
  groupRoutesByParentId(manifest),
@@ -6155,14 +6169,14 @@ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest
6155
6169
  }
6156
6170
  function preventInvalidServerHandlerCall(type, route, isSpaMode) {
6157
6171
  if (isSpaMode) {
6158
- let fn2 = type === "action" ? "serverAction()" : "serverLoader()";
6159
- let msg2 = `You cannot call ${fn2} in SPA Mode (routeId: "${route.id}")`;
6160
- console.error(msg2);
6161
- throw new ErrorResponseImpl(400, "Bad Request", new Error(msg2), true);
6172
+ let fn = type === "action" ? "serverAction()" : "serverLoader()";
6173
+ let msg = `You cannot call ${fn} in SPA Mode (routeId: "${route.id}")`;
6174
+ console.error(msg);
6175
+ throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
6162
6176
  }
6163
- let fn = type === "action" ? "serverAction()" : "serverLoader()";
6164
- let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
6165
6177
  if (type === "loader" && !route.hasLoader || type === "action" && !route.hasAction) {
6178
+ let fn = type === "action" ? "serverAction()" : "serverLoader()";
6179
+ let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
6166
6180
  console.error(msg);
6167
6181
  throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
6168
6182
  }
@@ -6173,7 +6187,7 @@ function noActionDefinedError(type, routeId) {
6173
6187
  console.error(msg);
6174
6188
  throw new ErrorResponseImpl(405, "Method Not Allowed", new Error(msg), true);
6175
6189
  }
6176
- function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
6190
+ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
6177
6191
  return (routesByParentId[parentId] || []).map((route) => {
6178
6192
  let routeModule = routeModulesCache[route.id];
6179
6193
  function fetchServerHandler(singleFetch) {
@@ -6227,10 +6241,18 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
6227
6241
  ...dataRoute,
6228
6242
  ...getRouteComponents(route, routeModule, isSpaMode),
6229
6243
  handle: routeModule.handle,
6230
- shouldRevalidate: getShouldRevalidateFunction(
6231
- routeModule,
6232
- route.id,
6233
- needsRevalidation
6244
+ shouldRevalidate: (
6245
+ // When ssr is false and the root route has a `loader` without a
6246
+ // `clientLoader`, the `loader` data is static because it was rendered
6247
+ // at build time so we can just turn off revalidations. That way when
6248
+ // submitting to a clientAction on a non-prerendered path, we don't
6249
+ // try to reach out for a non-existent `.data` file which would have
6250
+ // the "revalidated" root data
6251
+ !ssr && route.id === "root" && route.hasLoader && !route.hasClientLoader ? () => false : getShouldRevalidateFunction(
6252
+ routeModule,
6253
+ route.id,
6254
+ needsRevalidation
6255
+ )
6234
6256
  )
6235
6257
  });
6236
6258
  let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
@@ -6246,7 +6268,6 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
6246
6268
  "No `routeModule` available for critical-route loader"
6247
6269
  );
6248
6270
  if (!routeModule.clientLoader) {
6249
- if (isSpaMode) return null;
6250
6271
  return fetchServerLoader(singleFetch);
6251
6272
  }
6252
6273
  return routeModule.clientLoader({
@@ -6301,7 +6322,6 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
6301
6322
  } else {
6302
6323
  if (!route.hasClientLoader) {
6303
6324
  dataRoute.loader = ({ request }, singleFetch) => prefetchStylesAndCallHandler(() => {
6304
- if (isSpaMode) return Promise.resolve(null);
6305
6325
  return fetchServerLoader(singleFetch);
6306
6326
  });
6307
6327
  } else if (route.clientLoaderModule) {
@@ -6398,6 +6418,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
6398
6418
  manifest,
6399
6419
  routeModulesCache,
6400
6420
  initialState,
6421
+ ssr,
6401
6422
  isSpaMode,
6402
6423
  route.id,
6403
6424
  routesByParentId,
@@ -6505,6 +6526,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, isSpaMo
6505
6526
  [path],
6506
6527
  manifest,
6507
6528
  routeModules,
6529
+ ssr,
6508
6530
  isSpaMode,
6509
6531
  basename,
6510
6532
  patch,
@@ -6544,6 +6566,7 @@ function useFogOFWarDiscovery(router, manifest, routeModules, ssr, isSpaMode) {
6544
6566
  lazyPaths,
6545
6567
  manifest,
6546
6568
  routeModules,
6569
+ ssr,
6547
6570
  isSpaMode,
6548
6571
  router.basename,
6549
6572
  router.patchRoutes
@@ -6564,7 +6587,7 @@ function useFogOFWarDiscovery(router, manifest, routeModules, ssr, isSpaMode) {
6564
6587
  return () => observer.disconnect();
6565
6588
  }, [ssr, isSpaMode, manifest, routeModules, router]);
6566
6589
  }
6567
- async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpaMode, basename, patchRoutes, signal) {
6590
+ async function fetchAndApplyManifestPatches(paths, manifest, routeModules, ssr, isSpaMode, basename, patchRoutes, signal) {
6568
6591
  let manifestPath = `${basename != null ? basename : "/"}/__manifest`.replace(
6569
6592
  /\/+/g,
6570
6593
  "/"
@@ -6607,7 +6630,7 @@ async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpa
6607
6630
  parentIds.forEach(
6608
6631
  (parentId) => patchRoutes(
6609
6632
  parentId || null,
6610
- createClientRoutes(patches, routeModules, null, isSpaMode, parentId)
6633
+ createClientRoutes(patches, routeModules, null, ssr, isSpaMode, parentId)
6611
6634
  )
6612
6635
  );
6613
6636
  }
@@ -7087,7 +7110,7 @@ function mergeRefs(...refs) {
7087
7110
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7088
7111
  try {
7089
7112
  if (isBrowser) {
7090
- window.__reactRouterVersion = "0.0.0-experimental-b9cf540fe";
7113
+ window.__reactRouterVersion = "0.0.0-experimental-902325fda";
7091
7114
  }
7092
7115
  } catch (e) {
7093
7116
  }
@@ -9092,7 +9115,10 @@ var createRequestHandler = (build, mode) => {
9092
9115
  errorHandler = derived.errorHandler;
9093
9116
  }
9094
9117
  let url = new URL(request.url);
9095
- let normalizedPath = url.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/").replace(/(.)\/$/, "$1");
9118
+ let normalizedPath = url.pathname.replace(/\.data$/, "").replace(/^\/_root$/, "/");
9119
+ if (normalizedPath !== "/" && normalizedPath.endsWith("/")) {
9120
+ normalizedPath = normalizedPath.slice(0, -1);
9121
+ }
9096
9122
  let params = {};
9097
9123
  let handleError = (error) => {
9098
9124
  if (mode === "development" /* Development */) {
@@ -9104,7 +9130,7 @@ var createRequestHandler = (build, mode) => {
9104
9130
  request
9105
9131
  });
9106
9132
  };
9107
- if (!_build.ssr && _build.prerender.length > 0 && // Look with/without the trailing slash to be sure
9133
+ if (!_build.ssr && _build.prerender.length > 0 && normalizedPath !== "/" && // Look with/without the trailing slash to be sure
9108
9134
  !_build.prerender.includes(normalizedPath) && !_build.prerender.includes(normalizedPath + "/")) {
9109
9135
  errorHandler(
9110
9136
  new ErrorResponseImpl(
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './fog-of-war-D8U3moAU.mjs';
2
+ import { R as RouterProviderProps$1 } from './fog-of-war-Cyo_TZuh.mjs';
3
3
  import './route-data-DQbTMaUY.mjs';
4
4
 
5
5
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { R as RouterProviderProps$1 } from './fog-of-war-DjxZtxiP.js';
2
+ import { R as RouterProviderProps$1 } from './fog-of-war-Ax4Jg2xL.js';
3
3
  import './route-data-DQbTMaUY.js';
4
4
 
5
5
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-b9cf540fe
2
+ * react-router v0.0.0-experimental-902325fda
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -4353,11 +4353,24 @@ async function createRequestInit(request) {
4353
4353
 
4354
4354
  // lib/dom/ssr/single-fetch.tsx
4355
4355
  var SingleFetchRedirectSymbol = Symbol("SingleFetchRedirect");
4356
- function getSingleFetchDataStrategy(manifest, routeModules, getRouter) {
4356
+ function getSingleFetchDataStrategy(manifest, routeModules, ssr, getRouter) {
4357
4357
  return async ({ request, matches, fetcherKey }) => {
4358
4358
  if (request.method !== "GET") {
4359
4359
  return singleFetchActionStrategy(request, matches);
4360
4360
  }
4361
+ if (!ssr) {
4362
+ let foundLoaderBelowRoot = matches.some(
4363
+ (m) => m.route.id !== "root" && manifest.routes[m.route.id]?.hasLoader
4364
+ );
4365
+ if (!foundLoaderBelowRoot) {
4366
+ let matchesToLoad = matches.filter((m) => m.shouldLoad);
4367
+ let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
4368
+ return results.reduce(
4369
+ (acc, result, i) => Object.assign(acc, { [matchesToLoad[i].route.id]: result }),
4370
+ {}
4371
+ );
4372
+ }
4373
+ }
4361
4374
  if (fetcherKey) {
4362
4375
  return singleFetchLoaderFetcherStrategy(request, matches);
4363
4376
  }
@@ -4791,11 +4804,12 @@ function getRouteComponents(route, routeModule, isSpaMode) {
4791
4804
  }
4792
4805
  return { Component: Component4, ErrorBoundary, HydrateFallback };
4793
4806
  }
4794
- function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, future, isSpaMode) {
4807
+ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, ssr, isSpaMode) {
4795
4808
  return createClientRoutes(
4796
4809
  manifest,
4797
4810
  routeModulesCache,
4798
4811
  initialState,
4812
+ ssr,
4799
4813
  isSpaMode,
4800
4814
  "",
4801
4815
  groupRoutesByParentId(manifest),
@@ -4804,14 +4818,14 @@ function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest
4804
4818
  }
4805
4819
  function preventInvalidServerHandlerCall(type, route, isSpaMode) {
4806
4820
  if (isSpaMode) {
4807
- let fn2 = type === "action" ? "serverAction()" : "serverLoader()";
4808
- let msg2 = `You cannot call ${fn2} in SPA Mode (routeId: "${route.id}")`;
4809
- console.error(msg2);
4810
- throw new ErrorResponseImpl(400, "Bad Request", new Error(msg2), true);
4821
+ let fn = type === "action" ? "serverAction()" : "serverLoader()";
4822
+ let msg = `You cannot call ${fn} in SPA Mode (routeId: "${route.id}")`;
4823
+ console.error(msg);
4824
+ throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
4811
4825
  }
4812
- let fn = type === "action" ? "serverAction()" : "serverLoader()";
4813
- let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
4814
4826
  if (type === "loader" && !route.hasLoader || type === "action" && !route.hasAction) {
4827
+ let fn = type === "action" ? "serverAction()" : "serverLoader()";
4828
+ let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${route.id}")`;
4815
4829
  console.error(msg);
4816
4830
  throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
4817
4831
  }
@@ -4822,7 +4836,7 @@ function noActionDefinedError(type, routeId) {
4822
4836
  console.error(msg);
4823
4837
  throw new ErrorResponseImpl(405, "Method Not Allowed", new Error(msg), true);
4824
4838
  }
4825
- function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
4839
+ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
4826
4840
  return (routesByParentId[parentId] || []).map((route) => {
4827
4841
  let routeModule = routeModulesCache[route.id];
4828
4842
  function fetchServerHandler(singleFetch) {
@@ -4876,10 +4890,18 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
4876
4890
  ...dataRoute,
4877
4891
  ...getRouteComponents(route, routeModule, isSpaMode),
4878
4892
  handle: routeModule.handle,
4879
- shouldRevalidate: getShouldRevalidateFunction(
4880
- routeModule,
4881
- route.id,
4882
- needsRevalidation
4893
+ shouldRevalidate: (
4894
+ // When ssr is false and the root route has a `loader` without a
4895
+ // `clientLoader`, the `loader` data is static because it was rendered
4896
+ // at build time so we can just turn off revalidations. That way when
4897
+ // submitting to a clientAction on a non-prerendered path, we don't
4898
+ // try to reach out for a non-existent `.data` file which would have
4899
+ // the "revalidated" root data
4900
+ !ssr && route.id === "root" && route.hasLoader && !route.hasClientLoader ? () => false : getShouldRevalidateFunction(
4901
+ routeModule,
4902
+ route.id,
4903
+ needsRevalidation
4904
+ )
4883
4905
  )
4884
4906
  });
4885
4907
  let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
@@ -4895,7 +4917,6 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
4895
4917
  "No `routeModule` available for critical-route loader"
4896
4918
  );
4897
4919
  if (!routeModule.clientLoader) {
4898
- if (isSpaMode) return null;
4899
4920
  return fetchServerLoader(singleFetch);
4900
4921
  }
4901
4922
  return routeModule.clientLoader({
@@ -4950,7 +4971,6 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
4950
4971
  } else {
4951
4972
  if (!route.hasClientLoader) {
4952
4973
  dataRoute.loader = ({ request }, singleFetch) => prefetchStylesAndCallHandler(() => {
4953
- if (isSpaMode) return Promise.resolve(null);
4954
4974
  return fetchServerLoader(singleFetch);
4955
4975
  });
4956
4976
  } else if (route.clientLoaderModule) {
@@ -5047,6 +5067,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
5047
5067
  manifest,
5048
5068
  routeModulesCache,
5049
5069
  initialState,
5070
+ ssr,
5050
5071
  isSpaMode,
5051
5072
  route.id,
5052
5073
  routesByParentId,
@@ -5154,6 +5175,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, isSpaMo
5154
5175
  [path],
5155
5176
  manifest,
5156
5177
  routeModules,
5178
+ ssr,
5157
5179
  isSpaMode,
5158
5180
  basename,
5159
5181
  patch,
@@ -5193,6 +5215,7 @@ function useFogOFWarDiscovery(router2, manifest, routeModules, ssr, isSpaMode) {
5193
5215
  lazyPaths,
5194
5216
  manifest,
5195
5217
  routeModules,
5218
+ ssr,
5196
5219
  isSpaMode,
5197
5220
  router2.basename,
5198
5221
  router2.patchRoutes
@@ -5213,7 +5236,7 @@ function useFogOFWarDiscovery(router2, manifest, routeModules, ssr, isSpaMode) {
5213
5236
  return () => observer.disconnect();
5214
5237
  }, [ssr, isSpaMode, manifest, routeModules, router2]);
5215
5238
  }
5216
- async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpaMode, basename, patchRoutes, signal) {
5239
+ async function fetchAndApplyManifestPatches(paths, manifest, routeModules, ssr, isSpaMode, basename, patchRoutes, signal) {
5217
5240
  let manifestPath = `${basename != null ? basename : "/"}/__manifest`.replace(
5218
5241
  /\/+/g,
5219
5242
  "/"
@@ -5256,7 +5279,7 @@ async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpa
5256
5279
  parentIds.forEach(
5257
5280
  (parentId) => patchRoutes(
5258
5281
  parentId || null,
5259
- createClientRoutes(patches, routeModules, null, isSpaMode, parentId)
5282
+ createClientRoutes(patches, routeModules, null, ssr, isSpaMode, parentId)
5260
5283
  )
5261
5284
  );
5262
5285
  }
@@ -5517,6 +5540,7 @@ function createHydratedRouter() {
5517
5540
  ssrInfo.manifest.routes,
5518
5541
  ssrInfo.routeModules,
5519
5542
  ssrInfo.context.state,
5543
+ ssrInfo.context.ssr,
5520
5544
  ssrInfo.context.isSpaMode
5521
5545
  );
5522
5546
  let hydrationData = void 0;
@@ -5564,6 +5588,7 @@ function createHydratedRouter() {
5564
5588
  dataStrategy: ssrInfo.context.isSpaMode ? void 0 : getSingleFetchDataStrategy(
5565
5589
  ssrInfo.manifest,
5566
5590
  ssrInfo.routeModules,
5591
+ ssrInfo.context.ssr,
5567
5592
  () => router2
5568
5593
  ),
5569
5594
  patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-b9cf540fe
2
+ * react-router v0.0.0-experimental-902325fda
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-T4L7PBNQ.mjs";
28
+ } from "./chunk-XX7SEIOE.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -79,6 +79,7 @@ function createHydratedRouter() {
79
79
  ssrInfo.manifest.routes,
80
80
  ssrInfo.routeModules,
81
81
  ssrInfo.context.state,
82
+ ssrInfo.context.ssr,
82
83
  ssrInfo.context.isSpaMode
83
84
  );
84
85
  let hydrationData = void 0;
@@ -126,6 +127,7 @@ function createHydratedRouter() {
126
127
  dataStrategy: ssrInfo.context.isSpaMode ? void 0 : getSingleFetchDataStrategy(
127
128
  ssrInfo.manifest,
128
129
  ssrInfo.routeModules,
130
+ ssrInfo.context.ssr,
129
131
  () => router2
130
132
  ),
131
133
  patchRoutesOnNavigation: getPatchRoutesOnNavigationFunction(
@@ -437,8 +437,8 @@ interface EntryRoute extends Route {
437
437
  hydrateFallbackModule: string | undefined;
438
438
  parentId?: string;
439
439
  }
440
- declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, future: FutureConfig, isSpaMode: boolean): DataRouteObject[];
441
- declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
440
+ declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
441
+ declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
442
442
  declare function shouldHydrateRouteLoader(route: EntryRoute, routeModule: RouteModule, isSpaMode: boolean): boolean;
443
443
 
444
444
  type ParamKeyValuePair = [string, string];
@@ -437,8 +437,8 @@ interface EntryRoute extends Route {
437
437
  hydrateFallbackModule: string | undefined;
438
438
  parentId?: string;
439
439
  }
440
- declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, future: FutureConfig, isSpaMode: boolean): DataRouteObject[];
441
- declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
440
+ declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
441
+ declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
442
442
  declare function shouldHydrateRouteLoader(route: EntryRoute, routeModule: RouteModule, isSpaMode: boolean): boolean;
443
443
 
444
444
  type ParamKeyValuePair = [string, string];
@@ -1,7 +1,7 @@
1
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, 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, v as RouterState } from './route-data-DQbTMaUY.mjs';
2
2
  export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-DQbTMaUY.mjs';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-D8U3moAU.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-D8U3moAU.mjs';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-Cyo_TZuh.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-Cyo_TZuh.mjs';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -9,7 +9,7 @@ export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerialize
9
9
  import { A as AppLoadContext$1 } from './data-CQbyyGzl.mjs';
10
10
 
11
11
  declare const SingleFetchRedirectSymbol: unique symbol;
12
- declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, getRouter: () => Router): DataStrategyFunction;
12
+ declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, getRouter: () => Router): DataStrategyFunction;
13
13
  declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
14
14
  done: Promise<undefined>;
15
15
  value: unknown;
@@ -1,7 +1,7 @@
1
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, 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, v as RouterState } from './route-data-DQbTMaUY.js';
2
2
  export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-DQbTMaUY.js';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-DjxZtxiP.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-DjxZtxiP.js';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-Ax4Jg2xL.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-Ax4Jg2xL.js';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -9,7 +9,7 @@ export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerialize
9
9
  import { A as AppLoadContext$1 } from './data-CQbyyGzl.js';
10
10
 
11
11
  declare const SingleFetchRedirectSymbol: unique symbol;
12
- declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, getRouter: () => Router): DataStrategyFunction;
12
+ declare function getSingleFetchDataStrategy(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, getRouter: () => Router): DataStrategyFunction;
13
13
  declare function decodeViaTurboStream(body: ReadableStream<Uint8Array>, global: Window | typeof globalThis): Promise<{
14
14
  done: Promise<undefined>;
15
15
  value: unknown;