react-router 0.0.0-experimental-b2bc694a6 → 0.0.0-experimental-a25eed86d

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-b2bc694a6
2
+ * react-router v0.0.0-experimental-a25eed86d
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -974,53 +974,57 @@ function createRouter(init) {
974
974
  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
975
975
  let initialMatchesIsFOW = false;
976
976
  let initialErrors = null;
977
+ let initialized;
977
978
  if (initialMatches == null && !init.patchRoutesOnNavigation) {
978
979
  let error = getInternalRouterError(404, {
979
980
  pathname: init.history.location.pathname
980
981
  });
981
982
  let { matches, route } = getShortCircuitMatches(dataRoutes);
983
+ initialized = true;
982
984
  initialMatches = matches;
983
985
  initialErrors = { [route.id]: error };
984
- }
985
- if (initialMatches && !init.hydrationData) {
986
- let fogOfWar = checkFogOfWar(
987
- initialMatches,
988
- dataRoutes,
989
- init.history.location.pathname
990
- );
991
- if (fogOfWar.active) {
992
- initialMatches = null;
993
- }
994
- }
995
- let initialized;
996
- if (!initialMatches) {
997
- initialized = false;
998
- initialMatches = [];
999
- let fogOfWar = checkFogOfWar(
1000
- null,
1001
- dataRoutes,
1002
- init.history.location.pathname
1003
- );
1004
- if (fogOfWar.active && fogOfWar.matches) {
1005
- initialMatchesIsFOW = true;
1006
- initialMatches = fogOfWar.matches;
1007
- }
1008
- } else if (initialMatches.some((m) => m.route.lazy)) {
1009
- initialized = false;
1010
- } else if (!initialMatches.some((m) => m.route.loader)) {
1011
- initialized = true;
1012
986
  } else {
1013
- let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
1014
- let errors = init.hydrationData ? init.hydrationData.errors : null;
1015
- if (errors) {
1016
- let idx = initialMatches.findIndex(
1017
- (m) => errors[m.route.id] !== void 0
987
+ if (initialMatches && !init.hydrationData) {
988
+ let fogOfWar = checkFogOfWar(
989
+ initialMatches,
990
+ dataRoutes,
991
+ init.history.location.pathname
1018
992
  );
1019
- initialized = initialMatches.slice(0, idx + 1).every((m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
1020
- } else {
1021
- initialized = initialMatches.every(
1022
- (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
993
+ if (fogOfWar.active) {
994
+ initialMatches = null;
995
+ }
996
+ }
997
+ if (!initialMatches) {
998
+ initialized = false;
999
+ initialMatches = [];
1000
+ let fogOfWar = checkFogOfWar(
1001
+ null,
1002
+ dataRoutes,
1003
+ init.history.location.pathname
1023
1004
  );
1005
+ if (fogOfWar.active && fogOfWar.matches) {
1006
+ initialMatchesIsFOW = true;
1007
+ initialMatches = fogOfWar.matches;
1008
+ }
1009
+ } else if (initialMatches.some((m) => m.route.lazy)) {
1010
+ initialized = false;
1011
+ } else if (!initialMatches.some((m) => m.route.loader)) {
1012
+ initialized = true;
1013
+ } else {
1014
+ let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
1015
+ let errors = init.hydrationData ? init.hydrationData.errors : null;
1016
+ if (errors) {
1017
+ let idx = initialMatches.findIndex(
1018
+ (m) => errors[m.route.id] !== void 0
1019
+ );
1020
+ initialized = initialMatches.slice(0, idx + 1).every(
1021
+ (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
1022
+ );
1023
+ } else {
1024
+ initialized = initialMatches.every(
1025
+ (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors)
1026
+ );
1027
+ }
1024
1028
  }
1025
1029
  }
1026
1030
  let router;
@@ -3575,7 +3579,7 @@ function shouldLoadRouteOnHydration(route, loaderData, errors) {
3575
3579
  if (!route.loader) {
3576
3580
  return false;
3577
3581
  }
3578
- let hasData = loaderData != null && loaderData[route.id] !== void 0;
3582
+ let hasData = loaderData != null && route.id in loaderData;
3579
3583
  let hasError = errors != null && errors[route.id] !== void 0;
3580
3584
  if (!hasData && hasError) {
3581
3585
  return false;
@@ -7965,7 +7969,7 @@ function mergeRefs(...refs) {
7965
7969
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7966
7970
  try {
7967
7971
  if (isBrowser) {
7968
- window.__reactRouterVersion = "0.0.0-experimental-b2bc694a6";
7972
+ window.__reactRouterVersion = "0.0.0-experimental-a25eed86d";
7969
7973
  }
7970
7974
  } catch (e) {
7971
7975
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- import { RouterProviderProps as RouterProviderProps$1, RouterInit } from 'react-router';
2
+ import { R as RouterProviderProps$1 } from './fog-of-war-k8KWkMZc.js';
3
+ import { R as RouterInit } from './route-data-BvrN3Sw4.js';
3
4
 
4
5
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
5
6
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;