react-router 0.0.0-experimental-1fcc8eb1d → 0.0.0-experimental-17b9b60af

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-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5276,6 +5276,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5276
5276
  } else {
5277
5277
  children = outlet;
5278
5278
  }
5279
+ children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5279
5280
  return /* @__PURE__ */ React2.createElement(
5280
5281
  RenderedRoute,
5281
5282
  {
@@ -5302,6 +5303,19 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5302
5303
  ) : getChildren();
5303
5304
  }, null);
5304
5305
  }
5306
+ var RedirectBoundary = class extends React2.Component {
5307
+ // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5308
+ // If it's anything else, re-throw to bubble it up.
5309
+ static getDerivedStateFromError(error) {
5310
+ if (error === Symbol.for("react-router.redirect")) {
5311
+ return null;
5312
+ }
5313
+ throw error;
5314
+ }
5315
+ render() {
5316
+ return this.props.children;
5317
+ }
5318
+ };
5305
5319
  function getDataRouterConsoleError(hookName) {
5306
5320
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5307
5321
  }
@@ -8794,7 +8808,7 @@ function mergeRefs(...refs) {
8794
8808
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8795
8809
  try {
8796
8810
  if (isBrowser) {
8797
- window.__reactRouterVersion = "0.0.0-experimental-1fcc8eb1d";
8811
+ window.__reactRouterVersion = "0.0.0-experimental-17b9b60af";
8798
8812
  }
8799
8813
  } catch (e) {
8800
8814
  }
@@ -11498,8 +11512,6 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
11498
11512
  }
11499
11513
 
11500
11514
  // lib/rsc/browser.tsx
11501
- var neverResolvedPromise = new Promise(() => {
11502
- });
11503
11515
  function createCallServer({
11504
11516
  decode: decode2,
11505
11517
  encodeAction
@@ -11524,10 +11536,20 @@ function createCallServer({
11524
11536
  window.location.href = payload.location;
11525
11537
  return;
11526
11538
  }
11539
+ let reject;
11540
+ const promise = new Promise((resolve, rejectFn) => {
11541
+ reject = rejectFn;
11542
+ });
11543
+ const unsubscribe = window.__router.subscribe(({ navigation }) => {
11544
+ if (navigation.state === "idle") {
11545
+ unsubscribe();
11546
+ reject(Symbol.for("react-router.redirect"));
11547
+ }
11548
+ });
11527
11549
  window.__router.navigate(payload.location, {
11528
11550
  replace: payload.replace
11529
11551
  });
11530
- return neverResolvedPromise;
11552
+ return promise;
11531
11553
  }
11532
11554
  if (payload.type !== "action") {
11533
11555
  throw new Error("Unexpected payload type");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -26,7 +26,7 @@ import {
26
26
  invariant,
27
27
  mapRouteProperties,
28
28
  useFogOFWarDiscovery
29
- } from "./chunk-5QBUC2DR.mjs";
29
+ } from "./chunk-MV33LHGM.mjs";
30
30
 
31
31
  // lib/dom-export/dom-router-provider.tsx
32
32
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5435,6 +5435,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5435
5435
  } else {
5436
5436
  children = outlet;
5437
5437
  }
5438
+ children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5438
5439
  return /* @__PURE__ */ React2.createElement(
5439
5440
  RenderedRoute,
5440
5441
  {
@@ -5461,6 +5462,19 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5461
5462
  ) : getChildren();
5462
5463
  }, null);
5463
5464
  }
5465
+ var RedirectBoundary = class extends React2.Component {
5466
+ // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5467
+ // If it's anything else, re-throw to bubble it up.
5468
+ static getDerivedStateFromError(error) {
5469
+ if (error === Symbol.for("react-router.redirect")) {
5470
+ return null;
5471
+ }
5472
+ throw error;
5473
+ }
5474
+ render() {
5475
+ return this.props.children;
5476
+ }
5477
+ };
5464
5478
  function getDataRouterConsoleError(hookName) {
5465
5479
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5466
5480
  }
@@ -8953,7 +8967,7 @@ function mergeRefs(...refs) {
8953
8967
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8954
8968
  try {
8955
8969
  if (isBrowser) {
8956
- window.__reactRouterVersion = "0.0.0-experimental-1fcc8eb1d";
8970
+ window.__reactRouterVersion = "0.0.0-experimental-17b9b60af";
8957
8971
  }
8958
8972
  } catch (e) {
8959
8973
  }
@@ -11657,8 +11671,6 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
11657
11671
  }
11658
11672
 
11659
11673
  // lib/rsc/browser.tsx
11660
- var neverResolvedPromise = new Promise(() => {
11661
- });
11662
11674
  function createCallServer({
11663
11675
  decode: decode2,
11664
11676
  encodeAction
@@ -11683,10 +11695,20 @@ function createCallServer({
11683
11695
  window.location.href = payload.location;
11684
11696
  return;
11685
11697
  }
11698
+ let reject;
11699
+ const promise = new Promise((resolve, rejectFn) => {
11700
+ reject = rejectFn;
11701
+ });
11702
+ const unsubscribe = window.__router.subscribe(({ navigation }) => {
11703
+ if (navigation.state === "idle") {
11704
+ unsubscribe();
11705
+ reject(Symbol.for("react-router.redirect"));
11706
+ }
11707
+ });
11686
11708
  window.__router.navigate(payload.location, {
11687
11709
  replace: payload.replace
11688
11710
  });
11689
- return neverResolvedPromise;
11711
+ return promise;
11690
11712
  }
11691
11713
  if (payload.type !== "action") {
11692
11714
  throw new Error("Unexpected payload type");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -134,7 +134,7 @@ import {
134
134
  withComponentProps,
135
135
  withErrorBoundaryProps,
136
136
  withHydrateFallbackProps
137
- } from "./chunk-5QBUC2DR.mjs";
137
+ } from "./chunk-MV33LHGM.mjs";
138
138
  export {
139
139
  Await,
140
140
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
25
25
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
26
 
27
27
  /**
28
- * react-router v0.0.0-experimental-1fcc8eb1d
28
+ * react-router v0.0.0-experimental-17b9b60af
29
29
  *
30
30
  * Copyright (c) Remix Software Inc.
31
31
  *
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { splitCookiesString } from 'set-cookie-parser';
4
4
 
5
5
  /**
6
- * react-router v0.0.0-experimental-1fcc8eb1d
6
+ * react-router v0.0.0-experimental-17b9b60af
7
7
  *
8
8
  * Copyright (c) Remix Software Inc.
9
9
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5276,6 +5276,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5276
5276
  } else {
5277
5277
  children = outlet;
5278
5278
  }
5279
+ children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5279
5280
  return /* @__PURE__ */ React2.createElement(
5280
5281
  RenderedRoute,
5281
5282
  {
@@ -5302,6 +5303,19 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5302
5303
  ) : getChildren();
5303
5304
  }, null);
5304
5305
  }
5306
+ var RedirectBoundary = class extends React2.Component {
5307
+ // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5308
+ // If it's anything else, re-throw to bubble it up.
5309
+ static getDerivedStateFromError(error) {
5310
+ if (error === Symbol.for("react-router.redirect")) {
5311
+ return null;
5312
+ }
5313
+ throw error;
5314
+ }
5315
+ render() {
5316
+ return this.props.children;
5317
+ }
5318
+ };
5305
5319
  function getDataRouterConsoleError(hookName) {
5306
5320
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5307
5321
  }
@@ -8794,7 +8808,7 @@ function mergeRefs(...refs) {
8794
8808
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8795
8809
  try {
8796
8810
  if (isBrowser) {
8797
- window.__reactRouterVersion = "0.0.0-experimental-1fcc8eb1d";
8811
+ window.__reactRouterVersion = "0.0.0-experimental-17b9b60af";
8798
8812
  }
8799
8813
  } catch (e) {
8800
8814
  }
@@ -11498,8 +11512,6 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
11498
11512
  }
11499
11513
 
11500
11514
  // lib/rsc/browser.tsx
11501
- var neverResolvedPromise = new Promise(() => {
11502
- });
11503
11515
  function createCallServer({
11504
11516
  decode: decode2,
11505
11517
  encodeAction
@@ -11524,10 +11536,20 @@ function createCallServer({
11524
11536
  window.location.href = payload.location;
11525
11537
  return;
11526
11538
  }
11539
+ let reject;
11540
+ const promise = new Promise((resolve, rejectFn) => {
11541
+ reject = rejectFn;
11542
+ });
11543
+ const unsubscribe = window.__router.subscribe(({ navigation }) => {
11544
+ if (navigation.state === "idle") {
11545
+ unsubscribe();
11546
+ reject(Symbol.for("react-router.redirect"));
11547
+ }
11548
+ });
11527
11549
  window.__router.navigate(payload.location, {
11528
11550
  replace: payload.replace
11529
11551
  });
11530
- return neverResolvedPromise;
11552
+ return promise;
11531
11553
  }
11532
11554
  if (payload.type !== "action") {
11533
11555
  throw new Error("Unexpected payload type");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -26,7 +26,7 @@ import {
26
26
  invariant,
27
27
  mapRouteProperties,
28
28
  useFogOFWarDiscovery
29
- } from "./chunk-JCSCMN5T.mjs";
29
+ } from "./chunk-6E4NX5TN.mjs";
30
30
 
31
31
  // lib/dom-export/dom-router-provider.tsx
32
32
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -5435,6 +5435,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5435
5435
  } else {
5436
5436
  children = outlet;
5437
5437
  }
5438
+ children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
5438
5439
  return /* @__PURE__ */ React2.createElement(
5439
5440
  RenderedRoute,
5440
5441
  {
@@ -5461,6 +5462,19 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
5461
5462
  ) : getChildren();
5462
5463
  }, null);
5463
5464
  }
5465
+ var RedirectBoundary = class extends React2.Component {
5466
+ // If the error is Symbol.for("react-router.redirect"), keep rendering children.
5467
+ // If it's anything else, re-throw to bubble it up.
5468
+ static getDerivedStateFromError(error) {
5469
+ if (error === Symbol.for("react-router.redirect")) {
5470
+ return null;
5471
+ }
5472
+ throw error;
5473
+ }
5474
+ render() {
5475
+ return this.props.children;
5476
+ }
5477
+ };
5464
5478
  function getDataRouterConsoleError(hookName) {
5465
5479
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
5466
5480
  }
@@ -8953,7 +8967,7 @@ function mergeRefs(...refs) {
8953
8967
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
8954
8968
  try {
8955
8969
  if (isBrowser) {
8956
- window.__reactRouterVersion = "0.0.0-experimental-1fcc8eb1d";
8970
+ window.__reactRouterVersion = "0.0.0-experimental-17b9b60af";
8957
8971
  }
8958
8972
  } catch (e) {
8959
8973
  }
@@ -11657,8 +11671,6 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
11657
11671
  }
11658
11672
 
11659
11673
  // lib/rsc/browser.tsx
11660
- var neverResolvedPromise = new Promise(() => {
11661
- });
11662
11674
  function createCallServer({
11663
11675
  decode: decode2,
11664
11676
  encodeAction
@@ -11683,10 +11695,20 @@ function createCallServer({
11683
11695
  window.location.href = payload.location;
11684
11696
  return;
11685
11697
  }
11698
+ let reject;
11699
+ const promise = new Promise((resolve, rejectFn) => {
11700
+ reject = rejectFn;
11701
+ });
11702
+ const unsubscribe = window.__router.subscribe(({ navigation }) => {
11703
+ if (navigation.state === "idle") {
11704
+ unsubscribe();
11705
+ reject(Symbol.for("react-router.redirect"));
11706
+ }
11707
+ });
11686
11708
  window.__router.navigate(payload.location, {
11687
11709
  replace: payload.replace
11688
11710
  });
11689
- return neverResolvedPromise;
11711
+ return promise;
11690
11712
  }
11691
11713
  if (payload.type !== "action") {
11692
11714
  throw new Error("Unexpected payload type");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -134,7 +134,7 @@ import {
134
134
  withComponentProps,
135
135
  withErrorBoundaryProps,
136
136
  withHydrateFallbackProps
137
- } from "./chunk-JCSCMN5T.mjs";
137
+ } from "./chunk-6E4NX5TN.mjs";
138
138
  export {
139
139
  Await,
140
140
  BrowserRouter,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-1fcc8eb1d
2
+ * react-router v0.0.0-experimental-17b9b60af
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
25
25
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
26
 
27
27
  /**
28
- * react-router v0.0.0-experimental-1fcc8eb1d
28
+ * react-router v0.0.0-experimental-17b9b60af
29
29
  *
30
30
  * Copyright (c) Remix Software Inc.
31
31
  *
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { splitCookiesString } from 'set-cookie-parser';
4
4
 
5
5
  /**
6
- * react-router v0.0.0-experimental-1fcc8eb1d
6
+ * react-router v0.0.0-experimental-17b9b60af
7
7
  *
8
8
  * Copyright (c) Remix Software Inc.
9
9
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "0.0.0-experimental-1fcc8eb1d",
3
+ "version": "0.0.0-experimental-17b9b60af",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",