react-router 0.0.0-experimental-add6f8aa → 0.0.0-experimental-e960cf1a

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-add6f8aa
2
+ * React Router v0.0.0-experimental-e960cf1a
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -400,7 +400,7 @@
400
400
  });
401
401
  {
402
402
  router.UNSAFE_warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") ;
403
- router.UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") ;
403
+ router.UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") ;
404
404
  }
405
405
  let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {
406
406
  params: Object.assign({}, parentParams, match.params),
@@ -574,24 +574,17 @@
574
574
  if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
575
575
  fallbackIndex = i;
576
576
  }
577
- if (match.route.id) {
578
- let {
579
- loaderData,
580
- errors
581
- } = dataRouterState;
582
- let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);
583
- if (match.route.lazy || needsToRunLoader) {
584
- // We found the first route that's not ready to render (waiting on
585
- // lazy, or has a loader that hasn't run yet). Flag that we need to
586
- // render a fallback and render up until the appropriate fallback
587
- renderFallback = true;
588
- if (fallbackIndex >= 0) {
589
- renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
590
- } else {
591
- renderedMatches = [renderedMatches[0]];
592
- }
593
- break;
577
+ if (match.route.loader && match.route.id && dataRouterState.loaderData[match.route.id] === undefined && (!dataRouterState.errors || dataRouterState.errors[match.route.id] === undefined)) {
578
+ // We found the first route without data/errors which means it's loader
579
+ // still needs to run. Flag that we need to render a fallback and
580
+ // render up until the appropriate fallback
581
+ renderFallback = true;
582
+ if (fallbackIndex >= 0) {
583
+ renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
584
+ } else {
585
+ renderedMatches = [renderedMatches[0]];
594
586
  }
587
+ break;
595
588
  }
596
589
  }
597
590
  }
@@ -969,7 +962,7 @@
969
962
  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)
970
963
  React__namespace.useLayoutEffect(() => router$1.subscribe(setState), [router$1, setState]);
971
964
  React__namespace.useEffect(() => {
972
- router.UNSAFE_warning(fallbackElement == null || !router$1.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") ;
965
+ router.UNSAFE_warning(fallbackElement == null || !router$1.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`") ;
973
966
  // Only log this once on initial mount
974
967
  // eslint-disable-next-line react-hooks/exhaustive-deps
975
968
  }, []);
@@ -994,7 +987,10 @@
994
987
  router: router$1,
995
988
  navigator,
996
989
  static: false,
997
- basename
990
+ basename,
991
+ future: {
992
+ v7_relativeSplatPath: router$1.future.v7_relativeSplatPath
993
+ }
998
994
  }), [router$1, navigator, basename]);
999
995
 
1000
996
  // The fragment and {null} here are important! We need them to keep React 18's
@@ -1011,11 +1007,8 @@
1011
1007
  basename: basename,
1012
1008
  location: state.location,
1013
1009
  navigationType: state.historyAction,
1014
- navigator: navigator,
1015
- future: {
1016
- v7_relativeSplatPath: router$1.future.v7_relativeSplatPath
1017
- }
1018
- }, state.initialized || router$1.future.v7_partialHydration ? /*#__PURE__*/React__namespace.createElement(DataRoutes, {
1010
+ navigator: navigator
1011
+ }, state.initialized ? /*#__PURE__*/React__namespace.createElement(DataRoutes, {
1019
1012
  routes: router$1.routes,
1020
1013
  future: router$1.future,
1021
1014
  state: state
@@ -1449,7 +1442,8 @@
1449
1442
  }),
1450
1443
  hydrationData: opts == null ? void 0 : opts.hydrationData,
1451
1444
  routes,
1452
- mapRouteProperties
1445
+ mapRouteProperties,
1446
+ unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy
1453
1447
  }).initialize();
1454
1448
  }
1455
1449