react-router 7.9.2-pre.0 → 7.9.2-pre.2
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/CHANGELOG.md +8 -0
- package/dist/development/{chunk-ED2JHW2I.js → chunk-BMRATXNU.js} +1 -1
- package/dist/development/{chunk-VM65TX2A.js → chunk-CVJRSTVH.js} +270 -156
- package/dist/development/{chunk-EPSRV6KC.mjs → chunk-IM5OGALA.mjs} +116 -2
- package/dist/{production/chunk-HAV7J4RO.mjs → development/chunk-Z2FQBQSH.mjs} +63 -58
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.js +157 -152
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{development/chunk-PVJ3J6E6.mjs → production/chunk-54D6QT34.mjs} +63 -58
- package/dist/production/{chunk-22I2H6CR.js → chunk-JZBSSDER.js} +1 -1
- package/dist/production/{chunk-K4BWIVAI.js → chunk-MZDKBHOP.js} +270 -156
- package/dist/production/{chunk-662O2YDJ.mjs → chunk-QE6DSGL5.mjs} +116 -2
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.js +157 -152
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.9.2-pre.
|
|
2
|
+
* react-router v7.9.2-pre.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var _chunkVM65TX2Ajs = require('./chunk-VM65TX2A.js');
|
|
58
57
|
|
|
58
|
+
var _chunkCVJRSTVHjs = require('./chunk-CVJRSTVH.js');
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
@@ -145,7 +145,8 @@ var _chunkVM65TX2Ajs = require('./chunk-VM65TX2A.js');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
|
|
149
|
+
var _chunkBMRATXNUjs = require('./chunk-BMRATXNU.js');
|
|
149
150
|
|
|
150
151
|
// lib/dom/ssr/server.tsx
|
|
151
152
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react);
|
|
@@ -158,7 +159,7 @@ function ServerRouter({
|
|
|
158
159
|
url = new URL(url);
|
|
159
160
|
}
|
|
160
161
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
161
|
-
let routes =
|
|
162
|
+
let routes = _chunkBMRATXNUjs.createServerRoutes.call(void 0,
|
|
162
163
|
manifest.routes,
|
|
163
164
|
routeModules,
|
|
164
165
|
context.future,
|
|
@@ -171,7 +172,7 @@ function ServerRouter({
|
|
|
171
172
|
let routeId = match.route.id;
|
|
172
173
|
let route = routeModules[routeId];
|
|
173
174
|
let manifestRoute = context.manifest.routes[routeId];
|
|
174
|
-
if (route && manifestRoute &&
|
|
175
|
+
if (route && manifestRoute && _chunkBMRATXNUjs.shouldHydrateRouteLoader.call(void 0,
|
|
175
176
|
routeId,
|
|
176
177
|
route.clientLoader,
|
|
177
178
|
manifestRoute.hasLoader,
|
|
@@ -180,9 +181,9 @@ function ServerRouter({
|
|
|
180
181
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
|
-
let router =
|
|
184
|
+
let router = _chunkCVJRSTVHjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
184
185
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
185
|
-
|
|
186
|
+
_chunkBMRATXNUjs.FrameworkContext.Provider,
|
|
186
187
|
{
|
|
187
188
|
value: {
|
|
188
189
|
manifest,
|
|
@@ -197,8 +198,8 @@ function ServerRouter({
|
|
|
197
198
|
renderMeta: context.renderMeta
|
|
198
199
|
}
|
|
199
200
|
},
|
|
200
|
-
/* @__PURE__ */ React.createElement(
|
|
201
|
-
|
|
201
|
+
/* @__PURE__ */ React.createElement(_chunkBMRATXNUjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
202
|
+
_chunkCVJRSTVHjs.StaticRouterProvider,
|
|
202
203
|
{
|
|
203
204
|
router,
|
|
204
205
|
context: context.staticHandlerContext,
|
|
@@ -206,7 +207,7 @@ function ServerRouter({
|
|
|
206
207
|
}
|
|
207
208
|
))
|
|
208
209
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
209
|
-
|
|
210
|
+
_chunkBMRATXNUjs.StreamTransfer,
|
|
210
211
|
{
|
|
211
212
|
context,
|
|
212
213
|
identifier: 0,
|
|
@@ -248,18 +249,18 @@ function createRoutesStub(routes, _context) {
|
|
|
248
249
|
let patched = processRoutes(
|
|
249
250
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
250
251
|
// types compared to `AgnosticRouteObject`
|
|
251
|
-
|
|
252
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0,
|
|
252
|
+
_chunkBMRATXNUjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
253
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0, _chunkBMRATXNUjs.RouterContextProvider)() : {},
|
|
253
254
|
frameworkContextRef.current.manifest,
|
|
254
255
|
frameworkContextRef.current.routeModules
|
|
255
256
|
);
|
|
256
|
-
routerRef.current =
|
|
257
|
+
routerRef.current = _chunkCVJRSTVHjs.createMemoryRouter.call(void 0, patched, {
|
|
257
258
|
initialEntries,
|
|
258
259
|
initialIndex,
|
|
259
260
|
hydrationData
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
|
-
return /* @__PURE__ */ React2.createElement(
|
|
263
|
+
return /* @__PURE__ */ React2.createElement(_chunkBMRATXNUjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkCVJRSTVHjs.RouterProvider, { router: routerRef.current }));
|
|
263
264
|
};
|
|
264
265
|
}
|
|
265
266
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -273,9 +274,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
273
274
|
id: route.id,
|
|
274
275
|
path: route.path,
|
|
275
276
|
index: route.index,
|
|
276
|
-
Component: route.Component ?
|
|
277
|
-
HydrateFallback: route.HydrateFallback ?
|
|
278
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
277
|
+
Component: route.Component ? _chunkCVJRSTVHjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
278
|
+
HydrateFallback: route.HydrateFallback ? _chunkCVJRSTVHjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
279
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkCVJRSTVHjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
279
280
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
280
281
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
281
282
|
middleware: route.middleware ? route.middleware.map(
|
|
@@ -310,7 +311,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
310
311
|
};
|
|
311
312
|
manifest.routes[newRoute.id] = entryRoute;
|
|
312
313
|
routeModules[route.id] = {
|
|
313
|
-
default: newRoute.Component ||
|
|
314
|
+
default: newRoute.Component || _chunkCVJRSTVHjs.Outlet,
|
|
314
315
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
315
316
|
handle: route.handle,
|
|
316
317
|
links: route.links,
|
|
@@ -505,7 +506,7 @@ function myUnescape(value) {
|
|
|
505
506
|
return result;
|
|
506
507
|
}
|
|
507
508
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
508
|
-
|
|
509
|
+
_chunkBMRATXNUjs.warnOnce.call(void 0,
|
|
509
510
|
!expires,
|
|
510
511
|
`The "${name}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`
|
|
511
512
|
);
|
|
@@ -559,7 +560,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
559
560
|
let entries = Object.entries(errors);
|
|
560
561
|
let serialized = {};
|
|
561
562
|
for (let [key, val] of entries) {
|
|
562
|
-
if (
|
|
563
|
+
if (_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, val)) {
|
|
563
564
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
564
565
|
} else if (val instanceof Error) {
|
|
565
566
|
let sanitized = sanitizeError(val, serverMode);
|
|
@@ -584,7 +585,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
584
585
|
|
|
585
586
|
// lib/server-runtime/routeMatching.ts
|
|
586
587
|
function matchServerRoutes(routes, pathname, basename) {
|
|
587
|
-
let matches =
|
|
588
|
+
let matches = _chunkBMRATXNUjs.matchRoutes.call(void 0,
|
|
588
589
|
routes,
|
|
589
590
|
pathname,
|
|
590
591
|
basename
|
|
@@ -604,7 +605,7 @@ async function callRouteHandler(handler, args) {
|
|
|
604
605
|
params: args.params,
|
|
605
606
|
context: args.context
|
|
606
607
|
});
|
|
607
|
-
if (
|
|
608
|
+
if (_chunkBMRATXNUjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkBMRATXNUjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
608
609
|
throw new Response(null, result.init);
|
|
609
610
|
}
|
|
610
611
|
return result;
|
|
@@ -723,17 +724,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
723
724
|
controller.close();
|
|
724
725
|
}
|
|
725
726
|
});
|
|
726
|
-
let decoded = await
|
|
727
|
+
let decoded = await _chunkBMRATXNUjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
727
728
|
let data2 = decoded.value;
|
|
728
|
-
if (data2 &&
|
|
729
|
-
let result = data2[
|
|
729
|
+
if (data2 && _chunkBMRATXNUjs.SingleFetchRedirectSymbol in data2) {
|
|
730
|
+
let result = data2[_chunkBMRATXNUjs.SingleFetchRedirectSymbol];
|
|
730
731
|
let init = { status: result.status };
|
|
731
732
|
if (result.reload) {
|
|
732
|
-
throw
|
|
733
|
+
throw _chunkBMRATXNUjs.redirectDocument.call(void 0, result.redirect, init);
|
|
733
734
|
} else if (result.replace) {
|
|
734
|
-
throw
|
|
735
|
+
throw _chunkBMRATXNUjs.replace.call(void 0, result.redirect, init);
|
|
735
736
|
} else {
|
|
736
|
-
throw
|
|
737
|
+
throw _chunkBMRATXNUjs.redirect.call(void 0, result.redirect, init);
|
|
737
738
|
}
|
|
738
739
|
} else {
|
|
739
740
|
invariant2(
|
|
@@ -772,7 +773,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
772
773
|
|
|
773
774
|
// lib/server-runtime/serverHandoff.ts
|
|
774
775
|
function createServerHandoffString(serverHandoff) {
|
|
775
|
-
return
|
|
776
|
+
return _chunkBMRATXNUjs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
776
777
|
}
|
|
777
778
|
|
|
778
779
|
// lib/server-runtime/headers.ts
|
|
@@ -849,7 +850,7 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
849
850
|
|
|
850
851
|
// lib/server-runtime/single-fetch.ts
|
|
851
852
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
852
|
-
...
|
|
853
|
+
..._chunkBMRATXNUjs.NO_BODY_STATUS_CODES,
|
|
853
854
|
304
|
|
854
855
|
]);
|
|
855
856
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -879,7 +880,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
879
880
|
return handleQueryError(error);
|
|
880
881
|
}
|
|
881
882
|
function handleQueryResult(result) {
|
|
882
|
-
return
|
|
883
|
+
return _chunkBMRATXNUjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
883
884
|
}
|
|
884
885
|
function handleQueryError(error) {
|
|
885
886
|
handleError(error);
|
|
@@ -891,12 +892,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
891
892
|
}
|
|
892
893
|
function staticContextToResponse(context) {
|
|
893
894
|
let headers = getDocumentHeaders(context, build);
|
|
894
|
-
if (
|
|
895
|
+
if (_chunkBMRATXNUjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
895
896
|
return new Response(null, { status: context.statusCode, headers });
|
|
896
897
|
}
|
|
897
898
|
if (context.errors) {
|
|
898
899
|
Object.values(context.errors).forEach((err) => {
|
|
899
|
-
if (!
|
|
900
|
+
if (!_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
900
901
|
handleError(err);
|
|
901
902
|
}
|
|
902
903
|
});
|
|
@@ -943,7 +944,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
943
944
|
return handleQueryError(error);
|
|
944
945
|
}
|
|
945
946
|
function handleQueryResult(result) {
|
|
946
|
-
return
|
|
947
|
+
return _chunkBMRATXNUjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
947
948
|
}
|
|
948
949
|
function handleQueryError(error) {
|
|
949
950
|
handleError(error);
|
|
@@ -955,12 +956,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
955
956
|
}
|
|
956
957
|
function staticContextToResponse(context) {
|
|
957
958
|
let headers = getDocumentHeaders(context, build);
|
|
958
|
-
if (
|
|
959
|
+
if (_chunkBMRATXNUjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
959
960
|
return new Response(null, { status: context.statusCode, headers });
|
|
960
961
|
}
|
|
961
962
|
if (context.errors) {
|
|
962
963
|
Object.values(context.errors).forEach((err) => {
|
|
963
|
-
if (!
|
|
964
|
+
if (!_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
964
965
|
handleError(err);
|
|
965
966
|
}
|
|
966
967
|
});
|
|
@@ -1024,15 +1025,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1024
1025
|
headers.delete("Location");
|
|
1025
1026
|
headers.set("Content-Type", "text/x-script");
|
|
1026
1027
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1027
|
-
result: request.method === "GET" ? { [
|
|
1028
|
+
result: request.method === "GET" ? { [_chunkBMRATXNUjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1028
1029
|
headers,
|
|
1029
|
-
status:
|
|
1030
|
+
status: _chunkBMRATXNUjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1030
1031
|
});
|
|
1031
1032
|
}
|
|
1032
1033
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1033
1034
|
let redirect2 = headers.get("Location");
|
|
1034
1035
|
if (basename) {
|
|
1035
|
-
redirect2 =
|
|
1036
|
+
redirect2 = _chunkBMRATXNUjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1036
1037
|
}
|
|
1037
1038
|
return {
|
|
1038
1039
|
redirect: redirect2,
|
|
@@ -1058,7 +1059,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1058
1059
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1059
1060
|
);
|
|
1060
1061
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1061
|
-
return
|
|
1062
|
+
return _chunkBMRATXNUjs.encode.call(void 0, data2, {
|
|
1062
1063
|
signal: controller.signal,
|
|
1063
1064
|
plugins: [
|
|
1064
1065
|
(value) => {
|
|
@@ -1066,12 +1067,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1066
1067
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1067
1068
|
return ["SanitizedError", name, message, stack];
|
|
1068
1069
|
}
|
|
1069
|
-
if (value instanceof
|
|
1070
|
+
if (value instanceof _chunkBMRATXNUjs.ErrorResponseImpl) {
|
|
1070
1071
|
let { data: data3, status, statusText } = value;
|
|
1071
1072
|
return ["ErrorResponse", data3, status, statusText];
|
|
1072
1073
|
}
|
|
1073
|
-
if (value && typeof value === "object" &&
|
|
1074
|
-
return ["SingleFetchRedirect", value[
|
|
1074
|
+
if (value && typeof value === "object" && _chunkBMRATXNUjs.SingleFetchRedirectSymbol in value) {
|
|
1075
|
+
return ["SingleFetchRedirect", value[_chunkBMRATXNUjs.SingleFetchRedirectSymbol]];
|
|
1075
1076
|
}
|
|
1076
1077
|
}
|
|
1077
1078
|
],
|
|
@@ -1094,14 +1095,14 @@ function derive(build, mode) {
|
|
|
1094
1095
|
let routes = createRoutes(build.routes);
|
|
1095
1096
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1096
1097
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1097
|
-
let staticHandler =
|
|
1098
|
+
let staticHandler = _chunkBMRATXNUjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1098
1099
|
basename: build.basename
|
|
1099
1100
|
});
|
|
1100
1101
|
let errorHandler = build.entry.module.handleError || ((error, { request }) => {
|
|
1101
1102
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1102
1103
|
console.error(
|
|
1103
1104
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1104
|
-
|
|
1105
|
+
_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1105
1106
|
);
|
|
1106
1107
|
}
|
|
1107
1108
|
});
|
|
@@ -1147,36 +1148,36 @@ var createRequestHandler = (build, mode) => {
|
|
|
1147
1148
|
});
|
|
1148
1149
|
};
|
|
1149
1150
|
if (_build.future.v8_middleware) {
|
|
1150
|
-
if (initialContext && !(initialContext instanceof
|
|
1151
|
+
if (initialContext && !(initialContext instanceof _chunkBMRATXNUjs.RouterContextProvider)) {
|
|
1151
1152
|
let error = new Error(
|
|
1152
1153
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1153
1154
|
);
|
|
1154
1155
|
handleError(error);
|
|
1155
1156
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1156
1157
|
}
|
|
1157
|
-
loadContext = initialContext || new (0,
|
|
1158
|
+
loadContext = initialContext || new (0, _chunkBMRATXNUjs.RouterContextProvider)();
|
|
1158
1159
|
} else {
|
|
1159
1160
|
loadContext = initialContext || {};
|
|
1160
1161
|
}
|
|
1161
1162
|
let url = new URL(request.url);
|
|
1162
1163
|
let normalizedBasename = _build.basename || "/";
|
|
1163
1164
|
let normalizedPath = url.pathname;
|
|
1164
|
-
if (
|
|
1165
|
+
if (_chunkBMRATXNUjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1165
1166
|
normalizedPath = normalizedBasename;
|
|
1166
1167
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1167
1168
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1168
1169
|
}
|
|
1169
|
-
if (
|
|
1170
|
+
if (_chunkBMRATXNUjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1170
1171
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1171
1172
|
}
|
|
1172
1173
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1173
1174
|
if (!_build.ssr) {
|
|
1174
1175
|
let decodedPath = decodeURI(normalizedPath);
|
|
1175
1176
|
if (normalizedBasename !== "/") {
|
|
1176
|
-
let strippedPath =
|
|
1177
|
+
let strippedPath = _chunkBMRATXNUjs.stripBasename.call(void 0, decodedPath, normalizedBasename);
|
|
1177
1178
|
if (strippedPath == null) {
|
|
1178
1179
|
errorHandler(
|
|
1179
|
-
new (0,
|
|
1180
|
+
new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(
|
|
1180
1181
|
404,
|
|
1181
1182
|
"Not Found",
|
|
1182
1183
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
@@ -1199,7 +1200,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1199
1200
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
1200
1201
|
if (url.pathname.endsWith(".data")) {
|
|
1201
1202
|
errorHandler(
|
|
1202
|
-
new (0,
|
|
1203
|
+
new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(
|
|
1203
1204
|
404,
|
|
1204
1205
|
"Not Found",
|
|
1205
1206
|
`Refusing to SSR the path \`${decodedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
|
|
@@ -1219,7 +1220,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1219
1220
|
}
|
|
1220
1221
|
}
|
|
1221
1222
|
}
|
|
1222
|
-
let manifestUrl =
|
|
1223
|
+
let manifestUrl = _chunkBMRATXNUjs.getManifestPath.call(void 0,
|
|
1223
1224
|
_build.routeDiscovery.manifestPath,
|
|
1224
1225
|
normalizedBasename
|
|
1225
1226
|
);
|
|
@@ -1254,7 +1255,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1254
1255
|
loadContext,
|
|
1255
1256
|
handleError
|
|
1256
1257
|
);
|
|
1257
|
-
if (
|
|
1258
|
+
if (_chunkBMRATXNUjs.isRedirectResponse.call(void 0, response)) {
|
|
1258
1259
|
response = generateSingleFetchRedirectResponse(
|
|
1259
1260
|
response,
|
|
1260
1261
|
request,
|
|
@@ -1268,7 +1269,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1268
1269
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1269
1270
|
request
|
|
1270
1271
|
});
|
|
1271
|
-
if (
|
|
1272
|
+
if (_chunkBMRATXNUjs.isRedirectResponse.call(void 0, response)) {
|
|
1272
1273
|
response = generateSingleFetchRedirectResponse(
|
|
1273
1274
|
response,
|
|
1274
1275
|
request,
|
|
@@ -1387,7 +1388,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1387
1388
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1388
1389
|
try {
|
|
1389
1390
|
let innerResult = await query(request);
|
|
1390
|
-
if (!
|
|
1391
|
+
if (!_chunkBMRATXNUjs.isResponse.call(void 0, innerResult)) {
|
|
1391
1392
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1392
1393
|
}
|
|
1393
1394
|
return innerResult;
|
|
@@ -1397,7 +1398,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1397
1398
|
}
|
|
1398
1399
|
} : void 0
|
|
1399
1400
|
});
|
|
1400
|
-
if (!
|
|
1401
|
+
if (!_chunkBMRATXNUjs.isResponse.call(void 0, result)) {
|
|
1401
1402
|
result = await renderHtml(result, isSpaMode);
|
|
1402
1403
|
}
|
|
1403
1404
|
return result;
|
|
@@ -1412,7 +1413,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1412
1413
|
}
|
|
1413
1414
|
if (context.errors) {
|
|
1414
1415
|
Object.values(context.errors).forEach((err) => {
|
|
1415
|
-
if (!
|
|
1416
|
+
if (!_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1416
1417
|
handleError(err);
|
|
1417
1418
|
}
|
|
1418
1419
|
});
|
|
@@ -1464,10 +1465,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1464
1465
|
} catch (error) {
|
|
1465
1466
|
handleError(error);
|
|
1466
1467
|
let errorForSecondRender = error;
|
|
1467
|
-
if (
|
|
1468
|
+
if (_chunkBMRATXNUjs.isResponse.call(void 0, error)) {
|
|
1468
1469
|
try {
|
|
1469
1470
|
let data2 = await unwrapResponse(error);
|
|
1470
|
-
errorForSecondRender = new (0,
|
|
1471
|
+
errorForSecondRender = new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(
|
|
1471
1472
|
error.status,
|
|
1472
1473
|
error.statusText,
|
|
1473
1474
|
data2
|
|
@@ -1475,7 +1476,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1475
1476
|
} catch (e) {
|
|
1476
1477
|
}
|
|
1477
1478
|
}
|
|
1478
|
-
context =
|
|
1479
|
+
context = _chunkBMRATXNUjs.getStaticContextFromError.call(void 0,
|
|
1479
1480
|
staticHandler.dataRoutes,
|
|
1480
1481
|
context,
|
|
1481
1482
|
errorForSecondRender
|
|
@@ -1534,7 +1535,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1534
1535
|
return handleQueryRouteError(error);
|
|
1535
1536
|
}
|
|
1536
1537
|
function handleQueryRouteResult(result) {
|
|
1537
|
-
if (
|
|
1538
|
+
if (_chunkBMRATXNUjs.isResponse.call(void 0, result)) {
|
|
1538
1539
|
return result;
|
|
1539
1540
|
}
|
|
1540
1541
|
if (typeof result === "string") {
|
|
@@ -1543,11 +1544,11 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1543
1544
|
return Response.json(result);
|
|
1544
1545
|
}
|
|
1545
1546
|
function handleQueryRouteError(error) {
|
|
1546
|
-
if (
|
|
1547
|
+
if (_chunkBMRATXNUjs.isResponse.call(void 0, error)) {
|
|
1547
1548
|
error.headers.set("X-Remix-Catch", "yes");
|
|
1548
1549
|
return error;
|
|
1549
1550
|
}
|
|
1550
|
-
if (
|
|
1551
|
+
if (_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1551
1552
|
handleError(error);
|
|
1552
1553
|
return errorResponseToJson(error, serverMode);
|
|
1553
1554
|
}
|
|
@@ -1673,7 +1674,7 @@ function createSessionStorage({
|
|
|
1673
1674
|
};
|
|
1674
1675
|
}
|
|
1675
1676
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1676
|
-
|
|
1677
|
+
_chunkBMRATXNUjs.warnOnce.call(void 0,
|
|
1677
1678
|
cookie.isSigned,
|
|
1678
1679
|
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
|
|
1679
1680
|
);
|
|
@@ -1780,12 +1781,12 @@ function getHydrationData({
|
|
|
1780
1781
|
...state,
|
|
1781
1782
|
loaderData: { ...state.loaderData }
|
|
1782
1783
|
};
|
|
1783
|
-
let initialMatches =
|
|
1784
|
+
let initialMatches = _chunkBMRATXNUjs.matchRoutes.call(void 0, routes, location2, basename);
|
|
1784
1785
|
if (initialMatches) {
|
|
1785
1786
|
for (let match of initialMatches) {
|
|
1786
1787
|
let routeId = match.route.id;
|
|
1787
1788
|
let routeInfo = getRouteInfo(routeId);
|
|
1788
|
-
if (
|
|
1789
|
+
if (_chunkBMRATXNUjs.shouldHydrateRouteLoader.call(void 0,
|
|
1789
1790
|
routeId,
|
|
1790
1791
|
routeInfo.clientLoader,
|
|
1791
1792
|
routeInfo.hasLoader,
|
|
@@ -1863,7 +1864,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1863
1864
|
}
|
|
1864
1865
|
}
|
|
1865
1866
|
);
|
|
1866
|
-
if (
|
|
1867
|
+
if (_chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1867
1868
|
return /* @__PURE__ */ React.default.createElement(
|
|
1868
1869
|
ErrorWrapper,
|
|
1869
1870
|
{
|
|
@@ -1871,7 +1872,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1871
1872
|
title: "Unhandled Thrown Response!"
|
|
1872
1873
|
},
|
|
1873
1874
|
/* @__PURE__ */ React.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
1874
|
-
|
|
1875
|
+
_chunkBMRATXNUjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
1875
1876
|
);
|
|
1876
1877
|
}
|
|
1877
1878
|
let errorInstance;
|
|
@@ -1897,7 +1898,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1897
1898
|
function RSCDefaultRootErrorBoundary({
|
|
1898
1899
|
hasRootLayout
|
|
1899
1900
|
}) {
|
|
1900
|
-
let error =
|
|
1901
|
+
let error = _chunkBMRATXNUjs.useRouteError.call(void 0, );
|
|
1901
1902
|
if (hasRootLayout === void 0) {
|
|
1902
1903
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
1903
1904
|
}
|
|
@@ -1942,7 +1943,7 @@ function createCallServer({
|
|
|
1942
1943
|
return async (id, args) => {
|
|
1943
1944
|
let actionId = globalVar.__routerActionID = (_nullishCoalesce(globalVar.__routerActionID, () => ( (globalVar.__routerActionID = 0)))) + 1;
|
|
1944
1945
|
const temporaryReferences = createTemporaryReferenceSet();
|
|
1945
|
-
const
|
|
1946
|
+
const payloadPromise = fetchImplementation(
|
|
1946
1947
|
new Request(location.href, {
|
|
1947
1948
|
body: await encodeReply(args, { temporaryReferences }),
|
|
1948
1949
|
method: "POST",
|
|
@@ -1951,44 +1952,45 @@ function createCallServer({
|
|
|
1951
1952
|
"rsc-action-id": id
|
|
1952
1953
|
}
|
|
1953
1954
|
})
|
|
1954
|
-
)
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
}
|
|
1958
|
-
const payload = await createFromReadableStream(response.body, {
|
|
1959
|
-
temporaryReferences
|
|
1960
|
-
});
|
|
1961
|
-
if (payload.type === "redirect") {
|
|
1962
|
-
if (payload.reload) {
|
|
1963
|
-
window.location.href = payload.location;
|
|
1964
|
-
return;
|
|
1955
|
+
).then((response) => {
|
|
1956
|
+
if (!response.body) {
|
|
1957
|
+
throw new Error("No response body");
|
|
1965
1958
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1959
|
+
return createFromReadableStream(response.body, {
|
|
1960
|
+
temporaryReferences
|
|
1968
1961
|
});
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1962
|
+
});
|
|
1963
|
+
globalVar.__reactRouterDataRouter.__setPendingRerender(
|
|
1964
|
+
Promise.resolve(payloadPromise).then(async (payload) => {
|
|
1965
|
+
if (payload.type === "redirect") {
|
|
1966
|
+
if (payload.reload) {
|
|
1967
|
+
window.location.href = payload.location;
|
|
1968
|
+
return () => {
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
return () => {
|
|
1972
|
+
globalVar.__reactRouterDataRouter.navigate(payload.location, {
|
|
1973
|
+
replace: payload.replace
|
|
1974
|
+
});
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
if (payload.type !== "action") {
|
|
1978
|
+
throw new Error("Unexpected payload type");
|
|
1979
|
+
}
|
|
1980
|
+
const rerender = await payload.rerender;
|
|
1981
|
+
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
1982
|
+
if (rerender.type === "redirect") {
|
|
1983
|
+
if (rerender.reload) {
|
|
1984
|
+
window.location.href = rerender.location;
|
|
1985
|
+
return;
|
|
1986
|
+
}
|
|
1987
|
+
return () => {
|
|
1987
1988
|
globalVar.__reactRouterDataRouter.navigate(rerender.location, {
|
|
1988
1989
|
replace: rerender.replace
|
|
1989
1990
|
});
|
|
1990
|
-
|
|
1991
|
-
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
return () => {
|
|
1992
1994
|
let lastMatch;
|
|
1993
1995
|
for (const match of rerender.matches) {
|
|
1994
1996
|
globalVar.__reactRouterDataRouter.patchRoutes(
|
|
@@ -1999,29 +2001,32 @@ function createCallServer({
|
|
|
1999
2001
|
lastMatch = match;
|
|
2000
2002
|
}
|
|
2001
2003
|
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
2002
|
-
{
|
|
2004
|
+
{
|
|
2005
|
+
loaderData: Object.assign(
|
|
2006
|
+
{},
|
|
2007
|
+
globalVar.__reactRouterDataRouter.state.loaderData,
|
|
2008
|
+
rerender.loaderData
|
|
2009
|
+
),
|
|
2010
|
+
errors: rerender.errors ? Object.assign(
|
|
2011
|
+
{},
|
|
2012
|
+
globalVar.__reactRouterDataRouter.state.errors,
|
|
2013
|
+
rerender.errors
|
|
2014
|
+
) : null
|
|
2015
|
+
}
|
|
2003
2016
|
);
|
|
2004
|
-
|
|
2005
|
-
window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
|
|
2006
|
-
{
|
|
2007
|
-
loaderData: Object.assign(
|
|
2008
|
-
{},
|
|
2009
|
-
globalVar.__reactRouterDataRouter.state.loaderData,
|
|
2010
|
-
rerender.loaderData
|
|
2011
|
-
),
|
|
2012
|
-
errors: rerender.errors ? Object.assign(
|
|
2013
|
-
{},
|
|
2014
|
-
globalVar.__reactRouterDataRouter.state.errors,
|
|
2015
|
-
rerender.errors
|
|
2016
|
-
) : null
|
|
2017
|
-
}
|
|
2018
|
-
);
|
|
2019
|
-
});
|
|
2020
|
-
}
|
|
2017
|
+
};
|
|
2021
2018
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2019
|
+
return () => {
|
|
2020
|
+
};
|
|
2021
|
+
}).catch(() => {
|
|
2022
|
+
})
|
|
2023
|
+
);
|
|
2024
|
+
return payloadPromise.then((payload) => {
|
|
2025
|
+
if (payload.type !== "action" && payload.type !== "redirect") {
|
|
2026
|
+
throw new Error("Unexpected payload type");
|
|
2027
|
+
}
|
|
2028
|
+
return payload.actionResult;
|
|
2029
|
+
});
|
|
2025
2030
|
};
|
|
2026
2031
|
}
|
|
2027
2032
|
function createRouterFromPayload({
|
|
@@ -2041,7 +2046,7 @@ function createRouterFromPayload({
|
|
|
2041
2046
|
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
|
2042
2047
|
let patches = /* @__PURE__ */ new Map();
|
|
2043
2048
|
_optionalChain([payload, 'access', _20 => _20.patches, 'optionalAccess', _21 => _21.forEach, 'call', _22 => _22((patch) => {
|
|
2044
|
-
|
|
2049
|
+
_chunkBMRATXNUjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
2045
2050
|
if (!patches.has(patch.parentId)) {
|
|
2046
2051
|
patches.set(patch.parentId, []);
|
|
2047
2052
|
}
|
|
@@ -2063,11 +2068,11 @@ function createRouterFromPayload({
|
|
|
2063
2068
|
}
|
|
2064
2069
|
return [route];
|
|
2065
2070
|
}, []);
|
|
2066
|
-
globalVar.__reactRouterDataRouter =
|
|
2071
|
+
globalVar.__reactRouterDataRouter = _chunkBMRATXNUjs.createRouter.call(void 0, {
|
|
2067
2072
|
routes,
|
|
2068
2073
|
getContext,
|
|
2069
2074
|
basename: payload.basename,
|
|
2070
|
-
history:
|
|
2075
|
+
history: _chunkBMRATXNUjs.createBrowserHistory.call(void 0, ),
|
|
2071
2076
|
hydrationData: getHydrationData({
|
|
2072
2077
|
state: {
|
|
2073
2078
|
loaderData: payload.loaderData,
|
|
@@ -2077,7 +2082,7 @@ function createRouterFromPayload({
|
|
|
2077
2082
|
routes,
|
|
2078
2083
|
getRouteInfo: (routeId) => {
|
|
2079
2084
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
2080
|
-
|
|
2085
|
+
_chunkBMRATXNUjs.invariant.call(void 0, match, "Route not found in payload");
|
|
2081
2086
|
return {
|
|
2082
2087
|
clientLoader: match.clientLoader,
|
|
2083
2088
|
hasLoader: match.hasLoader,
|
|
@@ -2175,9 +2180,9 @@ function createRouterFromPayload({
|
|
|
2175
2180
|
routeModules: globalVar.__reactRouterRouteModules
|
|
2176
2181
|
};
|
|
2177
2182
|
}
|
|
2178
|
-
var renderedRoutesContext =
|
|
2183
|
+
var renderedRoutesContext = _chunkBMRATXNUjs.createContext.call(void 0, );
|
|
2179
2184
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
2180
|
-
let dataStrategy =
|
|
2185
|
+
let dataStrategy = _chunkBMRATXNUjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
2181
2186
|
getRouter,
|
|
2182
2187
|
(match) => {
|
|
2183
2188
|
let M = match;
|
|
@@ -2231,20 +2236,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2231
2236
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
2232
2237
|
return async (args, basename, targetRoutes) => {
|
|
2233
2238
|
let { request, context } = args;
|
|
2234
|
-
let url =
|
|
2239
|
+
let url = _chunkBMRATXNUjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
2235
2240
|
if (request.method === "GET") {
|
|
2236
|
-
url =
|
|
2241
|
+
url = _chunkBMRATXNUjs.stripIndexParam.call(void 0, url);
|
|
2237
2242
|
if (targetRoutes) {
|
|
2238
2243
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
2239
2244
|
}
|
|
2240
2245
|
}
|
|
2241
2246
|
let res = await fetchImplementation(
|
|
2242
|
-
new Request(url, await
|
|
2247
|
+
new Request(url, await _chunkBMRATXNUjs.createRequestInit.call(void 0, request))
|
|
2243
2248
|
);
|
|
2244
2249
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
2245
|
-
throw new (0,
|
|
2250
|
+
throw new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(404, "Not Found", true);
|
|
2246
2251
|
}
|
|
2247
|
-
|
|
2252
|
+
_chunkBMRATXNUjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
2248
2253
|
try {
|
|
2249
2254
|
const payload = await createFromReadableStream(res.body, {
|
|
2250
2255
|
temporaryReferences: void 0
|
|
@@ -2268,7 +2273,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
2268
2273
|
}
|
|
2269
2274
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
2270
2275
|
let results = { routes: {} };
|
|
2271
|
-
const dataKey =
|
|
2276
|
+
const dataKey = _chunkBMRATXNUjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
2272
2277
|
for (let [routeId, data2] of Object.entries(payload[dataKey] || {})) {
|
|
2273
2278
|
results.routes[routeId] = { data: data2 };
|
|
2274
2279
|
}
|
|
@@ -2301,7 +2306,7 @@ function RSCHydratedRouter({
|
|
|
2301
2306
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
2302
2307
|
);
|
|
2303
2308
|
React4.useEffect(() => {
|
|
2304
|
-
|
|
2309
|
+
_chunkBMRATXNUjs.setIsHydrated.call(void 0, );
|
|
2305
2310
|
}, []);
|
|
2306
2311
|
React4.useLayoutEffect(() => {
|
|
2307
2312
|
const globalVar = window;
|
|
@@ -2388,7 +2393,7 @@ function RSCHydratedRouter({
|
|
|
2388
2393
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2389
2394
|
routeModules
|
|
2390
2395
|
};
|
|
2391
|
-
return /* @__PURE__ */ React4.createElement(
|
|
2396
|
+
return /* @__PURE__ */ React4.createElement(_chunkBMRATXNUjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(_chunkBMRATXNUjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(_chunkCVJRSTVHjs.UNSTABLE_TransitionEnabledRouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2392
2397
|
}
|
|
2393
2398
|
function createRouteFromServerManifest(match, payload) {
|
|
2394
2399
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -2399,7 +2404,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2399
2404
|
// the server loader flow regardless of whether the client loader calls
|
|
2400
2405
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
2401
2406
|
match.hasComponent && !match.element;
|
|
2402
|
-
|
|
2407
|
+
_chunkBMRATXNUjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
2403
2408
|
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
|
2404
2409
|
let dataRoute = {
|
|
2405
2410
|
id: match.id,
|
|
@@ -2450,7 +2455,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2450
2455
|
return await callSingleFetch(singleFetch);
|
|
2451
2456
|
}
|
|
2452
2457
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
2453
|
-
throw
|
|
2458
|
+
throw _chunkBMRATXNUjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
2454
2459
|
},
|
|
2455
2460
|
path: match.path,
|
|
2456
2461
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -2463,7 +2468,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2463
2468
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
2464
2469
|
};
|
|
2465
2470
|
if (typeof dataRoute.loader === "function") {
|
|
2466
|
-
dataRoute.loader.hydrate =
|
|
2471
|
+
dataRoute.loader.hydrate = _chunkBMRATXNUjs.shouldHydrateRouteLoader.call(void 0,
|
|
2467
2472
|
match.id,
|
|
2468
2473
|
match.clientLoader,
|
|
2469
2474
|
match.hasLoader,
|
|
@@ -2473,7 +2478,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2473
2478
|
return dataRoute;
|
|
2474
2479
|
}
|
|
2475
2480
|
function callSingleFetch(singleFetch) {
|
|
2476
|
-
|
|
2481
|
+
_chunkBMRATXNUjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
2477
2482
|
return singleFetch();
|
|
2478
2483
|
}
|
|
2479
2484
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -2481,7 +2486,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
2481
2486
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
2482
2487
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
2483
2488
|
console.error(msg);
|
|
2484
|
-
throw new (0,
|
|
2489
|
+
throw new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
2485
2490
|
}
|
|
2486
2491
|
}
|
|
2487
2492
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -2725,7 +2730,7 @@ async function routeRSCServerRequest({
|
|
|
2725
2730
|
const payload = await createFromReadableStream(
|
|
2726
2731
|
detectRedirectResponse.body
|
|
2727
2732
|
);
|
|
2728
|
-
if (serverResponse.status ===
|
|
2733
|
+
if (serverResponse.status === _chunkBMRATXNUjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2729
2734
|
const headers2 = new Headers(serverResponse.headers);
|
|
2730
2735
|
headers2.delete("Content-Encoding");
|
|
2731
2736
|
headers2.delete("Content-Length");
|
|
@@ -2760,7 +2765,7 @@ async function routeRSCServerRequest({
|
|
|
2760
2765
|
return reason;
|
|
2761
2766
|
}
|
|
2762
2767
|
try {
|
|
2763
|
-
const status =
|
|
2768
|
+
const status = _chunkBMRATXNUjs.isRouteErrorResponse.call(void 0, reason) ? reason.status : 500;
|
|
2764
2769
|
const html = await renderHTML(() => {
|
|
2765
2770
|
const decoded = Promise.resolve(
|
|
2766
2771
|
createFromReadableStream(createStream())
|
|
@@ -2826,7 +2831,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2826
2831
|
if (payload.type !== "render") return null;
|
|
2827
2832
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2828
2833
|
for (const match of payload.matches) {
|
|
2829
|
-
if (
|
|
2834
|
+
if (_chunkBMRATXNUjs.shouldHydrateRouteLoader.call(void 0,
|
|
2830
2835
|
match.id,
|
|
2831
2836
|
match.clientLoader,
|
|
2832
2837
|
match.hasLoader,
|
|
@@ -2866,7 +2871,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2866
2871
|
}
|
|
2867
2872
|
}))
|
|
2868
2873
|
};
|
|
2869
|
-
const router =
|
|
2874
|
+
const router = _chunkCVJRSTVHjs.createStaticRouter.call(void 0,
|
|
2870
2875
|
payload.matches.reduceRight((previous, match) => {
|
|
2871
2876
|
const route = {
|
|
2872
2877
|
id: match.id,
|
|
@@ -2910,8 +2915,8 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2910
2915
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2911
2916
|
routeModules: createRSCRouteModules(payload)
|
|
2912
2917
|
};
|
|
2913
|
-
return /* @__PURE__ */ React5.createElement(
|
|
2914
|
-
|
|
2918
|
+
return /* @__PURE__ */ React5.createElement(_chunkBMRATXNUjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(_chunkBMRATXNUjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2919
|
+
_chunkCVJRSTVHjs.StaticRouterProvider,
|
|
2915
2920
|
{
|
|
2916
2921
|
context,
|
|
2917
2922
|
router,
|
|
@@ -2969,7 +2974,7 @@ function deserializeErrors(errors) {
|
|
|
2969
2974
|
let serialized = {};
|
|
2970
2975
|
for (let [key, val] of entries) {
|
|
2971
2976
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2972
|
-
serialized[key] = new (0,
|
|
2977
|
+
serialized[key] = new (0, _chunkBMRATXNUjs.ErrorResponseImpl)(
|
|
2973
2978
|
val.status,
|
|
2974
2979
|
val.statusText,
|
|
2975
2980
|
val.data,
|
|
@@ -3128,4 +3133,4 @@ function deserializeErrors(errors) {
|
|
|
3128
3133
|
|
|
3129
3134
|
|
|
3130
3135
|
|
|
3131
|
-
exports.Await =
|
|
3136
|
+
exports.Await = _chunkCVJRSTVHjs.Await; exports.BrowserRouter = _chunkCVJRSTVHjs.BrowserRouter; exports.Form = _chunkCVJRSTVHjs.Form; exports.HashRouter = _chunkCVJRSTVHjs.HashRouter; exports.IDLE_BLOCKER = _chunkBMRATXNUjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkBMRATXNUjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkBMRATXNUjs.IDLE_NAVIGATION; exports.Link = _chunkCVJRSTVHjs.Link; exports.Links = _chunkBMRATXNUjs.Links; exports.MemoryRouter = _chunkCVJRSTVHjs.MemoryRouter; exports.Meta = _chunkBMRATXNUjs.Meta; exports.NavLink = _chunkCVJRSTVHjs.NavLink; exports.Navigate = _chunkCVJRSTVHjs.Navigate; exports.NavigationType = _chunkBMRATXNUjs.Action; exports.Outlet = _chunkCVJRSTVHjs.Outlet; exports.PrefetchPageLinks = _chunkBMRATXNUjs.PrefetchPageLinks; exports.Route = _chunkCVJRSTVHjs.Route; exports.Router = _chunkCVJRSTVHjs.Router; exports.RouterContextProvider = _chunkBMRATXNUjs.RouterContextProvider; exports.RouterProvider = _chunkCVJRSTVHjs.RouterProvider; exports.Routes = _chunkCVJRSTVHjs.Routes; exports.Scripts = _chunkBMRATXNUjs.Scripts; exports.ScrollRestoration = _chunkCVJRSTVHjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunkCVJRSTVHjs.StaticRouter; exports.StaticRouterProvider = _chunkCVJRSTVHjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkBMRATXNUjs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunkBMRATXNUjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkBMRATXNUjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkBMRATXNUjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkBMRATXNUjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkBMRATXNUjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkBMRATXNUjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkBMRATXNUjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkBMRATXNUjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkBMRATXNUjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkBMRATXNUjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkBMRATXNUjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkCVJRSTVHjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkCVJRSTVHjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkCVJRSTVHjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkBMRATXNUjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkBMRATXNUjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkBMRATXNUjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunkBMRATXNUjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkBMRATXNUjs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkBMRATXNUjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkBMRATXNUjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkCVJRSTVHjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkBMRATXNUjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkCVJRSTVHjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkBMRATXNUjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkBMRATXNUjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunkCVJRSTVHjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkCVJRSTVHjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkCVJRSTVHjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkCVJRSTVHjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunkCVJRSTVHjs.createBrowserRouter; exports.createContext = _chunkBMRATXNUjs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunkCVJRSTVHjs.createHashRouter; exports.createMemoryRouter = _chunkCVJRSTVHjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkBMRATXNUjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkCVJRSTVHjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkCVJRSTVHjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunkCVJRSTVHjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunkCVJRSTVHjs.createStaticHandler; exports.createStaticRouter = _chunkCVJRSTVHjs.createStaticRouter; exports.data = _chunkBMRATXNUjs.data; exports.generatePath = _chunkBMRATXNUjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkBMRATXNUjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkBMRATXNUjs.matchPath; exports.matchRoutes = _chunkBMRATXNUjs.matchRoutes; exports.parsePath = _chunkBMRATXNUjs.parsePath; exports.redirect = _chunkBMRATXNUjs.redirect; exports.redirectDocument = _chunkBMRATXNUjs.redirectDocument; exports.renderMatches = _chunkCVJRSTVHjs.renderMatches; exports.replace = _chunkBMRATXNUjs.replace; exports.resolvePath = _chunkBMRATXNUjs.resolvePath; exports.unstable_HistoryRouter = _chunkCVJRSTVHjs.HistoryRouter; exports.unstable_RSCHydratedRouter = RSCHydratedRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_createCallServer = createCallServer; exports.unstable_getRSCStream = getRSCStream; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunkCVJRSTVHjs.usePrompt; exports.useActionData = _chunkBMRATXNUjs.useActionData; exports.useAsyncError = _chunkBMRATXNUjs.useAsyncError; exports.useAsyncValue = _chunkBMRATXNUjs.useAsyncValue; exports.useBeforeUnload = _chunkCVJRSTVHjs.useBeforeUnload; exports.useBlocker = _chunkBMRATXNUjs.useBlocker; exports.useFetcher = _chunkCVJRSTVHjs.useFetcher; exports.useFetchers = _chunkCVJRSTVHjs.useFetchers; exports.useFormAction = _chunkCVJRSTVHjs.useFormAction; exports.useHref = _chunkBMRATXNUjs.useHref; exports.useInRouterContext = _chunkBMRATXNUjs.useInRouterContext; exports.useLinkClickHandler = _chunkCVJRSTVHjs.useLinkClickHandler; exports.useLoaderData = _chunkBMRATXNUjs.useLoaderData; exports.useLocation = _chunkBMRATXNUjs.useLocation; exports.useMatch = _chunkBMRATXNUjs.useMatch; exports.useMatches = _chunkBMRATXNUjs.useMatches; exports.useNavigate = _chunkBMRATXNUjs.useNavigate; exports.useNavigation = _chunkBMRATXNUjs.useNavigation; exports.useNavigationType = _chunkBMRATXNUjs.useNavigationType; exports.useOutlet = _chunkBMRATXNUjs.useOutlet; exports.useOutletContext = _chunkBMRATXNUjs.useOutletContext; exports.useParams = _chunkBMRATXNUjs.useParams; exports.useResolvedPath = _chunkBMRATXNUjs.useResolvedPath; exports.useRevalidator = _chunkBMRATXNUjs.useRevalidator; exports.useRouteError = _chunkBMRATXNUjs.useRouteError; exports.useRouteLoaderData = _chunkBMRATXNUjs.useRouteLoaderData; exports.useRoutes = _chunkBMRATXNUjs.useRoutes; exports.useSearchParams = _chunkCVJRSTVHjs.useSearchParams; exports.useSubmit = _chunkCVJRSTVHjs.useSubmit; exports.useViewTransitionState = _chunkCVJRSTVHjs.useViewTransitionState;
|