react-router 7.8.1-pre.1 → 7.8.1
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 +5 -11
- package/dist/{production/chunk-J44BHEXU.mjs → development/chunk-IFMMFE4R.mjs} +2 -2
- package/dist/development/{chunk-3JDDYHAM.js → chunk-IIA3TUI2.js} +130 -130
- package/dist/development/{chunk-5556IWOV.js → chunk-TGXCWGPT.js} +1 -1
- package/dist/development/{chunk-74543KUN.mjs → chunk-UH6JLGW7.mjs} +2 -2
- 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 +102 -102
- 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-NL6TORMN.mjs → production/chunk-5Y7ELDIJ.mjs} +2 -2
- package/dist/production/{chunk-3OSMCWIR.js → chunk-KHPQXKYM.js} +1 -1
- package/dist/production/{chunk-HVGIEXH6.mjs → chunk-PFDCNQUK.mjs} +2 -2
- package/dist/production/{chunk-OE6UW5JS.js → chunk-YMYXECPK.js} +130 -130
- 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 +102 -102
- 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.8.1
|
|
2
|
+
* react-router v7.8.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunkIIA3TUI2js = require('./chunk-IIA3TUI2.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -143,7 +143,7 @@ var _chunk3JDDYHAMjs = require('./chunk-3JDDYHAM.js');
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
var
|
|
146
|
+
var _chunkTGXCWGPTjs = require('./chunk-TGXCWGPT.js');
|
|
147
147
|
|
|
148
148
|
// lib/dom/ssr/server.tsx
|
|
149
149
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react);
|
|
@@ -156,7 +156,7 @@ function ServerRouter({
|
|
|
156
156
|
url = new URL(url);
|
|
157
157
|
}
|
|
158
158
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
159
|
-
let routes =
|
|
159
|
+
let routes = _chunkTGXCWGPTjs.createServerRoutes.call(void 0,
|
|
160
160
|
manifest.routes,
|
|
161
161
|
routeModules,
|
|
162
162
|
context.future,
|
|
@@ -169,7 +169,7 @@ function ServerRouter({
|
|
|
169
169
|
let routeId = match.route.id;
|
|
170
170
|
let route = routeModules[routeId];
|
|
171
171
|
let manifestRoute = context.manifest.routes[routeId];
|
|
172
|
-
if (route && manifestRoute &&
|
|
172
|
+
if (route && manifestRoute && _chunkTGXCWGPTjs.shouldHydrateRouteLoader.call(void 0,
|
|
173
173
|
routeId,
|
|
174
174
|
route.clientLoader,
|
|
175
175
|
manifestRoute.hasLoader,
|
|
@@ -178,9 +178,9 @@ function ServerRouter({
|
|
|
178
178
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
let router =
|
|
181
|
+
let router = _chunkIIA3TUI2js.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
182
182
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
183
|
-
|
|
183
|
+
_chunkTGXCWGPTjs.FrameworkContext.Provider,
|
|
184
184
|
{
|
|
185
185
|
value: {
|
|
186
186
|
manifest,
|
|
@@ -195,8 +195,8 @@ function ServerRouter({
|
|
|
195
195
|
renderMeta: context.renderMeta
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
|
-
/* @__PURE__ */ React.createElement(
|
|
199
|
-
|
|
198
|
+
/* @__PURE__ */ React.createElement(_chunkTGXCWGPTjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
199
|
+
_chunkIIA3TUI2js.StaticRouterProvider,
|
|
200
200
|
{
|
|
201
201
|
router,
|
|
202
202
|
context: context.staticHandlerContext,
|
|
@@ -204,7 +204,7 @@ function ServerRouter({
|
|
|
204
204
|
}
|
|
205
205
|
))
|
|
206
206
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
207
|
-
|
|
207
|
+
_chunkTGXCWGPTjs.StreamTransfer,
|
|
208
208
|
{
|
|
209
209
|
context,
|
|
210
210
|
identifier: 0,
|
|
@@ -246,18 +246,18 @@ function createRoutesStub(routes, _context) {
|
|
|
246
246
|
let patched = processRoutes(
|
|
247
247
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
248
248
|
// types compared to `AgnosticRouteObject`
|
|
249
|
-
|
|
250
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.unstable_middleware]) ? new (0,
|
|
249
|
+
_chunkTGXCWGPTjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
250
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.unstable_middleware]) ? new (0, _chunkTGXCWGPTjs.unstable_RouterContextProvider)() : {},
|
|
251
251
|
frameworkContextRef.current.manifest,
|
|
252
252
|
frameworkContextRef.current.routeModules
|
|
253
253
|
);
|
|
254
|
-
routerRef.current =
|
|
254
|
+
routerRef.current = _chunkIIA3TUI2js.createMemoryRouter.call(void 0, patched, {
|
|
255
255
|
initialEntries,
|
|
256
256
|
initialIndex,
|
|
257
257
|
hydrationData
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
return /* @__PURE__ */ React2.createElement(
|
|
260
|
+
return /* @__PURE__ */ React2.createElement(_chunkTGXCWGPTjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkIIA3TUI2js.RouterProvider, { router: routerRef.current }));
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -271,9 +271,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
271
271
|
id: route.id,
|
|
272
272
|
path: route.path,
|
|
273
273
|
index: route.index,
|
|
274
|
-
Component: route.Component ?
|
|
275
|
-
HydrateFallback: route.HydrateFallback ?
|
|
276
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
274
|
+
Component: route.Component ? _chunkIIA3TUI2js.withComponentProps.call(void 0, route.Component) : void 0,
|
|
275
|
+
HydrateFallback: route.HydrateFallback ? _chunkIIA3TUI2js.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
276
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkIIA3TUI2js.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
277
277
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
278
278
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
279
279
|
handle: route.handle,
|
|
@@ -302,7 +302,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
302
302
|
};
|
|
303
303
|
manifest.routes[newRoute.id] = entryRoute;
|
|
304
304
|
routeModules[route.id] = {
|
|
305
|
-
default: newRoute.Component ||
|
|
305
|
+
default: newRoute.Component || _chunkIIA3TUI2js.Outlet,
|
|
306
306
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
307
307
|
handle: route.handle,
|
|
308
308
|
links: route.links,
|
|
@@ -497,7 +497,7 @@ function myUnescape(value) {
|
|
|
497
497
|
return result;
|
|
498
498
|
}
|
|
499
499
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
500
|
-
|
|
500
|
+
_chunkTGXCWGPTjs.warnOnce.call(void 0,
|
|
501
501
|
!expires,
|
|
502
502
|
`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.`
|
|
503
503
|
);
|
|
@@ -551,7 +551,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
551
551
|
let entries = Object.entries(errors);
|
|
552
552
|
let serialized = {};
|
|
553
553
|
for (let [key, val] of entries) {
|
|
554
|
-
if (
|
|
554
|
+
if (_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, val)) {
|
|
555
555
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
556
556
|
} else if (val instanceof Error) {
|
|
557
557
|
let sanitized = sanitizeError(val, serverMode);
|
|
@@ -576,7 +576,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
576
576
|
|
|
577
577
|
// lib/server-runtime/routeMatching.ts
|
|
578
578
|
function matchServerRoutes(routes, pathname, basename) {
|
|
579
|
-
let matches =
|
|
579
|
+
let matches = _chunkTGXCWGPTjs.matchRoutes.call(void 0,
|
|
580
580
|
routes,
|
|
581
581
|
pathname,
|
|
582
582
|
basename
|
|
@@ -596,7 +596,7 @@ async function callRouteHandler(handler, args) {
|
|
|
596
596
|
params: args.params,
|
|
597
597
|
context: args.context
|
|
598
598
|
});
|
|
599
|
-
if (
|
|
599
|
+
if (_chunkTGXCWGPTjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkTGXCWGPTjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
600
600
|
throw new Response(null, result.init);
|
|
601
601
|
}
|
|
602
602
|
return result;
|
|
@@ -715,17 +715,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
715
715
|
controller.close();
|
|
716
716
|
}
|
|
717
717
|
});
|
|
718
|
-
let decoded = await
|
|
718
|
+
let decoded = await _chunkTGXCWGPTjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
719
719
|
let data2 = decoded.value;
|
|
720
|
-
if (data2 &&
|
|
721
|
-
let result = data2[
|
|
720
|
+
if (data2 && _chunkTGXCWGPTjs.SingleFetchRedirectSymbol in data2) {
|
|
721
|
+
let result = data2[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol];
|
|
722
722
|
let init = { status: result.status };
|
|
723
723
|
if (result.reload) {
|
|
724
|
-
throw
|
|
724
|
+
throw _chunkTGXCWGPTjs.redirectDocument.call(void 0, result.redirect, init);
|
|
725
725
|
} else if (result.replace) {
|
|
726
|
-
throw
|
|
726
|
+
throw _chunkTGXCWGPTjs.replace.call(void 0, result.redirect, init);
|
|
727
727
|
} else {
|
|
728
|
-
throw
|
|
728
|
+
throw _chunkTGXCWGPTjs.redirect.call(void 0, result.redirect, init);
|
|
729
729
|
}
|
|
730
730
|
} else {
|
|
731
731
|
invariant2(
|
|
@@ -854,7 +854,7 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
854
854
|
|
|
855
855
|
// lib/server-runtime/single-fetch.ts
|
|
856
856
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
857
|
-
...
|
|
857
|
+
..._chunkTGXCWGPTjs.NO_BODY_STATUS_CODES,
|
|
858
858
|
304
|
|
859
859
|
]);
|
|
860
860
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -884,10 +884,10 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
884
884
|
return handleQueryError(error);
|
|
885
885
|
}
|
|
886
886
|
function handleQueryResult(result) {
|
|
887
|
-
if (!
|
|
887
|
+
if (!_chunkTGXCWGPTjs.isResponse.call(void 0, result)) {
|
|
888
888
|
result = staticContextToResponse(result);
|
|
889
889
|
}
|
|
890
|
-
if (
|
|
890
|
+
if (_chunkTGXCWGPTjs.isRedirectResponse.call(void 0, result)) {
|
|
891
891
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
892
892
|
result: getSingleFetchRedirect(
|
|
893
893
|
result.status,
|
|
@@ -895,7 +895,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
895
895
|
build.basename
|
|
896
896
|
),
|
|
897
897
|
headers: result.headers,
|
|
898
|
-
status:
|
|
898
|
+
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
901
|
return result;
|
|
@@ -910,7 +910,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
910
910
|
}
|
|
911
911
|
function staticContextToResponse(context) {
|
|
912
912
|
let headers = getDocumentHeaders(context, build);
|
|
913
|
-
if (
|
|
913
|
+
if (_chunkTGXCWGPTjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
914
914
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
915
915
|
result: getSingleFetchRedirect(
|
|
916
916
|
context.statusCode,
|
|
@@ -918,12 +918,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
918
918
|
build.basename
|
|
919
919
|
),
|
|
920
920
|
headers,
|
|
921
|
-
status:
|
|
921
|
+
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
922
922
|
});
|
|
923
923
|
}
|
|
924
924
|
if (context.errors) {
|
|
925
925
|
Object.values(context.errors).forEach((err) => {
|
|
926
|
-
if (!
|
|
926
|
+
if (!_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
927
927
|
handleError(err);
|
|
928
928
|
}
|
|
929
929
|
});
|
|
@@ -970,18 +970,18 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
970
970
|
return handleQueryError(error);
|
|
971
971
|
}
|
|
972
972
|
function handleQueryResult(result) {
|
|
973
|
-
let response =
|
|
974
|
-
if (
|
|
973
|
+
let response = _chunkTGXCWGPTjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
974
|
+
if (_chunkTGXCWGPTjs.isRedirectResponse.call(void 0, response)) {
|
|
975
975
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
976
976
|
result: {
|
|
977
|
-
[
|
|
977
|
+
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
978
978
|
response.status,
|
|
979
979
|
response.headers,
|
|
980
980
|
build.basename
|
|
981
981
|
)
|
|
982
982
|
},
|
|
983
983
|
headers: response.headers,
|
|
984
|
-
status:
|
|
984
|
+
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
987
|
return response;
|
|
@@ -996,22 +996,22 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
996
996
|
}
|
|
997
997
|
function staticContextToResponse(context) {
|
|
998
998
|
let headers = getDocumentHeaders(context, build);
|
|
999
|
-
if (
|
|
999
|
+
if (_chunkTGXCWGPTjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1000
1000
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1001
1001
|
result: {
|
|
1002
|
-
[
|
|
1002
|
+
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
1003
1003
|
context.statusCode,
|
|
1004
1004
|
headers,
|
|
1005
1005
|
build.basename
|
|
1006
1006
|
)
|
|
1007
1007
|
},
|
|
1008
1008
|
headers,
|
|
1009
|
-
status:
|
|
1009
|
+
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
if (context.errors) {
|
|
1013
1013
|
Object.values(context.errors).forEach((err) => {
|
|
1014
|
-
if (!
|
|
1014
|
+
if (!_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1015
1015
|
handleError(err);
|
|
1016
1016
|
}
|
|
1017
1017
|
});
|
|
@@ -1068,7 +1068,7 @@ function generateSingleFetchResponse(request, build, serverMode, {
|
|
|
1068
1068
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1069
1069
|
let redirect2 = headers.get("Location");
|
|
1070
1070
|
if (basename) {
|
|
1071
|
-
redirect2 =
|
|
1071
|
+
redirect2 = _chunkTGXCWGPTjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1072
1072
|
}
|
|
1073
1073
|
return {
|
|
1074
1074
|
redirect: redirect2,
|
|
@@ -1094,7 +1094,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1094
1094
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1095
1095
|
);
|
|
1096
1096
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1097
|
-
return
|
|
1097
|
+
return _chunkTGXCWGPTjs.encode.call(void 0, data2, {
|
|
1098
1098
|
signal: controller.signal,
|
|
1099
1099
|
plugins: [
|
|
1100
1100
|
(value) => {
|
|
@@ -1102,12 +1102,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1102
1102
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1103
1103
|
return ["SanitizedError", name, message, stack];
|
|
1104
1104
|
}
|
|
1105
|
-
if (value instanceof
|
|
1105
|
+
if (value instanceof _chunkTGXCWGPTjs.ErrorResponseImpl) {
|
|
1106
1106
|
let { data: data3, status, statusText } = value;
|
|
1107
1107
|
return ["ErrorResponse", data3, status, statusText];
|
|
1108
1108
|
}
|
|
1109
|
-
if (value && typeof value === "object" &&
|
|
1110
|
-
return ["SingleFetchRedirect", value[
|
|
1109
|
+
if (value && typeof value === "object" && _chunkTGXCWGPTjs.SingleFetchRedirectSymbol in value) {
|
|
1110
|
+
return ["SingleFetchRedirect", value[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]];
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
],
|
|
@@ -1130,14 +1130,14 @@ function derive(build, mode) {
|
|
|
1130
1130
|
let routes = createRoutes(build.routes);
|
|
1131
1131
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1132
1132
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1133
|
-
let staticHandler =
|
|
1133
|
+
let staticHandler = _chunkTGXCWGPTjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1134
1134
|
basename: build.basename
|
|
1135
1135
|
});
|
|
1136
1136
|
let errorHandler = build.entry.module.handleError || ((error, { request }) => {
|
|
1137
1137
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1138
1138
|
console.error(
|
|
1139
1139
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1140
|
-
|
|
1140
|
+
_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1141
1141
|
);
|
|
1142
1142
|
}
|
|
1143
1143
|
});
|
|
@@ -1183,36 +1183,36 @@ var createRequestHandler = (build, mode) => {
|
|
|
1183
1183
|
});
|
|
1184
1184
|
};
|
|
1185
1185
|
if (_build.future.unstable_middleware) {
|
|
1186
|
-
if (initialContext && !(initialContext instanceof
|
|
1186
|
+
if (initialContext && !(initialContext instanceof _chunkTGXCWGPTjs.unstable_RouterContextProvider)) {
|
|
1187
1187
|
let error = new Error(
|
|
1188
1188
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `unstable_RouterContextProvider` from your `getLoadContext` function."
|
|
1189
1189
|
);
|
|
1190
1190
|
handleError(error);
|
|
1191
1191
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1192
1192
|
}
|
|
1193
|
-
loadContext = initialContext || new (0,
|
|
1193
|
+
loadContext = initialContext || new (0, _chunkTGXCWGPTjs.unstable_RouterContextProvider)();
|
|
1194
1194
|
} else {
|
|
1195
1195
|
loadContext = initialContext || {};
|
|
1196
1196
|
}
|
|
1197
1197
|
let url = new URL(request.url);
|
|
1198
1198
|
let normalizedBasename = _build.basename || "/";
|
|
1199
1199
|
let normalizedPath = url.pathname;
|
|
1200
|
-
if (
|
|
1200
|
+
if (_chunkTGXCWGPTjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1201
1201
|
normalizedPath = normalizedBasename;
|
|
1202
1202
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1203
1203
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1204
1204
|
}
|
|
1205
|
-
if (
|
|
1205
|
+
if (_chunkTGXCWGPTjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1206
1206
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1207
1207
|
}
|
|
1208
1208
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1209
1209
|
if (!_build.ssr) {
|
|
1210
1210
|
let decodedPath = decodeURI(normalizedPath);
|
|
1211
1211
|
if (normalizedBasename !== "/") {
|
|
1212
|
-
let strippedPath =
|
|
1212
|
+
let strippedPath = _chunkTGXCWGPTjs.stripBasename.call(void 0, decodedPath, normalizedBasename);
|
|
1213
1213
|
if (strippedPath == null) {
|
|
1214
1214
|
errorHandler(
|
|
1215
|
-
new (0,
|
|
1215
|
+
new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(
|
|
1216
1216
|
404,
|
|
1217
1217
|
"Not Found",
|
|
1218
1218
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
@@ -1235,7 +1235,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1235
1235
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
1236
1236
|
if (url.pathname.endsWith(".data")) {
|
|
1237
1237
|
errorHandler(
|
|
1238
|
-
new (0,
|
|
1238
|
+
new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(
|
|
1239
1239
|
404,
|
|
1240
1240
|
"Not Found",
|
|
1241
1241
|
`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.`
|
|
@@ -1255,7 +1255,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
let manifestUrl =
|
|
1258
|
+
let manifestUrl = _chunkTGXCWGPTjs.getManifestPath.call(void 0,
|
|
1259
1259
|
_build.routeDiscovery.manifestPath,
|
|
1260
1260
|
normalizedBasename
|
|
1261
1261
|
);
|
|
@@ -1296,7 +1296,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1296
1296
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1297
1297
|
request
|
|
1298
1298
|
});
|
|
1299
|
-
if (
|
|
1299
|
+
if (_chunkTGXCWGPTjs.isRedirectResponse.call(void 0, response)) {
|
|
1300
1300
|
let result = getSingleFetchRedirect(
|
|
1301
1301
|
response.status,
|
|
1302
1302
|
response.headers,
|
|
@@ -1304,7 +1304,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1304
1304
|
);
|
|
1305
1305
|
if (request.method === "GET") {
|
|
1306
1306
|
result = {
|
|
1307
|
-
[
|
|
1307
|
+
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: result
|
|
1308
1308
|
};
|
|
1309
1309
|
}
|
|
1310
1310
|
let headers = new Headers(response.headers);
|
|
@@ -1317,7 +1317,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1317
1317
|
serverMode
|
|
1318
1318
|
),
|
|
1319
1319
|
{
|
|
1320
|
-
status:
|
|
1320
|
+
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS,
|
|
1321
1321
|
headers
|
|
1322
1322
|
}
|
|
1323
1323
|
);
|
|
@@ -1431,7 +1431,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1431
1431
|
unstable_generateMiddlewareResponse: build.future.unstable_middleware ? async (query) => {
|
|
1432
1432
|
try {
|
|
1433
1433
|
let innerResult = await query(request);
|
|
1434
|
-
if (!
|
|
1434
|
+
if (!_chunkTGXCWGPTjs.isResponse.call(void 0, innerResult)) {
|
|
1435
1435
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1436
1436
|
}
|
|
1437
1437
|
return innerResult;
|
|
@@ -1441,7 +1441,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1441
1441
|
}
|
|
1442
1442
|
} : void 0
|
|
1443
1443
|
});
|
|
1444
|
-
if (!
|
|
1444
|
+
if (!_chunkTGXCWGPTjs.isResponse.call(void 0, result)) {
|
|
1445
1445
|
result = await renderHtml(result, isSpaMode);
|
|
1446
1446
|
}
|
|
1447
1447
|
return result;
|
|
@@ -1456,7 +1456,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1456
1456
|
}
|
|
1457
1457
|
if (context.errors) {
|
|
1458
1458
|
Object.values(context.errors).forEach((err) => {
|
|
1459
|
-
if (!
|
|
1459
|
+
if (!_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1460
1460
|
handleError(err);
|
|
1461
1461
|
}
|
|
1462
1462
|
});
|
|
@@ -1508,10 +1508,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1508
1508
|
} catch (error) {
|
|
1509
1509
|
handleError(error);
|
|
1510
1510
|
let errorForSecondRender = error;
|
|
1511
|
-
if (
|
|
1511
|
+
if (_chunkTGXCWGPTjs.isResponse.call(void 0, error)) {
|
|
1512
1512
|
try {
|
|
1513
1513
|
let data2 = await unwrapResponse(error);
|
|
1514
|
-
errorForSecondRender = new (0,
|
|
1514
|
+
errorForSecondRender = new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(
|
|
1515
1515
|
error.status,
|
|
1516
1516
|
error.statusText,
|
|
1517
1517
|
data2
|
|
@@ -1519,7 +1519,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1519
1519
|
} catch (e) {
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
|
-
context =
|
|
1522
|
+
context = _chunkTGXCWGPTjs.getStaticContextFromError.call(void 0,
|
|
1523
1523
|
staticHandler.dataRoutes,
|
|
1524
1524
|
context,
|
|
1525
1525
|
errorForSecondRender
|
|
@@ -1578,7 +1578,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1578
1578
|
return handleQueryRouteError(error);
|
|
1579
1579
|
}
|
|
1580
1580
|
function handleQueryRouteResult(result) {
|
|
1581
|
-
if (
|
|
1581
|
+
if (_chunkTGXCWGPTjs.isResponse.call(void 0, result)) {
|
|
1582
1582
|
return result;
|
|
1583
1583
|
}
|
|
1584
1584
|
if (typeof result === "string") {
|
|
@@ -1587,11 +1587,11 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1587
1587
|
return Response.json(result);
|
|
1588
1588
|
}
|
|
1589
1589
|
function handleQueryRouteError(error) {
|
|
1590
|
-
if (
|
|
1590
|
+
if (_chunkTGXCWGPTjs.isResponse.call(void 0, error)) {
|
|
1591
1591
|
error.headers.set("X-Remix-Catch", "yes");
|
|
1592
1592
|
return error;
|
|
1593
1593
|
}
|
|
1594
|
-
if (
|
|
1594
|
+
if (_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1595
1595
|
handleError(error);
|
|
1596
1596
|
return errorResponseToJson(error, serverMode);
|
|
1597
1597
|
}
|
|
@@ -1717,7 +1717,7 @@ function createSessionStorage({
|
|
|
1717
1717
|
};
|
|
1718
1718
|
}
|
|
1719
1719
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1720
|
-
|
|
1720
|
+
_chunkTGXCWGPTjs.warnOnce.call(void 0,
|
|
1721
1721
|
cookie.isSigned,
|
|
1722
1722
|
`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.`
|
|
1723
1723
|
);
|
|
@@ -1812,12 +1812,12 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
|
|
|
1812
1812
|
...state,
|
|
1813
1813
|
loaderData: { ...state.loaderData }
|
|
1814
1814
|
};
|
|
1815
|
-
let initialMatches =
|
|
1815
|
+
let initialMatches = _chunkTGXCWGPTjs.matchRoutes.call(void 0, routes, location2, basename);
|
|
1816
1816
|
if (initialMatches) {
|
|
1817
1817
|
for (let match of initialMatches) {
|
|
1818
1818
|
let routeId = match.route.id;
|
|
1819
1819
|
let routeInfo = getRouteInfo(routeId);
|
|
1820
|
-
if (
|
|
1820
|
+
if (_chunkTGXCWGPTjs.shouldHydrateRouteLoader.call(void 0,
|
|
1821
1821
|
routeId,
|
|
1822
1822
|
routeInfo.clientLoader,
|
|
1823
1823
|
routeInfo.hasLoader,
|
|
@@ -1895,7 +1895,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
1897
|
);
|
|
1898
|
-
if (
|
|
1898
|
+
if (_chunkTGXCWGPTjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1899
1899
|
return /* @__PURE__ */ React.default.createElement(
|
|
1900
1900
|
ErrorWrapper,
|
|
1901
1901
|
{
|
|
@@ -1903,7 +1903,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1903
1903
|
title: "Unhandled Thrown Response!"
|
|
1904
1904
|
},
|
|
1905
1905
|
/* @__PURE__ */ React.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
1906
|
-
|
|
1906
|
+
_chunkTGXCWGPTjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
1907
1907
|
);
|
|
1908
1908
|
}
|
|
1909
1909
|
let errorInstance;
|
|
@@ -1929,7 +1929,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1929
1929
|
function RSCDefaultRootErrorBoundary({
|
|
1930
1930
|
hasRootLayout
|
|
1931
1931
|
}) {
|
|
1932
|
-
let error =
|
|
1932
|
+
let error = _chunkTGXCWGPTjs.useRouteError.call(void 0, );
|
|
1933
1933
|
if (hasRootLayout === void 0) {
|
|
1934
1934
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
1935
1935
|
}
|
|
@@ -2073,7 +2073,7 @@ function createRouterFromPayload({
|
|
|
2073
2073
|
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
|
2074
2074
|
let patches = /* @__PURE__ */ new Map();
|
|
2075
2075
|
_optionalChain([payload, 'access', _20 => _20.patches, 'optionalAccess', _21 => _21.forEach, 'call', _22 => _22((patch) => {
|
|
2076
|
-
|
|
2076
|
+
_chunkTGXCWGPTjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
2077
2077
|
if (!patches.has(patch.parentId)) {
|
|
2078
2078
|
patches.set(patch.parentId, []);
|
|
2079
2079
|
}
|
|
@@ -2095,11 +2095,11 @@ function createRouterFromPayload({
|
|
|
2095
2095
|
}
|
|
2096
2096
|
return [route];
|
|
2097
2097
|
}, []);
|
|
2098
|
-
globalVar.__reactRouterDataRouter =
|
|
2098
|
+
globalVar.__reactRouterDataRouter = _chunkTGXCWGPTjs.createRouter.call(void 0, {
|
|
2099
2099
|
routes,
|
|
2100
2100
|
unstable_getContext,
|
|
2101
2101
|
basename: payload.basename,
|
|
2102
|
-
history:
|
|
2102
|
+
history: _chunkTGXCWGPTjs.createBrowserHistory.call(void 0, ),
|
|
2103
2103
|
hydrationData: getHydrationData(
|
|
2104
2104
|
{
|
|
2105
2105
|
loaderData: payload.loaderData,
|
|
@@ -2109,7 +2109,7 @@ function createRouterFromPayload({
|
|
|
2109
2109
|
routes,
|
|
2110
2110
|
(routeId) => {
|
|
2111
2111
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
2112
|
-
|
|
2112
|
+
_chunkTGXCWGPTjs.invariant.call(void 0, match, "Route not found in payload");
|
|
2113
2113
|
return {
|
|
2114
2114
|
clientLoader: match.clientLoader,
|
|
2115
2115
|
hasLoader: match.hasLoader,
|
|
@@ -2207,9 +2207,9 @@ function createRouterFromPayload({
|
|
|
2207
2207
|
routeModules: globalVar.__reactRouterRouteModules
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
|
-
var renderedRoutesContext =
|
|
2210
|
+
var renderedRoutesContext = _chunkTGXCWGPTjs.unstable_createContext.call(void 0, );
|
|
2211
2211
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
2212
|
-
let dataStrategy =
|
|
2212
|
+
let dataStrategy = _chunkTGXCWGPTjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
2213
2213
|
getRouter,
|
|
2214
2214
|
(match) => {
|
|
2215
2215
|
let M = match;
|
|
@@ -2263,20 +2263,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2263
2263
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
2264
2264
|
return async (args, basename, targetRoutes) => {
|
|
2265
2265
|
let { request, context } = args;
|
|
2266
|
-
let url =
|
|
2266
|
+
let url = _chunkTGXCWGPTjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
2267
2267
|
if (request.method === "GET") {
|
|
2268
|
-
url =
|
|
2268
|
+
url = _chunkTGXCWGPTjs.stripIndexParam.call(void 0, url);
|
|
2269
2269
|
if (targetRoutes) {
|
|
2270
2270
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
2271
2271
|
}
|
|
2272
2272
|
}
|
|
2273
2273
|
let res = await fetchImplementation(
|
|
2274
|
-
new Request(url, await
|
|
2274
|
+
new Request(url, await _chunkTGXCWGPTjs.createRequestInit.call(void 0, request))
|
|
2275
2275
|
);
|
|
2276
2276
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
2277
|
-
throw new (0,
|
|
2277
|
+
throw new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(404, "Not Found", true);
|
|
2278
2278
|
}
|
|
2279
|
-
|
|
2279
|
+
_chunkTGXCWGPTjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
2280
2280
|
try {
|
|
2281
2281
|
const payload = await createFromReadableStream(res.body, {
|
|
2282
2282
|
temporaryReferences: void 0
|
|
@@ -2300,7 +2300,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
2300
2300
|
}
|
|
2301
2301
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
2302
2302
|
let results = { routes: {} };
|
|
2303
|
-
const dataKey =
|
|
2303
|
+
const dataKey = _chunkTGXCWGPTjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
2304
2304
|
for (let [routeId, data2] of Object.entries(payload[dataKey] || {})) {
|
|
2305
2305
|
results.routes[routeId] = { data: data2 };
|
|
2306
2306
|
}
|
|
@@ -2338,7 +2338,7 @@ function RSCHydratedRouter({
|
|
|
2338
2338
|
]
|
|
2339
2339
|
);
|
|
2340
2340
|
React4.useEffect(() => {
|
|
2341
|
-
|
|
2341
|
+
_chunkTGXCWGPTjs.setIsHydrated.call(void 0, );
|
|
2342
2342
|
}, []);
|
|
2343
2343
|
React4.useLayoutEffect(() => {
|
|
2344
2344
|
const globalVar = window;
|
|
@@ -2425,7 +2425,7 @@ function RSCHydratedRouter({
|
|
|
2425
2425
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2426
2426
|
routeModules
|
|
2427
2427
|
};
|
|
2428
|
-
return /* @__PURE__ */ React4.createElement(
|
|
2428
|
+
return /* @__PURE__ */ React4.createElement(_chunkTGXCWGPTjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(_chunkTGXCWGPTjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(_chunkIIA3TUI2js.RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2429
2429
|
}
|
|
2430
2430
|
function createRouteFromServerManifest(match, payload) {
|
|
2431
2431
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -2436,7 +2436,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2436
2436
|
// the server loader flow regardless of whether the client loader calls
|
|
2437
2437
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
2438
2438
|
match.hasComponent && !match.element;
|
|
2439
|
-
|
|
2439
|
+
_chunkTGXCWGPTjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
2440
2440
|
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
|
2441
2441
|
let dataRoute = {
|
|
2442
2442
|
id: match.id,
|
|
@@ -2487,7 +2487,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2487
2487
|
return await callSingleFetch(singleFetch);
|
|
2488
2488
|
}
|
|
2489
2489
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
2490
|
-
throw
|
|
2490
|
+
throw _chunkTGXCWGPTjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
2491
2491
|
},
|
|
2492
2492
|
path: match.path,
|
|
2493
2493
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -2500,7 +2500,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2500
2500
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
2501
2501
|
};
|
|
2502
2502
|
if (typeof dataRoute.loader === "function") {
|
|
2503
|
-
dataRoute.loader.hydrate =
|
|
2503
|
+
dataRoute.loader.hydrate = _chunkTGXCWGPTjs.shouldHydrateRouteLoader.call(void 0,
|
|
2504
2504
|
match.id,
|
|
2505
2505
|
match.clientLoader,
|
|
2506
2506
|
match.hasLoader,
|
|
@@ -2510,7 +2510,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2510
2510
|
return dataRoute;
|
|
2511
2511
|
}
|
|
2512
2512
|
function callSingleFetch(singleFetch) {
|
|
2513
|
-
|
|
2513
|
+
_chunkTGXCWGPTjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
2514
2514
|
return singleFetch();
|
|
2515
2515
|
}
|
|
2516
2516
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -2518,7 +2518,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
2518
2518
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
2519
2519
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
2520
2520
|
console.error(msg);
|
|
2521
|
-
throw new (0,
|
|
2521
|
+
throw new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
2522
2522
|
}
|
|
2523
2523
|
}
|
|
2524
2524
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -2713,7 +2713,7 @@ async function routeRSCServerRequest({
|
|
|
2713
2713
|
};
|
|
2714
2714
|
try {
|
|
2715
2715
|
const payload = await getPayload();
|
|
2716
|
-
if (serverResponse.status ===
|
|
2716
|
+
if (serverResponse.status === _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2717
2717
|
const headers2 = new Headers(serverResponse.headers);
|
|
2718
2718
|
headers2.delete("Content-Encoding");
|
|
2719
2719
|
headers2.delete("Content-Length");
|
|
@@ -2763,7 +2763,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2763
2763
|
if (payload.type !== "render") return null;
|
|
2764
2764
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2765
2765
|
for (const match of payload.matches) {
|
|
2766
|
-
if (
|
|
2766
|
+
if (_chunkTGXCWGPTjs.shouldHydrateRouteLoader.call(void 0,
|
|
2767
2767
|
match.id,
|
|
2768
2768
|
match.clientLoader,
|
|
2769
2769
|
match.hasLoader,
|
|
@@ -2797,7 +2797,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2797
2797
|
}
|
|
2798
2798
|
}))
|
|
2799
2799
|
};
|
|
2800
|
-
const router =
|
|
2800
|
+
const router = _chunkIIA3TUI2js.createStaticRouter.call(void 0,
|
|
2801
2801
|
payload.matches.reduceRight((previous, match) => {
|
|
2802
2802
|
const route = {
|
|
2803
2803
|
id: match.id,
|
|
@@ -2841,8 +2841,8 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2841
2841
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2842
2842
|
routeModules: createRSCRouteModules(payload)
|
|
2843
2843
|
};
|
|
2844
|
-
return /* @__PURE__ */ React5.createElement(
|
|
2845
|
-
|
|
2844
|
+
return /* @__PURE__ */ React5.createElement(_chunkTGXCWGPTjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(_chunkTGXCWGPTjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2845
|
+
_chunkIIA3TUI2js.StaticRouterProvider,
|
|
2846
2846
|
{
|
|
2847
2847
|
context,
|
|
2848
2848
|
router,
|
|
@@ -2900,7 +2900,7 @@ function deserializeErrors(errors) {
|
|
|
2900
2900
|
let serialized = {};
|
|
2901
2901
|
for (let [key, val] of entries) {
|
|
2902
2902
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2903
|
-
serialized[key] = new (0,
|
|
2903
|
+
serialized[key] = new (0, _chunkTGXCWGPTjs.ErrorResponseImpl)(
|
|
2904
2904
|
val.status,
|
|
2905
2905
|
val.statusText,
|
|
2906
2906
|
val.data,
|
|
@@ -3058,4 +3058,4 @@ function deserializeErrors(errors) {
|
|
|
3058
3058
|
|
|
3059
3059
|
|
|
3060
3060
|
|
|
3061
|
-
exports.Await =
|
|
3061
|
+
exports.Await = _chunkIIA3TUI2js.Await; exports.BrowserRouter = _chunkIIA3TUI2js.BrowserRouter; exports.Form = _chunkIIA3TUI2js.Form; exports.HashRouter = _chunkIIA3TUI2js.HashRouter; exports.IDLE_BLOCKER = _chunkTGXCWGPTjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkTGXCWGPTjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkTGXCWGPTjs.IDLE_NAVIGATION; exports.Link = _chunkIIA3TUI2js.Link; exports.Links = _chunkTGXCWGPTjs.Links; exports.MemoryRouter = _chunkIIA3TUI2js.MemoryRouter; exports.Meta = _chunkTGXCWGPTjs.Meta; exports.NavLink = _chunkIIA3TUI2js.NavLink; exports.Navigate = _chunkIIA3TUI2js.Navigate; exports.NavigationType = _chunkTGXCWGPTjs.Action; exports.Outlet = _chunkIIA3TUI2js.Outlet; exports.PrefetchPageLinks = _chunkTGXCWGPTjs.PrefetchPageLinks; exports.Route = _chunkIIA3TUI2js.Route; exports.Router = _chunkIIA3TUI2js.Router; exports.RouterProvider = _chunkIIA3TUI2js.RouterProvider; exports.Routes = _chunkIIA3TUI2js.Routes; exports.Scripts = _chunkTGXCWGPTjs.Scripts; exports.ScrollRestoration = _chunkIIA3TUI2js.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunkIIA3TUI2js.StaticRouter; exports.StaticRouterProvider = _chunkIIA3TUI2js.StaticRouterProvider; exports.UNSAFE_DataRouterContext = _chunkTGXCWGPTjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkTGXCWGPTjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkTGXCWGPTjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkTGXCWGPTjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkTGXCWGPTjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkTGXCWGPTjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkTGXCWGPTjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkTGXCWGPTjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkTGXCWGPTjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkTGXCWGPTjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkTGXCWGPTjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkIIA3TUI2js.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkIIA3TUI2js.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkIIA3TUI2js.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkTGXCWGPTjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkTGXCWGPTjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkTGXCWGPTjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunkTGXCWGPTjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkTGXCWGPTjs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkTGXCWGPTjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkTGXCWGPTjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkIIA3TUI2js.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkTGXCWGPTjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkIIA3TUI2js.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkTGXCWGPTjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkTGXCWGPTjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunkIIA3TUI2js.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkIIA3TUI2js.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkIIA3TUI2js.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkIIA3TUI2js.withHydrateFallbackProps; exports.createBrowserRouter = _chunkIIA3TUI2js.createBrowserRouter; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunkIIA3TUI2js.createHashRouter; exports.createMemoryRouter = _chunkIIA3TUI2js.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkTGXCWGPTjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkIIA3TUI2js.createRoutesFromChildren; exports.createRoutesFromElements = _chunkIIA3TUI2js.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunkIIA3TUI2js.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunkIIA3TUI2js.createStaticHandler; exports.createStaticRouter = _chunkIIA3TUI2js.createStaticRouter; exports.data = _chunkTGXCWGPTjs.data; exports.generatePath = _chunkTGXCWGPTjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkTGXCWGPTjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkTGXCWGPTjs.matchPath; exports.matchRoutes = _chunkTGXCWGPTjs.matchRoutes; exports.parsePath = _chunkTGXCWGPTjs.parsePath; exports.redirect = _chunkTGXCWGPTjs.redirect; exports.redirectDocument = _chunkTGXCWGPTjs.redirectDocument; exports.renderMatches = _chunkIIA3TUI2js.renderMatches; exports.replace = _chunkTGXCWGPTjs.replace; exports.resolvePath = _chunkTGXCWGPTjs.resolvePath; exports.unstable_HistoryRouter = _chunkIIA3TUI2js.HistoryRouter; exports.unstable_RSCHydratedRouter = RSCHydratedRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_RouterContextProvider = _chunkTGXCWGPTjs.unstable_RouterContextProvider; exports.unstable_createCallServer = createCallServer; exports.unstable_createContext = _chunkTGXCWGPTjs.unstable_createContext; exports.unstable_getRSCStream = getRSCStream; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunkIIA3TUI2js.usePrompt; exports.useActionData = _chunkTGXCWGPTjs.useActionData; exports.useAsyncError = _chunkTGXCWGPTjs.useAsyncError; exports.useAsyncValue = _chunkTGXCWGPTjs.useAsyncValue; exports.useBeforeUnload = _chunkIIA3TUI2js.useBeforeUnload; exports.useBlocker = _chunkTGXCWGPTjs.useBlocker; exports.useFetcher = _chunkIIA3TUI2js.useFetcher; exports.useFetchers = _chunkIIA3TUI2js.useFetchers; exports.useFormAction = _chunkIIA3TUI2js.useFormAction; exports.useHref = _chunkTGXCWGPTjs.useHref; exports.useInRouterContext = _chunkTGXCWGPTjs.useInRouterContext; exports.useLinkClickHandler = _chunkIIA3TUI2js.useLinkClickHandler; exports.useLoaderData = _chunkTGXCWGPTjs.useLoaderData; exports.useLocation = _chunkTGXCWGPTjs.useLocation; exports.useMatch = _chunkTGXCWGPTjs.useMatch; exports.useMatches = _chunkTGXCWGPTjs.useMatches; exports.useNavigate = _chunkTGXCWGPTjs.useNavigate; exports.useNavigation = _chunkTGXCWGPTjs.useNavigation; exports.useNavigationType = _chunkTGXCWGPTjs.useNavigationType; exports.useOutlet = _chunkTGXCWGPTjs.useOutlet; exports.useOutletContext = _chunkTGXCWGPTjs.useOutletContext; exports.useParams = _chunkTGXCWGPTjs.useParams; exports.useResolvedPath = _chunkTGXCWGPTjs.useResolvedPath; exports.useRevalidator = _chunkTGXCWGPTjs.useRevalidator; exports.useRouteError = _chunkTGXCWGPTjs.useRouteError; exports.useRouteLoaderData = _chunkTGXCWGPTjs.useRouteLoaderData; exports.useRoutes = _chunkTGXCWGPTjs.useRoutes; exports.useSearchParams = _chunkIIA3TUI2js.useSearchParams; exports.useSubmit = _chunkIIA3TUI2js.useSubmit; exports.useViewTransitionState = _chunkIIA3TUI2js.useViewTransitionState;
|