react-router 0.0.0-experimental-6844c5934 → 0.0.0-experimental-1ebb6d403
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.
- package/dist/development/{chunk-U3YJJR4X.mjs → chunk-5XVYBMAF.mjs} +271 -286
- package/dist/development/dom-export.d.mts +3 -5
- package/dist/development/dom-export.d.ts +3 -5
- package/dist/development/dom-export.js +121 -136
- package/dist/development/dom-export.mjs +9 -18
- package/dist/{production/fog-of-war-D8HgFD2R.d.ts → development/fog-of-war-7V7BguJA.d.ts} +72 -13
- package/dist/development/{fog-of-war-DhPlOTYA.d.mts → fog-of-war-NQCW9yWR.d.mts} +72 -13
- package/dist/development/index.d.mts +14 -9
- package/dist/development/index.d.ts +14 -9
- package/dist/development/index.js +271 -285
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/route-module.d.mts +1 -1
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-Dwy1K32H.d.ts → route-data-JFOfNyPS.d.mts} +7 -78
- package/dist/{production/route-data-Dwy1K32H.d.mts → development/route-data-JFOfNyPS.d.ts} +7 -78
- package/dist/development/server.d.mts +988 -0
- package/dist/development/server.d.ts +988 -0
- package/dist/development/server.js +1429 -0
- package/dist/development/server.mjs +1406 -0
- package/dist/production/{chunk-PUDTWONU.mjs → chunk-CKFZHSMW.mjs} +271 -286
- package/dist/production/dom-export.d.mts +3 -5
- package/dist/production/dom-export.d.ts +3 -5
- package/dist/production/dom-export.js +121 -136
- package/dist/production/dom-export.mjs +9 -18
- package/dist/{development/fog-of-war-D8HgFD2R.d.ts → production/fog-of-war-7V7BguJA.d.ts} +72 -13
- package/dist/production/{fog-of-war-DhPlOTYA.d.mts → fog-of-war-NQCW9yWR.d.mts} +72 -13
- package/dist/production/index.d.mts +14 -9
- package/dist/production/index.d.ts +14 -9
- package/dist/production/index.js +271 -285
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/route-module.d.mts +1 -1
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-Dwy1K32H.d.ts → route-data-JFOfNyPS.d.mts} +7 -78
- package/dist/{development/route-data-Dwy1K32H.d.mts → production/route-data-JFOfNyPS.d.ts} +7 -78
- package/dist/production/server.d.mts +988 -0
- package/dist/production/server.d.ts +988 -0
- package/dist/production/server.js +1405 -0
- package/dist/production/server.mjs +1382 -0
- package/package.json +17 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-1ebb6d403
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -812,10 +812,7 @@ var redirect = (url, init = 302) => {
|
|
|
812
812
|
}
|
|
813
813
|
let headers = new Headers(responseInit.headers);
|
|
814
814
|
headers.set("Location", url);
|
|
815
|
-
return new Response(null, {
|
|
816
|
-
...responseInit,
|
|
817
|
-
headers
|
|
818
|
-
});
|
|
815
|
+
return new Response(null, { ...responseInit, headers });
|
|
819
816
|
};
|
|
820
817
|
var redirectDocument = (url, init) => {
|
|
821
818
|
let response = redirect(url, init);
|
|
@@ -1098,6 +1095,11 @@ function createRouter(init) {
|
|
|
1098
1095
|
}
|
|
1099
1096
|
}
|
|
1100
1097
|
});
|
|
1098
|
+
fetchersQueuedForDeletion.forEach((key) => {
|
|
1099
|
+
if (!state.fetchers.has(key) && !fetchControllers.has(key)) {
|
|
1100
|
+
unmountedFetchers.push(key);
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1101
1103
|
[...subscribers].forEach(
|
|
1102
1104
|
(subscriber) => subscriber(state, {
|
|
1103
1105
|
deletedFetchers: unmountedFetchers,
|
|
@@ -4022,7 +4024,7 @@ function createDeferred() {
|
|
|
4022
4024
|
}
|
|
4023
4025
|
|
|
4024
4026
|
// lib/components.tsx
|
|
4025
|
-
import * as
|
|
4027
|
+
import * as React4 from "react";
|
|
4026
4028
|
|
|
4027
4029
|
// lib/context.ts
|
|
4028
4030
|
import * as React from "react";
|
|
@@ -4640,8 +4642,23 @@ function warnOnce(condition, message) {
|
|
|
4640
4642
|
}
|
|
4641
4643
|
}
|
|
4642
4644
|
|
|
4643
|
-
// lib/
|
|
4645
|
+
// lib/dom/shared.tsx
|
|
4646
|
+
import * as React3 from "react";
|
|
4644
4647
|
var ENABLE_DEV_WARNINGS2 = true;
|
|
4648
|
+
function createHref(to) {
|
|
4649
|
+
return typeof to === "string" ? to : createPath(to);
|
|
4650
|
+
}
|
|
4651
|
+
function encodeLocation(to) {
|
|
4652
|
+
let href = typeof to === "string" ? to : createPath(to);
|
|
4653
|
+
href = href.replace(/ $/, "%20");
|
|
4654
|
+
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
4655
|
+
return {
|
|
4656
|
+
pathname: encoded.pathname,
|
|
4657
|
+
search: encoded.search,
|
|
4658
|
+
hash: encoded.hash
|
|
4659
|
+
};
|
|
4660
|
+
}
|
|
4661
|
+
var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
4645
4662
|
function mapRouteProperties(route) {
|
|
4646
4663
|
let updates = {
|
|
4647
4664
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
@@ -4692,6 +4709,8 @@ function mapRouteProperties(route) {
|
|
|
4692
4709
|
}
|
|
4693
4710
|
return updates;
|
|
4694
4711
|
}
|
|
4712
|
+
|
|
4713
|
+
// lib/components.tsx
|
|
4695
4714
|
function createMemoryRouter(routes, opts) {
|
|
4696
4715
|
return createRouter({
|
|
4697
4716
|
basename: opts?.basename,
|
|
@@ -4730,23 +4749,23 @@ function RouterProvider({
|
|
|
4730
4749
|
router,
|
|
4731
4750
|
flushSync: reactDomFlushSyncImpl
|
|
4732
4751
|
}) {
|
|
4733
|
-
let [state, setStateImpl] =
|
|
4734
|
-
let [pendingState, setPendingState] =
|
|
4735
|
-
let [vtContext, setVtContext] =
|
|
4752
|
+
let [state, setStateImpl] = React4.useState(router.state);
|
|
4753
|
+
let [pendingState, setPendingState] = React4.useState();
|
|
4754
|
+
let [vtContext, setVtContext] = React4.useState({
|
|
4736
4755
|
isTransitioning: false
|
|
4737
4756
|
});
|
|
4738
|
-
let [renderDfd, setRenderDfd] =
|
|
4739
|
-
let [transition, setTransition] =
|
|
4740
|
-
let [interruption, setInterruption] =
|
|
4741
|
-
let fetcherData =
|
|
4742
|
-
let setState =
|
|
4757
|
+
let [renderDfd, setRenderDfd] = React4.useState();
|
|
4758
|
+
let [transition, setTransition] = React4.useState();
|
|
4759
|
+
let [interruption, setInterruption] = React4.useState();
|
|
4760
|
+
let fetcherData = React4.useRef(/* @__PURE__ */ new Map());
|
|
4761
|
+
let setState = React4.useCallback(
|
|
4743
4762
|
(newState, { deletedFetchers, flushSync, viewTransitionOpts }) => {
|
|
4744
|
-
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
4745
4763
|
newState.fetchers.forEach((fetcher, key) => {
|
|
4746
4764
|
if (fetcher.data !== void 0) {
|
|
4747
4765
|
fetcherData.current.set(key, fetcher.data);
|
|
4748
4766
|
}
|
|
4749
4767
|
});
|
|
4768
|
+
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
4750
4769
|
warnOnce(
|
|
4751
4770
|
flushSync === false || reactDomFlushSyncImpl != null,
|
|
4752
4771
|
'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
|
|
@@ -4760,7 +4779,7 @@ function RouterProvider({
|
|
|
4760
4779
|
if (reactDomFlushSyncImpl && flushSync) {
|
|
4761
4780
|
reactDomFlushSyncImpl(() => setStateImpl(newState));
|
|
4762
4781
|
} else {
|
|
4763
|
-
|
|
4782
|
+
React4.startTransition(() => setStateImpl(newState));
|
|
4764
4783
|
}
|
|
4765
4784
|
return;
|
|
4766
4785
|
}
|
|
@@ -4811,18 +4830,18 @@ function RouterProvider({
|
|
|
4811
4830
|
},
|
|
4812
4831
|
[router.window, reactDomFlushSyncImpl, transition, renderDfd]
|
|
4813
4832
|
);
|
|
4814
|
-
|
|
4815
|
-
|
|
4833
|
+
React4.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
|
|
4834
|
+
React4.useEffect(() => {
|
|
4816
4835
|
if (vtContext.isTransitioning && !vtContext.flushSync) {
|
|
4817
4836
|
setRenderDfd(new Deferred());
|
|
4818
4837
|
}
|
|
4819
4838
|
}, [vtContext]);
|
|
4820
|
-
|
|
4839
|
+
React4.useEffect(() => {
|
|
4821
4840
|
if (renderDfd && pendingState && router.window) {
|
|
4822
4841
|
let newState = pendingState;
|
|
4823
4842
|
let renderPromise = renderDfd.promise;
|
|
4824
4843
|
let transition2 = router.window.document.startViewTransition(async () => {
|
|
4825
|
-
|
|
4844
|
+
React4.startTransition(() => setStateImpl(newState));
|
|
4826
4845
|
await renderPromise;
|
|
4827
4846
|
});
|
|
4828
4847
|
transition2.finished.finally(() => {
|
|
@@ -4834,12 +4853,12 @@ function RouterProvider({
|
|
|
4834
4853
|
setTransition(transition2);
|
|
4835
4854
|
}
|
|
4836
4855
|
}, [pendingState, renderDfd, router.window]);
|
|
4837
|
-
|
|
4856
|
+
React4.useEffect(() => {
|
|
4838
4857
|
if (renderDfd && pendingState && state.location.key === pendingState.location.key) {
|
|
4839
4858
|
renderDfd.resolve();
|
|
4840
4859
|
}
|
|
4841
4860
|
}, [renderDfd, transition, state.location, pendingState]);
|
|
4842
|
-
|
|
4861
|
+
React4.useEffect(() => {
|
|
4843
4862
|
if (!vtContext.isTransitioning && interruption) {
|
|
4844
4863
|
setPendingState(interruption.state);
|
|
4845
4864
|
setVtContext({
|
|
@@ -4851,7 +4870,7 @@ function RouterProvider({
|
|
|
4851
4870
|
setInterruption(void 0);
|
|
4852
4871
|
}
|
|
4853
4872
|
}, [vtContext.isTransitioning, interruption]);
|
|
4854
|
-
let navigator2 =
|
|
4873
|
+
let navigator2 = React4.useMemo(() => {
|
|
4855
4874
|
return {
|
|
4856
4875
|
createHref: router.createHref,
|
|
4857
4876
|
encodeLocation: router.encodeLocation,
|
|
@@ -4868,7 +4887,7 @@ function RouterProvider({
|
|
|
4868
4887
|
};
|
|
4869
4888
|
}, [router]);
|
|
4870
4889
|
let basename = router.basename || "/";
|
|
4871
|
-
let dataRouterContext =
|
|
4890
|
+
let dataRouterContext = React4.useMemo(
|
|
4872
4891
|
() => ({
|
|
4873
4892
|
router,
|
|
4874
4893
|
navigator: navigator2,
|
|
@@ -4877,7 +4896,7 @@ function RouterProvider({
|
|
|
4877
4896
|
}),
|
|
4878
4897
|
[router, navigator2, basename]
|
|
4879
4898
|
);
|
|
4880
|
-
return /* @__PURE__ */
|
|
4899
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React4.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React4.createElement(FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React4.createElement(ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React4.createElement(
|
|
4881
4900
|
Router,
|
|
4882
4901
|
{
|
|
4883
4902
|
basename,
|
|
@@ -4885,7 +4904,7 @@ function RouterProvider({
|
|
|
4885
4904
|
navigationType: state.historyAction,
|
|
4886
4905
|
navigator: navigator2
|
|
4887
4906
|
},
|
|
4888
|
-
/* @__PURE__ */
|
|
4907
|
+
/* @__PURE__ */ React4.createElement(
|
|
4889
4908
|
MemoizedDataRoutes,
|
|
4890
4909
|
{
|
|
4891
4910
|
routes: router.routes,
|
|
@@ -4895,7 +4914,7 @@ function RouterProvider({
|
|
|
4895
4914
|
)
|
|
4896
4915
|
))))), null);
|
|
4897
4916
|
}
|
|
4898
|
-
var MemoizedDataRoutes =
|
|
4917
|
+
var MemoizedDataRoutes = React4.memo(DataRoutes);
|
|
4899
4918
|
function DataRoutes({
|
|
4900
4919
|
routes,
|
|
4901
4920
|
future,
|
|
@@ -4909,7 +4928,7 @@ function MemoryRouter({
|
|
|
4909
4928
|
initialEntries,
|
|
4910
4929
|
initialIndex
|
|
4911
4930
|
}) {
|
|
4912
|
-
let historyRef =
|
|
4931
|
+
let historyRef = React4.useRef();
|
|
4913
4932
|
if (historyRef.current == null) {
|
|
4914
4933
|
historyRef.current = createMemoryHistory({
|
|
4915
4934
|
initialEntries,
|
|
@@ -4918,18 +4937,18 @@ function MemoryRouter({
|
|
|
4918
4937
|
});
|
|
4919
4938
|
}
|
|
4920
4939
|
let history = historyRef.current;
|
|
4921
|
-
let [state, setStateImpl] =
|
|
4940
|
+
let [state, setStateImpl] = React4.useState({
|
|
4922
4941
|
action: history.action,
|
|
4923
4942
|
location: history.location
|
|
4924
4943
|
});
|
|
4925
|
-
let setState =
|
|
4944
|
+
let setState = React4.useCallback(
|
|
4926
4945
|
(newState) => {
|
|
4927
|
-
|
|
4946
|
+
React4.startTransition(() => setStateImpl(newState));
|
|
4928
4947
|
},
|
|
4929
4948
|
[setStateImpl]
|
|
4930
4949
|
);
|
|
4931
|
-
|
|
4932
|
-
return /* @__PURE__ */
|
|
4950
|
+
React4.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
4951
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4933
4952
|
Router,
|
|
4934
4953
|
{
|
|
4935
4954
|
basename,
|
|
@@ -4952,12 +4971,12 @@ function Navigate({
|
|
|
4952
4971
|
// the router loaded. We can help them understand how to avoid that.
|
|
4953
4972
|
`<Navigate> may be used only in the context of a <Router> component.`
|
|
4954
4973
|
);
|
|
4955
|
-
let { static: isStatic } =
|
|
4974
|
+
let { static: isStatic } = React4.useContext(NavigationContext);
|
|
4956
4975
|
warning(
|
|
4957
4976
|
!isStatic,
|
|
4958
4977
|
`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
|
|
4959
4978
|
);
|
|
4960
|
-
let { matches } =
|
|
4979
|
+
let { matches } = React4.useContext(RouteContext);
|
|
4961
4980
|
let { pathname: locationPathname } = useLocation();
|
|
4962
4981
|
let navigate = useNavigate();
|
|
4963
4982
|
let path = resolveTo(
|
|
@@ -4967,7 +4986,7 @@ function Navigate({
|
|
|
4967
4986
|
relative === "path"
|
|
4968
4987
|
);
|
|
4969
4988
|
let jsonPath = JSON.stringify(path);
|
|
4970
|
-
|
|
4989
|
+
React4.useEffect(() => {
|
|
4971
4990
|
navigate(JSON.parse(jsonPath), { replace: replace2, state, relative });
|
|
4972
4991
|
}, [navigate, jsonPath, relative, replace2, state]);
|
|
4973
4992
|
return null;
|
|
@@ -4994,7 +5013,7 @@ function Router({
|
|
|
4994
5013
|
`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
|
|
4995
5014
|
);
|
|
4996
5015
|
let basename = basenameProp.replace(/^\/*/, "/");
|
|
4997
|
-
let navigationContext =
|
|
5016
|
+
let navigationContext = React4.useMemo(
|
|
4998
5017
|
() => ({
|
|
4999
5018
|
basename,
|
|
5000
5019
|
navigator: navigator2,
|
|
@@ -5013,7 +5032,7 @@ function Router({
|
|
|
5013
5032
|
state = null,
|
|
5014
5033
|
key = "default"
|
|
5015
5034
|
} = locationProp;
|
|
5016
|
-
let locationContext =
|
|
5035
|
+
let locationContext = React4.useMemo(() => {
|
|
5017
5036
|
let trailingPathname = stripBasename(pathname, basename);
|
|
5018
5037
|
if (trailingPathname == null) {
|
|
5019
5038
|
return null;
|
|
@@ -5036,7 +5055,7 @@ function Router({
|
|
|
5036
5055
|
if (locationContext == null) {
|
|
5037
5056
|
return null;
|
|
5038
5057
|
}
|
|
5039
|
-
return /* @__PURE__ */
|
|
5058
|
+
return /* @__PURE__ */ React4.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React4.createElement(LocationContext.Provider, { children, value: locationContext }));
|
|
5040
5059
|
}
|
|
5041
5060
|
function Routes({
|
|
5042
5061
|
children,
|
|
@@ -5049,9 +5068,9 @@ function Await({
|
|
|
5049
5068
|
errorElement,
|
|
5050
5069
|
resolve
|
|
5051
5070
|
}) {
|
|
5052
|
-
return /* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ React4.createElement(AwaitErrorBoundary, { resolve, errorElement }, /* @__PURE__ */ React4.createElement(ResolveAwait, null, children));
|
|
5053
5072
|
}
|
|
5054
|
-
var AwaitErrorBoundary = class extends
|
|
5073
|
+
var AwaitErrorBoundary = class extends React4.Component {
|
|
5055
5074
|
constructor(props) {
|
|
5056
5075
|
super(props);
|
|
5057
5076
|
this.state = { error: null };
|
|
@@ -5097,10 +5116,10 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
5097
5116
|
throw promise._error;
|
|
5098
5117
|
}
|
|
5099
5118
|
if (status === 2 /* error */) {
|
|
5100
|
-
return /* @__PURE__ */
|
|
5119
|
+
return /* @__PURE__ */ React4.createElement(AwaitContext.Provider, { value: promise, children: errorElement });
|
|
5101
5120
|
}
|
|
5102
5121
|
if (status === 1 /* success */) {
|
|
5103
|
-
return /* @__PURE__ */
|
|
5122
|
+
return /* @__PURE__ */ React4.createElement(AwaitContext.Provider, { value: promise, children });
|
|
5104
5123
|
}
|
|
5105
5124
|
throw promise;
|
|
5106
5125
|
}
|
|
@@ -5110,16 +5129,16 @@ function ResolveAwait({
|
|
|
5110
5129
|
}) {
|
|
5111
5130
|
let data2 = useAsyncValue();
|
|
5112
5131
|
let toRender = typeof children === "function" ? children(data2) : children;
|
|
5113
|
-
return /* @__PURE__ */
|
|
5132
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, toRender);
|
|
5114
5133
|
}
|
|
5115
5134
|
function createRoutesFromChildren(children, parentPath = []) {
|
|
5116
5135
|
let routes = [];
|
|
5117
|
-
|
|
5118
|
-
if (!
|
|
5136
|
+
React4.Children.forEach(children, (element, index) => {
|
|
5137
|
+
if (!React4.isValidElement(element)) {
|
|
5119
5138
|
return;
|
|
5120
5139
|
}
|
|
5121
5140
|
let treePath = [...parentPath, index];
|
|
5122
|
-
if (element.type ===
|
|
5141
|
+
if (element.type === React4.Fragment) {
|
|
5123
5142
|
routes.push.apply(
|
|
5124
5143
|
routes,
|
|
5125
5144
|
createRoutesFromChildren(element.props.children, treePath)
|
|
@@ -5168,7 +5187,7 @@ function renderMatches(matches) {
|
|
|
5168
5187
|
}
|
|
5169
5188
|
|
|
5170
5189
|
// lib/dom/lib.tsx
|
|
5171
|
-
import * as
|
|
5190
|
+
import * as React11 from "react";
|
|
5172
5191
|
|
|
5173
5192
|
// lib/dom/dom.ts
|
|
5174
5193
|
var defaultMethod = "get";
|
|
@@ -5299,7 +5318,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
5299
5318
|
}
|
|
5300
5319
|
|
|
5301
5320
|
// lib/dom/ssr/components.tsx
|
|
5302
|
-
import * as
|
|
5321
|
+
import * as React10 from "react";
|
|
5303
5322
|
|
|
5304
5323
|
// lib/dom/ssr/invariant.ts
|
|
5305
5324
|
function invariant2(value, message) {
|
|
@@ -5308,6 +5327,34 @@ function invariant2(value, message) {
|
|
|
5308
5327
|
}
|
|
5309
5328
|
}
|
|
5310
5329
|
|
|
5330
|
+
// lib/dom/ssr/routeModules.ts
|
|
5331
|
+
async function loadRouteModule(route, routeModulesCache) {
|
|
5332
|
+
if (route.id in routeModulesCache) {
|
|
5333
|
+
return routeModulesCache[route.id];
|
|
5334
|
+
}
|
|
5335
|
+
try {
|
|
5336
|
+
let routeModule = await import(
|
|
5337
|
+
/* @vite-ignore */
|
|
5338
|
+
/* webpackIgnore: true */
|
|
5339
|
+
route.module
|
|
5340
|
+
);
|
|
5341
|
+
routeModulesCache[route.id] = routeModule;
|
|
5342
|
+
return routeModule;
|
|
5343
|
+
} catch (error) {
|
|
5344
|
+
console.error(
|
|
5345
|
+
`Error loading route module \`${route.module}\`, reloading page...`
|
|
5346
|
+
);
|
|
5347
|
+
console.error(error);
|
|
5348
|
+
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
|
|
5349
|
+
import.meta.hot) {
|
|
5350
|
+
throw error;
|
|
5351
|
+
}
|
|
5352
|
+
window.location.reload();
|
|
5353
|
+
return new Promise(() => {
|
|
5354
|
+
});
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
|
|
5311
5358
|
// lib/dom/ssr/links.ts
|
|
5312
5359
|
function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
5313
5360
|
let descriptors = matches.map((match) => {
|
|
@@ -5378,7 +5425,7 @@ function isHtmlLinkDescriptor(object) {
|
|
|
5378
5425
|
}
|
|
5379
5426
|
return typeof object.rel === "string" && typeof object.href === "string";
|
|
5380
5427
|
}
|
|
5381
|
-
async function getKeyedPrefetchLinks(matches, manifest, routeModules
|
|
5428
|
+
async function getKeyedPrefetchLinks(matches, manifest, routeModules) {
|
|
5382
5429
|
let links = await Promise.all(
|
|
5383
5430
|
matches.map(async (match) => {
|
|
5384
5431
|
let route = manifest.routes[match.route.id];
|
|
@@ -5523,7 +5570,7 @@ function createHtml(html) {
|
|
|
5523
5570
|
}
|
|
5524
5571
|
|
|
5525
5572
|
// lib/dom/ssr/single-fetch.tsx
|
|
5526
|
-
import * as
|
|
5573
|
+
import * as React5 from "react";
|
|
5527
5574
|
import { decode } from "turbo-stream";
|
|
5528
5575
|
|
|
5529
5576
|
// lib/dom/ssr/data.ts
|
|
@@ -5581,7 +5628,7 @@ function StreamTransfer({
|
|
|
5581
5628
|
throw promise;
|
|
5582
5629
|
}
|
|
5583
5630
|
let { done, value } = promise.result;
|
|
5584
|
-
let scriptTag = value ? /* @__PURE__ */
|
|
5631
|
+
let scriptTag = value ? /* @__PURE__ */ React5.createElement(
|
|
5585
5632
|
"script",
|
|
5586
5633
|
{
|
|
5587
5634
|
nonce,
|
|
@@ -5593,7 +5640,7 @@ function StreamTransfer({
|
|
|
5593
5640
|
}
|
|
5594
5641
|
) : null;
|
|
5595
5642
|
if (done) {
|
|
5596
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, scriptTag, /* @__PURE__ */ React5.createElement(
|
|
5597
5644
|
"script",
|
|
5598
5645
|
{
|
|
5599
5646
|
nonce,
|
|
@@ -5603,7 +5650,7 @@ function StreamTransfer({
|
|
|
5603
5650
|
}
|
|
5604
5651
|
));
|
|
5605
5652
|
} else {
|
|
5606
|
-
return /* @__PURE__ */
|
|
5653
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, scriptTag, /* @__PURE__ */ React5.createElement(React5.Suspense, null, /* @__PURE__ */ React5.createElement(
|
|
5607
5654
|
StreamTransfer,
|
|
5608
5655
|
{
|
|
5609
5656
|
context,
|
|
@@ -5889,14 +5936,14 @@ function createDeferred2() {
|
|
|
5889
5936
|
}
|
|
5890
5937
|
|
|
5891
5938
|
// lib/dom/ssr/fog-of-war.ts
|
|
5892
|
-
import * as
|
|
5939
|
+
import * as React9 from "react";
|
|
5893
5940
|
|
|
5894
5941
|
// lib/dom/ssr/routes.tsx
|
|
5895
|
-
import * as
|
|
5942
|
+
import * as React8 from "react";
|
|
5896
5943
|
|
|
5897
5944
|
// lib/dom/ssr/errorBoundaries.tsx
|
|
5898
|
-
import * as
|
|
5899
|
-
var RemixErrorBoundary = class extends
|
|
5945
|
+
import * as React6 from "react";
|
|
5946
|
+
var RemixErrorBoundary = class extends React6.Component {
|
|
5900
5947
|
constructor(props) {
|
|
5901
5948
|
super(props);
|
|
5902
5949
|
this.state = { error: props.error || null, location: props.location };
|
|
@@ -5912,7 +5959,7 @@ var RemixErrorBoundary = class extends React5.Component {
|
|
|
5912
5959
|
}
|
|
5913
5960
|
render() {
|
|
5914
5961
|
if (this.state.error) {
|
|
5915
|
-
return /* @__PURE__ */
|
|
5962
|
+
return /* @__PURE__ */ React6.createElement(
|
|
5916
5963
|
RemixRootDefaultErrorBoundary,
|
|
5917
5964
|
{
|
|
5918
5965
|
error: this.state.error,
|
|
@@ -5929,7 +5976,7 @@ function RemixRootDefaultErrorBoundary({
|
|
|
5929
5976
|
isOutsideRemixApp
|
|
5930
5977
|
}) {
|
|
5931
5978
|
console.error(error);
|
|
5932
|
-
let heyDeveloper = /* @__PURE__ */
|
|
5979
|
+
let heyDeveloper = /* @__PURE__ */ React6.createElement(
|
|
5933
5980
|
"script",
|
|
5934
5981
|
{
|
|
5935
5982
|
dangerouslySetInnerHTML: {
|
|
@@ -5942,7 +5989,7 @@ function RemixRootDefaultErrorBoundary({
|
|
|
5942
5989
|
}
|
|
5943
5990
|
);
|
|
5944
5991
|
if (isRouteErrorResponse(error)) {
|
|
5945
|
-
return /* @__PURE__ */
|
|
5992
|
+
return /* @__PURE__ */ React6.createElement(BoundaryShell, { title: "Unhandled Thrown Response!" }, /* @__PURE__ */ React6.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText), heyDeveloper);
|
|
5946
5993
|
}
|
|
5947
5994
|
let errorInstance;
|
|
5948
5995
|
if (error instanceof Error) {
|
|
@@ -5951,14 +5998,14 @@ function RemixRootDefaultErrorBoundary({
|
|
|
5951
5998
|
let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
|
|
5952
5999
|
errorInstance = new Error(errorString);
|
|
5953
6000
|
}
|
|
5954
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ React6.createElement(
|
|
5955
6002
|
BoundaryShell,
|
|
5956
6003
|
{
|
|
5957
6004
|
title: "Application Error!",
|
|
5958
6005
|
isOutsideRemixApp
|
|
5959
6006
|
},
|
|
5960
|
-
/* @__PURE__ */
|
|
5961
|
-
/* @__PURE__ */
|
|
6007
|
+
/* @__PURE__ */ React6.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"),
|
|
6008
|
+
/* @__PURE__ */ React6.createElement(
|
|
5962
6009
|
"pre",
|
|
5963
6010
|
{
|
|
5964
6011
|
style: {
|
|
@@ -5983,19 +6030,19 @@ function BoundaryShell({
|
|
|
5983
6030
|
if (routeModules.root?.Layout && !isOutsideRemixApp) {
|
|
5984
6031
|
return children;
|
|
5985
6032
|
}
|
|
5986
|
-
return /* @__PURE__ */
|
|
6033
|
+
return /* @__PURE__ */ React6.createElement("html", { lang: "en" }, /* @__PURE__ */ React6.createElement("head", null, /* @__PURE__ */ React6.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React6.createElement(
|
|
5987
6034
|
"meta",
|
|
5988
6035
|
{
|
|
5989
6036
|
name: "viewport",
|
|
5990
6037
|
content: "width=device-width,initial-scale=1,viewport-fit=cover"
|
|
5991
6038
|
}
|
|
5992
|
-
), /* @__PURE__ */
|
|
6039
|
+
), /* @__PURE__ */ React6.createElement("title", null, title)), /* @__PURE__ */ React6.createElement("body", null, /* @__PURE__ */ React6.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children, renderScripts ? /* @__PURE__ */ React6.createElement(Scripts, null) : null)));
|
|
5993
6040
|
}
|
|
5994
6041
|
|
|
5995
6042
|
// lib/dom/ssr/fallback.tsx
|
|
5996
|
-
import * as
|
|
6043
|
+
import * as React7 from "react";
|
|
5997
6044
|
function RemixRootDefaultHydrateFallback() {
|
|
5998
|
-
return /* @__PURE__ */
|
|
6045
|
+
return /* @__PURE__ */ React7.createElement(BoundaryShell, { title: "Loading...", renderScripts: true }, /* @__PURE__ */ React7.createElement(
|
|
5999
6046
|
"script",
|
|
6000
6047
|
{
|
|
6001
6048
|
dangerouslySetInnerHTML: {
|
|
@@ -6029,17 +6076,17 @@ function groupRoutesByParentId(manifest) {
|
|
|
6029
6076
|
function getRouteComponents(route, routeModule, isSpaMode) {
|
|
6030
6077
|
let Component4 = getRouteModuleComponent(routeModule);
|
|
6031
6078
|
let HydrateFallback = routeModule.HydrateFallback && (!isSpaMode || route.id === "root") ? routeModule.HydrateFallback : route.id === "root" ? RemixRootDefaultHydrateFallback : void 0;
|
|
6032
|
-
let ErrorBoundary = routeModule.ErrorBoundary ? routeModule.ErrorBoundary : route.id === "root" ? () => /* @__PURE__ */
|
|
6079
|
+
let ErrorBoundary = routeModule.ErrorBoundary ? routeModule.ErrorBoundary : route.id === "root" ? () => /* @__PURE__ */ React8.createElement(RemixRootDefaultErrorBoundary, { error: useRouteError() }) : void 0;
|
|
6033
6080
|
if (route.id === "root" && routeModule.Layout) {
|
|
6034
6081
|
return {
|
|
6035
6082
|
...Component4 ? {
|
|
6036
|
-
element: /* @__PURE__ */
|
|
6083
|
+
element: /* @__PURE__ */ React8.createElement(routeModule.Layout, null, /* @__PURE__ */ React8.createElement(Component4, null))
|
|
6037
6084
|
} : { Component: Component4 },
|
|
6038
6085
|
...ErrorBoundary ? {
|
|
6039
|
-
errorElement: /* @__PURE__ */
|
|
6086
|
+
errorElement: /* @__PURE__ */ React8.createElement(routeModule.Layout, null, /* @__PURE__ */ React8.createElement(ErrorBoundary, null))
|
|
6040
6087
|
} : { ErrorBoundary },
|
|
6041
6088
|
...HydrateFallback ? {
|
|
6042
|
-
hydrateFallbackElement: /* @__PURE__ */
|
|
6089
|
+
hydrateFallbackElement: /* @__PURE__ */ React8.createElement(routeModule.Layout, null, /* @__PURE__ */ React8.createElement(HydrateFallback, null))
|
|
6043
6090
|
} : { HydrateFallback }
|
|
6044
6091
|
};
|
|
6045
6092
|
}
|
|
@@ -6085,13 +6132,12 @@ function createServerRoutes(manifest, routeModules, future, isSpaMode, parentId
|
|
|
6085
6132
|
return dataRoute;
|
|
6086
6133
|
});
|
|
6087
6134
|
}
|
|
6088
|
-
function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, future, isSpaMode
|
|
6135
|
+
function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, future, isSpaMode) {
|
|
6089
6136
|
return createClientRoutes(
|
|
6090
6137
|
manifest,
|
|
6091
6138
|
routeModulesCache,
|
|
6092
6139
|
initialState,
|
|
6093
6140
|
isSpaMode,
|
|
6094
|
-
loadRouteModule,
|
|
6095
6141
|
"",
|
|
6096
6142
|
groupRoutesByParentId(manifest),
|
|
6097
6143
|
needsRevalidation
|
|
@@ -6117,7 +6163,7 @@ function noActionDefinedError(type, routeId) {
|
|
|
6117
6163
|
console.error(msg);
|
|
6118
6164
|
throw new ErrorResponseImpl(405, "Method Not Allowed", new Error(msg), true);
|
|
6119
6165
|
}
|
|
6120
|
-
function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode,
|
|
6166
|
+
function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
|
|
6121
6167
|
return (routesByParentId[parentId] || []).map((route) => {
|
|
6122
6168
|
let routeModule = routeModulesCache[route.id];
|
|
6123
6169
|
function fetchServerHandler(singleFetch) {
|
|
@@ -6245,8 +6291,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
|
|
|
6245
6291
|
dataRoute.lazy = async () => {
|
|
6246
6292
|
let mod = await loadRouteModuleWithBlockingLinks(
|
|
6247
6293
|
route,
|
|
6248
|
-
routeModulesCache
|
|
6249
|
-
loadRouteModule
|
|
6294
|
+
routeModulesCache
|
|
6250
6295
|
);
|
|
6251
6296
|
let lazyRoute = { ...mod };
|
|
6252
6297
|
if (mod.clientLoader) {
|
|
@@ -6291,7 +6336,6 @@ function createClientRoutes(manifest, routeModulesCache, initialState, isSpaMode
|
|
|
6291
6336
|
routeModulesCache,
|
|
6292
6337
|
initialState,
|
|
6293
6338
|
isSpaMode,
|
|
6294
|
-
loadRouteModule,
|
|
6295
6339
|
route.id,
|
|
6296
6340
|
routesByParentId,
|
|
6297
6341
|
needsRevalidation
|
|
@@ -6324,7 +6368,7 @@ function wrapShouldRevalidateForHdr(routeId, routeShouldRevalidate, needsRevalid
|
|
|
6324
6368
|
return routeShouldRevalidate ? routeShouldRevalidate(arg) : arg.defaultShouldRevalidate;
|
|
6325
6369
|
};
|
|
6326
6370
|
}
|
|
6327
|
-
async function loadRouteModuleWithBlockingLinks(route, routeModules
|
|
6371
|
+
async function loadRouteModuleWithBlockingLinks(route, routeModules) {
|
|
6328
6372
|
let routeModule = await loadRouteModule(route, routeModules);
|
|
6329
6373
|
await prefetchStyleLinks(route, routeModule);
|
|
6330
6374
|
return {
|
|
@@ -6381,7 +6425,7 @@ function getPartialManifest(manifest, router) {
|
|
|
6381
6425
|
routes: initialRoutes
|
|
6382
6426
|
};
|
|
6383
6427
|
}
|
|
6384
|
-
function getPatchRoutesOnNavigationFunction(manifest, routeModules, isSpaMode, basename
|
|
6428
|
+
function getPatchRoutesOnNavigationFunction(manifest, routeModules, isSpaMode, basename) {
|
|
6385
6429
|
if (!isFogOfWarEnabled(isSpaMode)) {
|
|
6386
6430
|
return void 0;
|
|
6387
6431
|
}
|
|
@@ -6394,14 +6438,13 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, isSpaMode, b
|
|
|
6394
6438
|
manifest,
|
|
6395
6439
|
routeModules,
|
|
6396
6440
|
isSpaMode,
|
|
6397
|
-
loadRouteModule,
|
|
6398
6441
|
basename,
|
|
6399
6442
|
patch
|
|
6400
6443
|
);
|
|
6401
6444
|
};
|
|
6402
6445
|
}
|
|
6403
|
-
function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode
|
|
6404
|
-
|
|
6446
|
+
function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode) {
|
|
6447
|
+
React9.useEffect(() => {
|
|
6405
6448
|
if (!isFogOfWarEnabled(isSpaMode) || navigator.connection?.saveData === true) {
|
|
6406
6449
|
return;
|
|
6407
6450
|
}
|
|
@@ -6432,7 +6475,6 @@ function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode, loadRou
|
|
|
6432
6475
|
manifest,
|
|
6433
6476
|
routeModules,
|
|
6434
6477
|
isSpaMode,
|
|
6435
|
-
loadRouteModule,
|
|
6436
6478
|
router.basename,
|
|
6437
6479
|
router.patchRoutes
|
|
6438
6480
|
);
|
|
@@ -6473,7 +6515,7 @@ function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode, loadRou
|
|
|
6473
6515
|
return () => observer.disconnect();
|
|
6474
6516
|
}, [isSpaMode, manifest, routeModules, router]);
|
|
6475
6517
|
}
|
|
6476
|
-
async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpaMode,
|
|
6518
|
+
async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpaMode, basename, patchRoutes) {
|
|
6477
6519
|
let manifestPath = `${basename != null ? basename : "/"}/__manifest`.replace(
|
|
6478
6520
|
/\/+/g,
|
|
6479
6521
|
"/"
|
|
@@ -6510,14 +6552,7 @@ async function fetchAndApplyManifestPatches(paths, manifest, routeModules, isSpa
|
|
|
6510
6552
|
parentIds.forEach(
|
|
6511
6553
|
(parentId) => patchRoutes(
|
|
6512
6554
|
parentId || null,
|
|
6513
|
-
createClientRoutes(
|
|
6514
|
-
patches,
|
|
6515
|
-
routeModules,
|
|
6516
|
-
null,
|
|
6517
|
-
isSpaMode,
|
|
6518
|
-
loadRouteModule,
|
|
6519
|
-
parentId
|
|
6520
|
-
)
|
|
6555
|
+
createClientRoutes(patches, routeModules, null, isSpaMode, parentId)
|
|
6521
6556
|
)
|
|
6522
6557
|
);
|
|
6523
6558
|
}
|
|
@@ -6538,7 +6573,7 @@ function debounce(callback, wait) {
|
|
|
6538
6573
|
|
|
6539
6574
|
// lib/dom/ssr/components.tsx
|
|
6540
6575
|
function useDataRouterContext2() {
|
|
6541
|
-
let context =
|
|
6576
|
+
let context = React10.useContext(DataRouterContext);
|
|
6542
6577
|
invariant2(
|
|
6543
6578
|
context,
|
|
6544
6579
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
@@ -6546,17 +6581,17 @@ function useDataRouterContext2() {
|
|
|
6546
6581
|
return context;
|
|
6547
6582
|
}
|
|
6548
6583
|
function useDataRouterStateContext() {
|
|
6549
|
-
let context =
|
|
6584
|
+
let context = React10.useContext(DataRouterStateContext);
|
|
6550
6585
|
invariant2(
|
|
6551
6586
|
context,
|
|
6552
6587
|
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
6553
6588
|
);
|
|
6554
6589
|
return context;
|
|
6555
6590
|
}
|
|
6556
|
-
var FrameworkContext =
|
|
6591
|
+
var FrameworkContext = React10.createContext(void 0);
|
|
6557
6592
|
FrameworkContext.displayName = "FrameworkContext";
|
|
6558
6593
|
function useFrameworkContext() {
|
|
6559
|
-
let context =
|
|
6594
|
+
let context = React10.useContext(FrameworkContext);
|
|
6560
6595
|
invariant2(
|
|
6561
6596
|
context,
|
|
6562
6597
|
"You must render this element inside a <HydratedRouter> element"
|
|
@@ -6564,12 +6599,12 @@ function useFrameworkContext() {
|
|
|
6564
6599
|
return context;
|
|
6565
6600
|
}
|
|
6566
6601
|
function usePrefetchBehavior(prefetch, theirElementProps) {
|
|
6567
|
-
let frameworkContext =
|
|
6568
|
-
let [maybePrefetch, setMaybePrefetch] =
|
|
6569
|
-
let [shouldPrefetch, setShouldPrefetch] =
|
|
6602
|
+
let frameworkContext = React10.useContext(FrameworkContext);
|
|
6603
|
+
let [maybePrefetch, setMaybePrefetch] = React10.useState(false);
|
|
6604
|
+
let [shouldPrefetch, setShouldPrefetch] = React10.useState(false);
|
|
6570
6605
|
let { onFocus, onBlur, onMouseEnter, onMouseLeave, onTouchStart } = theirElementProps;
|
|
6571
|
-
let ref =
|
|
6572
|
-
|
|
6606
|
+
let ref = React10.useRef(null);
|
|
6607
|
+
React10.useEffect(() => {
|
|
6573
6608
|
if (prefetch === "render") {
|
|
6574
6609
|
setShouldPrefetch(true);
|
|
6575
6610
|
}
|
|
@@ -6586,7 +6621,7 @@ function usePrefetchBehavior(prefetch, theirElementProps) {
|
|
|
6586
6621
|
};
|
|
6587
6622
|
}
|
|
6588
6623
|
}, [prefetch]);
|
|
6589
|
-
|
|
6624
|
+
React10.useEffect(() => {
|
|
6590
6625
|
if (maybePrefetch) {
|
|
6591
6626
|
let id = setTimeout(() => {
|
|
6592
6627
|
setShouldPrefetch(true);
|
|
@@ -6643,12 +6678,12 @@ function Links() {
|
|
|
6643
6678
|
let { isSpaMode, manifest, routeModules, criticalCss } = useFrameworkContext();
|
|
6644
6679
|
let { errors, matches: routerMatches } = useDataRouterStateContext();
|
|
6645
6680
|
let matches = getActiveMatches(routerMatches, errors, isSpaMode);
|
|
6646
|
-
let keyedLinks =
|
|
6681
|
+
let keyedLinks = React10.useMemo(
|
|
6647
6682
|
() => getKeyedLinksForMatches(matches, routeModules, manifest),
|
|
6648
6683
|
[matches, routeModules, manifest]
|
|
6649
6684
|
);
|
|
6650
|
-
return /* @__PURE__ */
|
|
6651
|
-
({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */
|
|
6685
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, criticalCss ? /* @__PURE__ */ React10.createElement("style", { dangerouslySetInnerHTML: { __html: criticalCss } }) : null, keyedLinks.map(
|
|
6686
|
+
({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ React10.createElement(PrefetchPageLinks, { key, ...link }) : /* @__PURE__ */ React10.createElement("link", { key, ...link })
|
|
6652
6687
|
));
|
|
6653
6688
|
}
|
|
6654
6689
|
function PrefetchPageLinks({
|
|
@@ -6656,30 +6691,27 @@ function PrefetchPageLinks({
|
|
|
6656
6691
|
...dataLinkProps
|
|
6657
6692
|
}) {
|
|
6658
6693
|
let { router } = useDataRouterContext2();
|
|
6659
|
-
let matches =
|
|
6694
|
+
let matches = React10.useMemo(
|
|
6660
6695
|
() => matchRoutes(router.routes, page, router.basename),
|
|
6661
6696
|
[router.routes, page, router.basename]
|
|
6662
6697
|
);
|
|
6663
6698
|
if (!matches) {
|
|
6664
6699
|
return null;
|
|
6665
6700
|
}
|
|
6666
|
-
return /* @__PURE__ */
|
|
6701
|
+
return /* @__PURE__ */ React10.createElement(PrefetchPageLinksImpl, { page, matches, ...dataLinkProps });
|
|
6667
6702
|
}
|
|
6668
6703
|
function useKeyedPrefetchLinks(matches) {
|
|
6669
|
-
let { manifest, routeModules
|
|
6670
|
-
let [keyedPrefetchLinks, setKeyedPrefetchLinks] =
|
|
6671
|
-
|
|
6704
|
+
let { manifest, routeModules } = useFrameworkContext();
|
|
6705
|
+
let [keyedPrefetchLinks, setKeyedPrefetchLinks] = React10.useState([]);
|
|
6706
|
+
React10.useEffect(() => {
|
|
6672
6707
|
let interrupted = false;
|
|
6673
|
-
void getKeyedPrefetchLinks(
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
).then((links) => {
|
|
6679
|
-
if (!interrupted) {
|
|
6680
|
-
setKeyedPrefetchLinks(links);
|
|
6708
|
+
void getKeyedPrefetchLinks(matches, manifest, routeModules).then(
|
|
6709
|
+
(links) => {
|
|
6710
|
+
if (!interrupted) {
|
|
6711
|
+
setKeyedPrefetchLinks(links);
|
|
6712
|
+
}
|
|
6681
6713
|
}
|
|
6682
|
-
|
|
6714
|
+
);
|
|
6683
6715
|
return () => {
|
|
6684
6716
|
interrupted = true;
|
|
6685
6717
|
};
|
|
@@ -6694,7 +6726,7 @@ function PrefetchPageLinksImpl({
|
|
|
6694
6726
|
let location = useLocation();
|
|
6695
6727
|
let { manifest, routeModules } = useFrameworkContext();
|
|
6696
6728
|
let { loaderData, matches } = useDataRouterStateContext();
|
|
6697
|
-
let newMatchesForData =
|
|
6729
|
+
let newMatchesForData = React10.useMemo(
|
|
6698
6730
|
() => getNewMatchesForLinks(
|
|
6699
6731
|
page,
|
|
6700
6732
|
nextMatches,
|
|
@@ -6705,7 +6737,7 @@ function PrefetchPageLinksImpl({
|
|
|
6705
6737
|
),
|
|
6706
6738
|
[page, nextMatches, matches, manifest, location]
|
|
6707
6739
|
);
|
|
6708
|
-
let newMatchesForAssets =
|
|
6740
|
+
let newMatchesForAssets = React10.useMemo(
|
|
6709
6741
|
() => getNewMatchesForLinks(
|
|
6710
6742
|
page,
|
|
6711
6743
|
nextMatches,
|
|
@@ -6716,7 +6748,7 @@ function PrefetchPageLinksImpl({
|
|
|
6716
6748
|
),
|
|
6717
6749
|
[page, nextMatches, matches, manifest, location]
|
|
6718
6750
|
);
|
|
6719
|
-
let dataHrefs =
|
|
6751
|
+
let dataHrefs = React10.useMemo(() => {
|
|
6720
6752
|
if (page === location.pathname + location.search + location.hash) {
|
|
6721
6753
|
return [];
|
|
6722
6754
|
}
|
|
@@ -6755,15 +6787,15 @@ function PrefetchPageLinksImpl({
|
|
|
6755
6787
|
page,
|
|
6756
6788
|
routeModules
|
|
6757
6789
|
]);
|
|
6758
|
-
let moduleHrefs =
|
|
6790
|
+
let moduleHrefs = React10.useMemo(
|
|
6759
6791
|
() => getModuleLinkHrefs(newMatchesForAssets, manifest),
|
|
6760
6792
|
[newMatchesForAssets, manifest]
|
|
6761
6793
|
);
|
|
6762
6794
|
let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);
|
|
6763
|
-
return /* @__PURE__ */
|
|
6795
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React10.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ React10.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (
|
|
6764
6796
|
// these don't spread `linkProps` because they are full link descriptors
|
|
6765
6797
|
// already with their own props
|
|
6766
|
-
/* @__PURE__ */
|
|
6798
|
+
/* @__PURE__ */ React10.createElement("link", { key, ...link })
|
|
6767
6799
|
)));
|
|
6768
6800
|
}
|
|
6769
6801
|
function Meta() {
|
|
@@ -6821,7 +6853,7 @@ function Meta() {
|
|
|
6821
6853
|
meta = [...routeMeta];
|
|
6822
6854
|
leafMeta = meta;
|
|
6823
6855
|
}
|
|
6824
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, meta.flat().map((metaProps) => {
|
|
6825
6857
|
if (!metaProps) {
|
|
6826
6858
|
return null;
|
|
6827
6859
|
}
|
|
@@ -6834,22 +6866,22 @@ function Meta() {
|
|
|
6834
6866
|
return null;
|
|
6835
6867
|
}
|
|
6836
6868
|
let Comp = tagName;
|
|
6837
|
-
return /* @__PURE__ */
|
|
6869
|
+
return /* @__PURE__ */ React10.createElement(Comp, { key: JSON.stringify(rest), ...rest });
|
|
6838
6870
|
}
|
|
6839
6871
|
if ("title" in metaProps) {
|
|
6840
|
-
return /* @__PURE__ */
|
|
6872
|
+
return /* @__PURE__ */ React10.createElement("title", { key: "title" }, String(metaProps.title));
|
|
6841
6873
|
}
|
|
6842
6874
|
if ("charset" in metaProps) {
|
|
6843
6875
|
metaProps.charSet ?? (metaProps.charSet = metaProps.charset);
|
|
6844
6876
|
delete metaProps.charset;
|
|
6845
6877
|
}
|
|
6846
6878
|
if ("charSet" in metaProps && metaProps.charSet != null) {
|
|
6847
|
-
return typeof metaProps.charSet === "string" ? /* @__PURE__ */
|
|
6879
|
+
return typeof metaProps.charSet === "string" ? /* @__PURE__ */ React10.createElement("meta", { key: "charSet", charSet: metaProps.charSet }) : null;
|
|
6848
6880
|
}
|
|
6849
6881
|
if ("script:ld+json" in metaProps) {
|
|
6850
6882
|
try {
|
|
6851
6883
|
let json = JSON.stringify(metaProps["script:ld+json"]);
|
|
6852
|
-
return /* @__PURE__ */
|
|
6884
|
+
return /* @__PURE__ */ React10.createElement(
|
|
6853
6885
|
"script",
|
|
6854
6886
|
{
|
|
6855
6887
|
key: `script:ld+json:${json}`,
|
|
@@ -6861,7 +6893,7 @@ function Meta() {
|
|
|
6861
6893
|
return null;
|
|
6862
6894
|
}
|
|
6863
6895
|
}
|
|
6864
|
-
return /* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ React10.createElement("meta", { key: JSON.stringify(metaProps), ...metaProps });
|
|
6865
6897
|
}));
|
|
6866
6898
|
}
|
|
6867
6899
|
function isValidMetaTag(tagName) {
|
|
@@ -6877,10 +6909,10 @@ function Scripts(props) {
|
|
|
6877
6909
|
renderMeta.didRenderScripts = true;
|
|
6878
6910
|
}
|
|
6879
6911
|
let matches = getActiveMatches(routerMatches, null, isSpaMode);
|
|
6880
|
-
|
|
6912
|
+
React10.useEffect(() => {
|
|
6881
6913
|
isHydrated = true;
|
|
6882
6914
|
}, []);
|
|
6883
|
-
let initialScripts =
|
|
6915
|
+
let initialScripts = React10.useMemo(() => {
|
|
6884
6916
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
6885
6917
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
6886
6918
|
let routeModulesScript = !isStatic ? " " : `${manifest.hmr?.runtime ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
@@ -6900,7 +6932,7 @@ ${matches.map(
|
|
|
6900
6932
|
window.__reactRouterRouteModules = {${matches.map((match, index) => `${JSON.stringify(match.route.id)}:route${index}`).join(",")}};
|
|
6901
6933
|
|
|
6902
6934
|
import(${JSON.stringify(manifest.entry.module)});`;
|
|
6903
|
-
return /* @__PURE__ */
|
|
6935
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
6904
6936
|
"script",
|
|
6905
6937
|
{
|
|
6906
6938
|
...props,
|
|
@@ -6908,7 +6940,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
6908
6940
|
dangerouslySetInnerHTML: createHtml(contextScript),
|
|
6909
6941
|
type: void 0
|
|
6910
6942
|
}
|
|
6911
|
-
), /* @__PURE__ */
|
|
6943
|
+
), /* @__PURE__ */ React10.createElement(
|
|
6912
6944
|
"script",
|
|
6913
6945
|
{
|
|
6914
6946
|
...props,
|
|
@@ -6924,21 +6956,21 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
6924
6956
|
return route ? (route.imports || []).concat([route.module]) : [];
|
|
6925
6957
|
}).flat(1);
|
|
6926
6958
|
let preloads = isHydrated ? [] : manifest.entry.imports.concat(routePreloads);
|
|
6927
|
-
return isHydrated ? null : /* @__PURE__ */
|
|
6959
|
+
return isHydrated ? null : /* @__PURE__ */ React10.createElement(React10.Fragment, null, !enableFogOfWar ? /* @__PURE__ */ React10.createElement(
|
|
6928
6960
|
"link",
|
|
6929
6961
|
{
|
|
6930
6962
|
rel: "modulepreload",
|
|
6931
6963
|
href: manifest.url,
|
|
6932
6964
|
crossOrigin: props.crossOrigin
|
|
6933
6965
|
}
|
|
6934
|
-
) : null, /* @__PURE__ */
|
|
6966
|
+
) : null, /* @__PURE__ */ React10.createElement(
|
|
6935
6967
|
"link",
|
|
6936
6968
|
{
|
|
6937
6969
|
rel: "modulepreload",
|
|
6938
6970
|
href: manifest.entry.module,
|
|
6939
6971
|
crossOrigin: props.crossOrigin
|
|
6940
6972
|
}
|
|
6941
|
-
), dedupe(preloads).map((path) => /* @__PURE__ */
|
|
6973
|
+
), dedupe(preloads).map((path) => /* @__PURE__ */ React10.createElement(
|
|
6942
6974
|
"link",
|
|
6943
6975
|
{
|
|
6944
6976
|
key: path,
|
|
@@ -6967,7 +6999,7 @@ function mergeRefs(...refs) {
|
|
|
6967
6999
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
6968
7000
|
try {
|
|
6969
7001
|
if (isBrowser) {
|
|
6970
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
7002
|
+
window.__reactRouterVersion = "0.0.0-experimental-1ebb6d403";
|
|
6971
7003
|
}
|
|
6972
7004
|
} catch (e) {
|
|
6973
7005
|
}
|
|
@@ -7047,23 +7079,23 @@ function BrowserRouter({
|
|
|
7047
7079
|
children,
|
|
7048
7080
|
window: window2
|
|
7049
7081
|
}) {
|
|
7050
|
-
let historyRef =
|
|
7082
|
+
let historyRef = React11.useRef();
|
|
7051
7083
|
if (historyRef.current == null) {
|
|
7052
7084
|
historyRef.current = createBrowserHistory({ window: window2, v5Compat: true });
|
|
7053
7085
|
}
|
|
7054
7086
|
let history = historyRef.current;
|
|
7055
|
-
let [state, setStateImpl] =
|
|
7087
|
+
let [state, setStateImpl] = React11.useState({
|
|
7056
7088
|
action: history.action,
|
|
7057
7089
|
location: history.location
|
|
7058
7090
|
});
|
|
7059
|
-
let setState =
|
|
7091
|
+
let setState = React11.useCallback(
|
|
7060
7092
|
(newState) => {
|
|
7061
|
-
|
|
7093
|
+
React11.startTransition(() => setStateImpl(newState));
|
|
7062
7094
|
},
|
|
7063
7095
|
[setStateImpl]
|
|
7064
7096
|
);
|
|
7065
|
-
|
|
7066
|
-
return /* @__PURE__ */
|
|
7097
|
+
React11.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
7098
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7067
7099
|
Router,
|
|
7068
7100
|
{
|
|
7069
7101
|
basename,
|
|
@@ -7075,23 +7107,23 @@ function BrowserRouter({
|
|
|
7075
7107
|
);
|
|
7076
7108
|
}
|
|
7077
7109
|
function HashRouter({ basename, children, window: window2 }) {
|
|
7078
|
-
let historyRef =
|
|
7110
|
+
let historyRef = React11.useRef();
|
|
7079
7111
|
if (historyRef.current == null) {
|
|
7080
7112
|
historyRef.current = createHashHistory({ window: window2, v5Compat: true });
|
|
7081
7113
|
}
|
|
7082
7114
|
let history = historyRef.current;
|
|
7083
|
-
let [state, setStateImpl] =
|
|
7115
|
+
let [state, setStateImpl] = React11.useState({
|
|
7084
7116
|
action: history.action,
|
|
7085
7117
|
location: history.location
|
|
7086
7118
|
});
|
|
7087
|
-
let setState =
|
|
7119
|
+
let setState = React11.useCallback(
|
|
7088
7120
|
(newState) => {
|
|
7089
|
-
|
|
7121
|
+
React11.startTransition(() => setStateImpl(newState));
|
|
7090
7122
|
},
|
|
7091
7123
|
[setStateImpl]
|
|
7092
7124
|
);
|
|
7093
|
-
|
|
7094
|
-
return /* @__PURE__ */
|
|
7125
|
+
React11.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
7126
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7095
7127
|
Router,
|
|
7096
7128
|
{
|
|
7097
7129
|
basename,
|
|
@@ -7107,18 +7139,18 @@ function HistoryRouter({
|
|
|
7107
7139
|
children,
|
|
7108
7140
|
history
|
|
7109
7141
|
}) {
|
|
7110
|
-
let [state, setStateImpl] =
|
|
7142
|
+
let [state, setStateImpl] = React11.useState({
|
|
7111
7143
|
action: history.action,
|
|
7112
7144
|
location: history.location
|
|
7113
7145
|
});
|
|
7114
|
-
let setState =
|
|
7146
|
+
let setState = React11.useCallback(
|
|
7115
7147
|
(newState) => {
|
|
7116
|
-
|
|
7148
|
+
React11.startTransition(() => setStateImpl(newState));
|
|
7117
7149
|
},
|
|
7118
7150
|
[setStateImpl]
|
|
7119
7151
|
);
|
|
7120
|
-
|
|
7121
|
-
return /* @__PURE__ */
|
|
7152
|
+
React11.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
7153
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7122
7154
|
Router,
|
|
7123
7155
|
{
|
|
7124
7156
|
basename,
|
|
@@ -7130,8 +7162,8 @@ function HistoryRouter({
|
|
|
7130
7162
|
);
|
|
7131
7163
|
}
|
|
7132
7164
|
HistoryRouter.displayName = "unstable_HistoryRouter";
|
|
7133
|
-
var
|
|
7134
|
-
var Link =
|
|
7165
|
+
var ABSOLUTE_URL_REGEX3 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
7166
|
+
var Link = React11.forwardRef(
|
|
7135
7167
|
function LinkWithRef({
|
|
7136
7168
|
onClick,
|
|
7137
7169
|
discover = "render",
|
|
@@ -7146,8 +7178,8 @@ var Link = React10.forwardRef(
|
|
|
7146
7178
|
viewTransition,
|
|
7147
7179
|
...rest
|
|
7148
7180
|
}, forwardedRef) {
|
|
7149
|
-
let { basename } =
|
|
7150
|
-
let isAbsolute = typeof to === "string" &&
|
|
7181
|
+
let { basename } = React11.useContext(NavigationContext);
|
|
7182
|
+
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX3.test(to);
|
|
7151
7183
|
let absoluteHref;
|
|
7152
7184
|
let isExternal = false;
|
|
7153
7185
|
if (typeof to === "string" && isAbsolute) {
|
|
@@ -7191,7 +7223,7 @@ var Link = React10.forwardRef(
|
|
|
7191
7223
|
}
|
|
7192
7224
|
let link = (
|
|
7193
7225
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
7194
|
-
/* @__PURE__ */
|
|
7226
|
+
/* @__PURE__ */ React11.createElement(
|
|
7195
7227
|
"a",
|
|
7196
7228
|
{
|
|
7197
7229
|
...rest,
|
|
@@ -7204,11 +7236,11 @@ var Link = React10.forwardRef(
|
|
|
7204
7236
|
}
|
|
7205
7237
|
)
|
|
7206
7238
|
);
|
|
7207
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */
|
|
7239
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, link, /* @__PURE__ */ React11.createElement(PrefetchPageLinks, { page: href })) : link;
|
|
7208
7240
|
}
|
|
7209
7241
|
);
|
|
7210
7242
|
Link.displayName = "Link";
|
|
7211
|
-
var NavLink =
|
|
7243
|
+
var NavLink = React11.forwardRef(
|
|
7212
7244
|
function NavLinkWithRef({
|
|
7213
7245
|
"aria-current": ariaCurrentProp = "page",
|
|
7214
7246
|
caseSensitive = false,
|
|
@@ -7222,8 +7254,8 @@ var NavLink = React10.forwardRef(
|
|
|
7222
7254
|
}, ref) {
|
|
7223
7255
|
let path = useResolvedPath(to, { relative: rest.relative });
|
|
7224
7256
|
let location = useLocation();
|
|
7225
|
-
let routerState =
|
|
7226
|
-
let { navigator: navigator2, basename } =
|
|
7257
|
+
let routerState = React11.useContext(DataRouterStateContext);
|
|
7258
|
+
let { navigator: navigator2, basename } = React11.useContext(NavigationContext);
|
|
7227
7259
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
7228
7260
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
7229
7261
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -7259,7 +7291,7 @@ var NavLink = React10.forwardRef(
|
|
|
7259
7291
|
].filter(Boolean).join(" ");
|
|
7260
7292
|
}
|
|
7261
7293
|
let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
|
|
7262
|
-
return /* @__PURE__ */
|
|
7294
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7263
7295
|
Link,
|
|
7264
7296
|
{
|
|
7265
7297
|
...rest,
|
|
@@ -7275,7 +7307,7 @@ var NavLink = React10.forwardRef(
|
|
|
7275
7307
|
}
|
|
7276
7308
|
);
|
|
7277
7309
|
NavLink.displayName = "NavLink";
|
|
7278
|
-
var Form =
|
|
7310
|
+
var Form = React11.forwardRef(
|
|
7279
7311
|
({
|
|
7280
7312
|
discover = "render",
|
|
7281
7313
|
fetcherKey,
|
|
@@ -7294,7 +7326,7 @@ var Form = React10.forwardRef(
|
|
|
7294
7326
|
let submit = useSubmit();
|
|
7295
7327
|
let formAction = useFormAction(action, { relative });
|
|
7296
7328
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
7297
|
-
let isAbsolute = typeof action === "string" &&
|
|
7329
|
+
let isAbsolute = typeof action === "string" && ABSOLUTE_URL_REGEX3.test(action);
|
|
7298
7330
|
let submitHandler = (event) => {
|
|
7299
7331
|
onSubmit && onSubmit(event);
|
|
7300
7332
|
if (event.defaultPrevented) return;
|
|
@@ -7312,7 +7344,7 @@ var Form = React10.forwardRef(
|
|
|
7312
7344
|
viewTransition
|
|
7313
7345
|
});
|
|
7314
7346
|
};
|
|
7315
|
-
return /* @__PURE__ */
|
|
7347
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7316
7348
|
"form",
|
|
7317
7349
|
{
|
|
7318
7350
|
ref: forwardedRef,
|
|
@@ -7331,12 +7363,12 @@ function ScrollRestoration({
|
|
|
7331
7363
|
storageKey,
|
|
7332
7364
|
...props
|
|
7333
7365
|
}) {
|
|
7334
|
-
let remixContext =
|
|
7335
|
-
let { basename } =
|
|
7366
|
+
let remixContext = React11.useContext(FrameworkContext);
|
|
7367
|
+
let { basename } = React11.useContext(NavigationContext);
|
|
7336
7368
|
let location = useLocation();
|
|
7337
7369
|
let matches = useMatches();
|
|
7338
7370
|
useScrollRestoration({ getKey, storageKey });
|
|
7339
|
-
let ssrKey =
|
|
7371
|
+
let ssrKey = React11.useMemo(
|
|
7340
7372
|
() => {
|
|
7341
7373
|
if (!remixContext || !getKey) return null;
|
|
7342
7374
|
let userKey = getScrollRestorationKey(
|
|
@@ -7370,7 +7402,7 @@ function ScrollRestoration({
|
|
|
7370
7402
|
sessionStorage.removeItem(storageKey2);
|
|
7371
7403
|
}
|
|
7372
7404
|
}).toString();
|
|
7373
|
-
return /* @__PURE__ */
|
|
7405
|
+
return /* @__PURE__ */ React11.createElement(
|
|
7374
7406
|
"script",
|
|
7375
7407
|
{
|
|
7376
7408
|
...props,
|
|
@@ -7388,12 +7420,12 @@ function getDataRouterConsoleError2(hookName) {
|
|
|
7388
7420
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
7389
7421
|
}
|
|
7390
7422
|
function useDataRouterContext3(hookName) {
|
|
7391
|
-
let ctx =
|
|
7423
|
+
let ctx = React11.useContext(DataRouterContext);
|
|
7392
7424
|
invariant(ctx, getDataRouterConsoleError2(hookName));
|
|
7393
7425
|
return ctx;
|
|
7394
7426
|
}
|
|
7395
7427
|
function useDataRouterState2(hookName) {
|
|
7396
|
-
let state =
|
|
7428
|
+
let state = React11.useContext(DataRouterStateContext);
|
|
7397
7429
|
invariant(state, getDataRouterConsoleError2(hookName));
|
|
7398
7430
|
return state;
|
|
7399
7431
|
}
|
|
@@ -7408,7 +7440,7 @@ function useLinkClickHandler(to, {
|
|
|
7408
7440
|
let navigate = useNavigate();
|
|
7409
7441
|
let location = useLocation();
|
|
7410
7442
|
let path = useResolvedPath(to, { relative });
|
|
7411
|
-
return
|
|
7443
|
+
return React11.useCallback(
|
|
7412
7444
|
(event) => {
|
|
7413
7445
|
if (shouldProcessLinkClick(event, target)) {
|
|
7414
7446
|
event.preventDefault();
|
|
@@ -7441,10 +7473,10 @@ function useSearchParams(defaultInit) {
|
|
|
7441
7473
|
typeof URLSearchParams !== "undefined",
|
|
7442
7474
|
`You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
|
|
7443
7475
|
);
|
|
7444
|
-
let defaultSearchParamsRef =
|
|
7445
|
-
let hasSetSearchParamsRef =
|
|
7476
|
+
let defaultSearchParamsRef = React11.useRef(createSearchParams(defaultInit));
|
|
7477
|
+
let hasSetSearchParamsRef = React11.useRef(false);
|
|
7446
7478
|
let location = useLocation();
|
|
7447
|
-
let searchParams =
|
|
7479
|
+
let searchParams = React11.useMemo(
|
|
7448
7480
|
() => (
|
|
7449
7481
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
7450
7482
|
// Once we call that we want those to take precedence, otherwise you can't
|
|
@@ -7457,7 +7489,7 @@ function useSearchParams(defaultInit) {
|
|
|
7457
7489
|
[location.search]
|
|
7458
7490
|
);
|
|
7459
7491
|
let navigate = useNavigate();
|
|
7460
|
-
let setSearchParams =
|
|
7492
|
+
let setSearchParams = React11.useCallback(
|
|
7461
7493
|
(nextInit, navigateOptions) => {
|
|
7462
7494
|
const newSearchParams = createSearchParams(
|
|
7463
7495
|
typeof nextInit === "function" ? nextInit(searchParams) : nextInit
|
|
@@ -7473,9 +7505,9 @@ var fetcherId = 0;
|
|
|
7473
7505
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
7474
7506
|
function useSubmit() {
|
|
7475
7507
|
let { router } = useDataRouterContext3("useSubmit" /* UseSubmit */);
|
|
7476
|
-
let { basename } =
|
|
7508
|
+
let { basename } = React11.useContext(NavigationContext);
|
|
7477
7509
|
let currentRouteId = useRouteId();
|
|
7478
|
-
return
|
|
7510
|
+
return React11.useCallback(
|
|
7479
7511
|
async (target, options = {}) => {
|
|
7480
7512
|
let { action, method, encType, formData, body } = getFormSubmissionInfo(
|
|
7481
7513
|
target,
|
|
@@ -7510,8 +7542,8 @@ function useSubmit() {
|
|
|
7510
7542
|
);
|
|
7511
7543
|
}
|
|
7512
7544
|
function useFormAction(action, { relative } = {}) {
|
|
7513
|
-
let { basename } =
|
|
7514
|
-
let routeContext =
|
|
7545
|
+
let { basename } = React11.useContext(NavigationContext);
|
|
7546
|
+
let routeContext = React11.useContext(RouteContext);
|
|
7515
7547
|
invariant(routeContext, "useFormAction must be used inside a RouteContext");
|
|
7516
7548
|
let [match] = routeContext.matches.slice(-1);
|
|
7517
7549
|
let path = { ...useResolvedPath(action ? action : ".", { relative }) };
|
|
@@ -7541,8 +7573,8 @@ function useFetcher({
|
|
|
7541
7573
|
} = {}) {
|
|
7542
7574
|
let { router } = useDataRouterContext3("useFetcher" /* UseFetcher */);
|
|
7543
7575
|
let state = useDataRouterState2("useFetcher" /* UseFetcher */);
|
|
7544
|
-
let fetcherData =
|
|
7545
|
-
let route =
|
|
7576
|
+
let fetcherData = React11.useContext(FetchersContext);
|
|
7577
|
+
let route = React11.useContext(RouteContext);
|
|
7546
7578
|
let routeId = route.matches[route.matches.length - 1]?.route.id;
|
|
7547
7579
|
invariant(fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
7548
7580
|
invariant(route, `useFetcher must be used inside a RouteContext`);
|
|
@@ -7550,16 +7582,16 @@ function useFetcher({
|
|
|
7550
7582
|
routeId != null,
|
|
7551
7583
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
7552
7584
|
);
|
|
7553
|
-
let defaultKey =
|
|
7554
|
-
let [fetcherKey, setFetcherKey] =
|
|
7585
|
+
let defaultKey = React11.useId();
|
|
7586
|
+
let [fetcherKey, setFetcherKey] = React11.useState(key || defaultKey);
|
|
7555
7587
|
if (key && key !== fetcherKey) {
|
|
7556
7588
|
setFetcherKey(key);
|
|
7557
7589
|
}
|
|
7558
|
-
|
|
7590
|
+
React11.useEffect(() => {
|
|
7559
7591
|
router.getFetcher(fetcherKey);
|
|
7560
7592
|
return () => router.deleteFetcher(fetcherKey);
|
|
7561
7593
|
}, [router, fetcherKey]);
|
|
7562
|
-
let load =
|
|
7594
|
+
let load = React11.useCallback(
|
|
7563
7595
|
async (href, opts) => {
|
|
7564
7596
|
invariant(routeId, "No routeId available for fetcher.load()");
|
|
7565
7597
|
await router.fetch(fetcherKey, routeId, href, opts);
|
|
@@ -7567,7 +7599,7 @@ function useFetcher({
|
|
|
7567
7599
|
[fetcherKey, routeId, router]
|
|
7568
7600
|
);
|
|
7569
7601
|
let submitImpl = useSubmit();
|
|
7570
|
-
let submit =
|
|
7602
|
+
let submit = React11.useCallback(
|
|
7571
7603
|
async (target, opts) => {
|
|
7572
7604
|
await submitImpl(target, {
|
|
7573
7605
|
...opts,
|
|
@@ -7577,10 +7609,10 @@ function useFetcher({
|
|
|
7577
7609
|
},
|
|
7578
7610
|
[fetcherKey, submitImpl]
|
|
7579
7611
|
);
|
|
7580
|
-
let FetcherForm =
|
|
7581
|
-
let FetcherForm2 =
|
|
7612
|
+
let FetcherForm = React11.useMemo(() => {
|
|
7613
|
+
let FetcherForm2 = React11.forwardRef(
|
|
7582
7614
|
(props, ref) => {
|
|
7583
|
-
return /* @__PURE__ */
|
|
7615
|
+
return /* @__PURE__ */ React11.createElement(Form, { ...props, navigate: false, fetcherKey, ref });
|
|
7584
7616
|
}
|
|
7585
7617
|
);
|
|
7586
7618
|
FetcherForm2.displayName = "fetcher.Form";
|
|
@@ -7588,7 +7620,7 @@ function useFetcher({
|
|
|
7588
7620
|
}, [fetcherKey]);
|
|
7589
7621
|
let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER;
|
|
7590
7622
|
let data2 = fetcherData.get(fetcherKey);
|
|
7591
|
-
let fetcherWithComponents =
|
|
7623
|
+
let fetcherWithComponents = React11.useMemo(
|
|
7592
7624
|
() => ({
|
|
7593
7625
|
Form: FetcherForm,
|
|
7594
7626
|
submit,
|
|
@@ -7637,18 +7669,18 @@ function useScrollRestoration({
|
|
|
7637
7669
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState2(
|
|
7638
7670
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
7639
7671
|
);
|
|
7640
|
-
let { basename } =
|
|
7672
|
+
let { basename } = React11.useContext(NavigationContext);
|
|
7641
7673
|
let location = useLocation();
|
|
7642
7674
|
let matches = useMatches();
|
|
7643
7675
|
let navigation = useNavigation();
|
|
7644
|
-
|
|
7676
|
+
React11.useEffect(() => {
|
|
7645
7677
|
window.history.scrollRestoration = "manual";
|
|
7646
7678
|
return () => {
|
|
7647
7679
|
window.history.scrollRestoration = "auto";
|
|
7648
7680
|
};
|
|
7649
7681
|
}, []);
|
|
7650
7682
|
usePageHide(
|
|
7651
|
-
|
|
7683
|
+
React11.useCallback(() => {
|
|
7652
7684
|
if (navigation.state === "idle") {
|
|
7653
7685
|
let key = getScrollRestorationKey(location, matches, basename, getKey);
|
|
7654
7686
|
savedScrollPositions[key] = window.scrollY;
|
|
@@ -7668,7 +7700,7 @@ function useScrollRestoration({
|
|
|
7668
7700
|
}, [navigation.state, getKey, basename, location, matches, storageKey])
|
|
7669
7701
|
);
|
|
7670
7702
|
if (typeof document !== "undefined") {
|
|
7671
|
-
|
|
7703
|
+
React11.useLayoutEffect(() => {
|
|
7672
7704
|
try {
|
|
7673
7705
|
let sessionPositions = sessionStorage.getItem(
|
|
7674
7706
|
storageKey || SCROLL_RESTORATION_STORAGE_KEY
|
|
@@ -7679,7 +7711,7 @@ function useScrollRestoration({
|
|
|
7679
7711
|
} catch (e) {
|
|
7680
7712
|
}
|
|
7681
7713
|
}, [storageKey]);
|
|
7682
|
-
|
|
7714
|
+
React11.useLayoutEffect(() => {
|
|
7683
7715
|
let disableScrollRestoration = router?.enableScrollRestoration(
|
|
7684
7716
|
savedScrollPositions,
|
|
7685
7717
|
() => window.scrollY,
|
|
@@ -7687,7 +7719,7 @@ function useScrollRestoration({
|
|
|
7687
7719
|
);
|
|
7688
7720
|
return () => disableScrollRestoration && disableScrollRestoration();
|
|
7689
7721
|
}, [router, basename, getKey]);
|
|
7690
|
-
|
|
7722
|
+
React11.useLayoutEffect(() => {
|
|
7691
7723
|
if (restoreScrollPosition === false) {
|
|
7692
7724
|
return;
|
|
7693
7725
|
}
|
|
@@ -7713,7 +7745,7 @@ function useScrollRestoration({
|
|
|
7713
7745
|
}
|
|
7714
7746
|
function useBeforeUnload(callback, options) {
|
|
7715
7747
|
let { capture } = options || {};
|
|
7716
|
-
|
|
7748
|
+
React11.useEffect(() => {
|
|
7717
7749
|
let opts = capture != null ? { capture } : void 0;
|
|
7718
7750
|
window.addEventListener("beforeunload", callback, opts);
|
|
7719
7751
|
return () => {
|
|
@@ -7723,7 +7755,7 @@ function useBeforeUnload(callback, options) {
|
|
|
7723
7755
|
}
|
|
7724
7756
|
function usePageHide(callback, options) {
|
|
7725
7757
|
let { capture } = options || {};
|
|
7726
|
-
|
|
7758
|
+
React11.useEffect(() => {
|
|
7727
7759
|
let opts = capture != null ? { capture } : void 0;
|
|
7728
7760
|
window.addEventListener("pagehide", callback, opts);
|
|
7729
7761
|
return () => {
|
|
@@ -7736,7 +7768,7 @@ function usePrompt({
|
|
|
7736
7768
|
message
|
|
7737
7769
|
}) {
|
|
7738
7770
|
let blocker = useBlocker(when);
|
|
7739
|
-
|
|
7771
|
+
React11.useEffect(() => {
|
|
7740
7772
|
if (blocker.state === "blocked") {
|
|
7741
7773
|
let proceed = window.confirm(message);
|
|
7742
7774
|
if (proceed) {
|
|
@@ -7746,14 +7778,14 @@ function usePrompt({
|
|
|
7746
7778
|
}
|
|
7747
7779
|
}
|
|
7748
7780
|
}, [blocker, message]);
|
|
7749
|
-
|
|
7781
|
+
React11.useEffect(() => {
|
|
7750
7782
|
if (blocker.state === "blocked" && !when) {
|
|
7751
7783
|
blocker.reset();
|
|
7752
7784
|
}
|
|
7753
7785
|
}, [blocker, when]);
|
|
7754
7786
|
}
|
|
7755
7787
|
function useViewTransitionState(to, opts = {}) {
|
|
7756
|
-
let vtContext =
|
|
7788
|
+
let vtContext = React11.useContext(ViewTransitionContext);
|
|
7757
7789
|
invariant(
|
|
7758
7790
|
vtContext != null,
|
|
7759
7791
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
@@ -7770,8 +7802,8 @@ function useViewTransitionState(to, opts = {}) {
|
|
|
7770
7802
|
return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
|
|
7771
7803
|
}
|
|
7772
7804
|
|
|
7773
|
-
// lib/dom/
|
|
7774
|
-
import * as
|
|
7805
|
+
// lib/dom/components.tsx
|
|
7806
|
+
import * as React12 from "react";
|
|
7775
7807
|
function StaticRouter({
|
|
7776
7808
|
basename,
|
|
7777
7809
|
children,
|
|
@@ -7789,7 +7821,7 @@ function StaticRouter({
|
|
|
7789
7821
|
key: locationProp.key || "default"
|
|
7790
7822
|
};
|
|
7791
7823
|
let staticNavigator = getStatelessNavigator();
|
|
7792
|
-
return /* @__PURE__ */
|
|
7824
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7793
7825
|
Router,
|
|
7794
7826
|
{
|
|
7795
7827
|
basename,
|
|
@@ -7830,7 +7862,7 @@ function StaticRouterProvider({
|
|
|
7830
7862
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
7831
7863
|
}
|
|
7832
7864
|
let { state } = dataRouterContext.router;
|
|
7833
|
-
return /* @__PURE__ */
|
|
7865
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React12.createElement(DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React12.createElement(FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React12.createElement(ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React12.createElement(
|
|
7834
7866
|
Router,
|
|
7835
7867
|
{
|
|
7836
7868
|
basename: dataRouterContext.basename,
|
|
@@ -7839,7 +7871,7 @@ function StaticRouterProvider({
|
|
|
7839
7871
|
navigator: dataRouterContext.navigator,
|
|
7840
7872
|
static: dataRouterContext.static
|
|
7841
7873
|
},
|
|
7842
|
-
/* @__PURE__ */
|
|
7874
|
+
/* @__PURE__ */ React12.createElement(
|
|
7843
7875
|
DataRoutes2,
|
|
7844
7876
|
{
|
|
7845
7877
|
routes: router.routes,
|
|
@@ -7847,7 +7879,7 @@ function StaticRouterProvider({
|
|
|
7847
7879
|
state
|
|
7848
7880
|
}
|
|
7849
7881
|
)
|
|
7850
|
-
))))), hydrateScript ? /* @__PURE__ */
|
|
7882
|
+
))))), hydrateScript ? /* @__PURE__ */ React12.createElement(
|
|
7851
7883
|
"script",
|
|
7852
7884
|
{
|
|
7853
7885
|
suppressHydrationWarning: true,
|
|
@@ -7917,6 +7949,19 @@ function getStatelessNavigator() {
|
|
|
7917
7949
|
}
|
|
7918
7950
|
};
|
|
7919
7951
|
}
|
|
7952
|
+
var ESCAPE_LOOKUP2 = {
|
|
7953
|
+
"&": "\\u0026",
|
|
7954
|
+
">": "\\u003e",
|
|
7955
|
+
"<": "\\u003c",
|
|
7956
|
+
"\u2028": "\\u2028",
|
|
7957
|
+
"\u2029": "\\u2029"
|
|
7958
|
+
};
|
|
7959
|
+
var ESCAPE_REGEX2 = /[&><\u2028\u2029]/g;
|
|
7960
|
+
function htmlEscape(str) {
|
|
7961
|
+
return str.replace(ESCAPE_REGEX2, (match) => ESCAPE_LOOKUP2[match]);
|
|
7962
|
+
}
|
|
7963
|
+
|
|
7964
|
+
// lib/dom/server.tsx
|
|
7920
7965
|
function createStaticHandler2(routes, opts) {
|
|
7921
7966
|
return createStaticHandler(routes, {
|
|
7922
7967
|
...opts,
|
|
@@ -8015,64 +8060,9 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
8015
8060
|
}
|
|
8016
8061
|
};
|
|
8017
8062
|
}
|
|
8018
|
-
function createHref(to) {
|
|
8019
|
-
return typeof to === "string" ? to : createPath(to);
|
|
8020
|
-
}
|
|
8021
|
-
function encodeLocation(to) {
|
|
8022
|
-
let href = typeof to === "string" ? to : createPath(to);
|
|
8023
|
-
href = href.replace(/ $/, "%20");
|
|
8024
|
-
let encoded = ABSOLUTE_URL_REGEX3.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
8025
|
-
return {
|
|
8026
|
-
pathname: encoded.pathname,
|
|
8027
|
-
search: encoded.search,
|
|
8028
|
-
hash: encoded.hash
|
|
8029
|
-
};
|
|
8030
|
-
}
|
|
8031
|
-
var ABSOLUTE_URL_REGEX3 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
8032
|
-
var ESCAPE_LOOKUP2 = {
|
|
8033
|
-
"&": "\\u0026",
|
|
8034
|
-
">": "\\u003e",
|
|
8035
|
-
"<": "\\u003c",
|
|
8036
|
-
"\u2028": "\\u2028",
|
|
8037
|
-
"\u2029": "\\u2029"
|
|
8038
|
-
};
|
|
8039
|
-
var ESCAPE_REGEX2 = /[&><\u2028\u2029]/g;
|
|
8040
|
-
function htmlEscape(str) {
|
|
8041
|
-
return str.replace(ESCAPE_REGEX2, (match) => ESCAPE_LOOKUP2[match]);
|
|
8042
|
-
}
|
|
8043
|
-
|
|
8044
|
-
// lib/dom/ssr/server.tsx
|
|
8045
|
-
import * as React12 from "react";
|
|
8046
|
-
|
|
8047
|
-
// lib/dom/ssr/routeModules.ts
|
|
8048
|
-
var defaultLoadRouteModule = async (route, routeModulesCache) => {
|
|
8049
|
-
if (route.id in routeModulesCache) {
|
|
8050
|
-
return routeModulesCache[route.id];
|
|
8051
|
-
}
|
|
8052
|
-
try {
|
|
8053
|
-
let routeModule = await import(
|
|
8054
|
-
/* @vite-ignore */
|
|
8055
|
-
/* webpackIgnore: true */
|
|
8056
|
-
route.module
|
|
8057
|
-
);
|
|
8058
|
-
routeModulesCache[route.id] = routeModule;
|
|
8059
|
-
return routeModule;
|
|
8060
|
-
} catch (error) {
|
|
8061
|
-
console.error(
|
|
8062
|
-
`Error loading route module \`${route.module}\`, reloading page...`
|
|
8063
|
-
);
|
|
8064
|
-
console.error(error);
|
|
8065
|
-
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
|
|
8066
|
-
import.meta.hot) {
|
|
8067
|
-
throw error;
|
|
8068
|
-
}
|
|
8069
|
-
window.location.reload();
|
|
8070
|
-
return new Promise(() => {
|
|
8071
|
-
});
|
|
8072
|
-
}
|
|
8073
|
-
};
|
|
8074
8063
|
|
|
8075
8064
|
// lib/dom/ssr/server.tsx
|
|
8065
|
+
import * as React13 from "react";
|
|
8076
8066
|
function ServerRouter({
|
|
8077
8067
|
context,
|
|
8078
8068
|
url,
|
|
@@ -8100,7 +8090,7 @@ function ServerRouter({
|
|
|
8100
8090
|
}
|
|
8101
8091
|
}
|
|
8102
8092
|
let router = createStaticRouter(routes, context.staticHandlerContext);
|
|
8103
|
-
return /* @__PURE__ */
|
|
8093
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
8104
8094
|
FrameworkContext.Provider,
|
|
8105
8095
|
{
|
|
8106
8096
|
value: {
|
|
@@ -8111,11 +8101,10 @@ function ServerRouter({
|
|
|
8111
8101
|
future: context.future,
|
|
8112
8102
|
isSpaMode: context.isSpaMode,
|
|
8113
8103
|
serializeError: context.serializeError,
|
|
8114
|
-
renderMeta: context.renderMeta
|
|
8115
|
-
loadRouteModule: defaultLoadRouteModule
|
|
8104
|
+
renderMeta: context.renderMeta
|
|
8116
8105
|
}
|
|
8117
8106
|
},
|
|
8118
|
-
/* @__PURE__ */
|
|
8107
|
+
/* @__PURE__ */ React13.createElement(RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React13.createElement(
|
|
8119
8108
|
StaticRouterProvider,
|
|
8120
8109
|
{
|
|
8121
8110
|
router,
|
|
@@ -8123,7 +8112,7 @@ function ServerRouter({
|
|
|
8123
8112
|
hydrate: false
|
|
8124
8113
|
}
|
|
8125
8114
|
))
|
|
8126
|
-
), context.serverHandoffStream ? /* @__PURE__ */
|
|
8115
|
+
), context.serverHandoffStream ? /* @__PURE__ */ React13.createElement(React13.Suspense, null, /* @__PURE__ */ React13.createElement(
|
|
8127
8116
|
StreamTransfer,
|
|
8128
8117
|
{
|
|
8129
8118
|
context,
|
|
@@ -8136,17 +8125,16 @@ function ServerRouter({
|
|
|
8136
8125
|
}
|
|
8137
8126
|
|
|
8138
8127
|
// lib/dom/ssr/routes-test-stub.tsx
|
|
8139
|
-
import * as
|
|
8128
|
+
import * as React14 from "react";
|
|
8140
8129
|
function createRoutesStub(routes, context = {}) {
|
|
8141
8130
|
return function RoutesTestStub({
|
|
8142
8131
|
initialEntries,
|
|
8143
8132
|
initialIndex,
|
|
8144
8133
|
hydrationData,
|
|
8145
|
-
future
|
|
8146
|
-
loadRouteModule = defaultLoadRouteModule
|
|
8134
|
+
future
|
|
8147
8135
|
}) {
|
|
8148
|
-
let routerRef =
|
|
8149
|
-
let remixContextRef =
|
|
8136
|
+
let routerRef = React14.useRef();
|
|
8137
|
+
let remixContextRef = React14.useRef();
|
|
8150
8138
|
if (routerRef.current == null) {
|
|
8151
8139
|
remixContextRef.current = {
|
|
8152
8140
|
future: {},
|
|
@@ -8157,8 +8145,7 @@ function createRoutesStub(routes, context = {}) {
|
|
|
8157
8145
|
version: ""
|
|
8158
8146
|
},
|
|
8159
8147
|
routeModules: {},
|
|
8160
|
-
isSpaMode: false
|
|
8161
|
-
loadRouteModule
|
|
8148
|
+
isSpaMode: false
|
|
8162
8149
|
};
|
|
8163
8150
|
let patched = processRoutes(
|
|
8164
8151
|
// @ts-expect-error loader/action context types don't match :/
|
|
@@ -8173,7 +8160,7 @@ function createRoutesStub(routes, context = {}) {
|
|
|
8173
8160
|
hydrationData
|
|
8174
8161
|
});
|
|
8175
8162
|
}
|
|
8176
|
-
return /* @__PURE__ */
|
|
8163
|
+
return /* @__PURE__ */ React14.createElement(FrameworkContext.Provider, { value: remixContextRef.current }, /* @__PURE__ */ React14.createElement(RouterProvider, { router: routerRef.current }));
|
|
8177
8164
|
};
|
|
8178
8165
|
}
|
|
8179
8166
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -9216,8 +9203,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
9216
9203
|
renderMeta: {},
|
|
9217
9204
|
future: build.future,
|
|
9218
9205
|
isSpaMode: build.isSpaMode,
|
|
9219
|
-
serializeError: (err) => serializeError(err, serverMode)
|
|
9220
|
-
loadRouteModule: defaultLoadRouteModule
|
|
9206
|
+
serializeError: (err) => serializeError(err, serverMode)
|
|
9221
9207
|
};
|
|
9222
9208
|
let handleDocumentRequestFunction = build.entry.module.default;
|
|
9223
9209
|
try {
|
|
@@ -9622,7 +9608,6 @@ export {
|
|
|
9622
9608
|
StaticRouterProvider,
|
|
9623
9609
|
createStaticHandler2 as createStaticHandler,
|
|
9624
9610
|
createStaticRouter,
|
|
9625
|
-
defaultLoadRouteModule,
|
|
9626
9611
|
ServerRouter,
|
|
9627
9612
|
createRoutesStub,
|
|
9628
9613
|
createCookie,
|