react-router 7.8.1 → 7.8.2-pre.0
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 +12 -0
- package/dist/development/{chunk-UH6JLGW7.mjs → chunk-5LNVHL6T.mjs} +185 -201
- package/dist/development/{chunk-TGXCWGPT.js → chunk-KUJAVZYD.js} +123 -180
- package/dist/development/{chunk-IFMMFE4R.mjs → chunk-RVSOEW4N.mjs} +34 -75
- package/dist/development/{chunk-IIA3TUI2.js → chunk-UMVNFWBW.js} +210 -169
- package/dist/development/{context-DohQKLID.d.mts → context-D5hQ2yCL.d.mts} +843 -6
- package/dist/development/dom-export.d.mts +20 -2
- package/dist/development/dom-export.d.ts +20 -1
- package/dist/development/dom-export.js +10 -4
- package/dist/development/dom-export.mjs +10 -4
- package/dist/{production/index-react-server-client-BQ6FxdA_.d.ts → development/index-react-server-client-C4AMmMi3.d.ts} +6 -816
- package/dist/{production/index-react-server-client-11fLy3qB.d.mts → development/index-react-server-client-DgVbd8DS.d.mts} +2 -3
- package/dist/development/index-react-server-client.d.mts +3 -4
- package/dist/development/index-react-server-client.d.ts +2 -2
- 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.d.mts +1 -1
- package/dist/development/index-react-server.d.ts +1 -1
- package/dist/development/index-react-server.js +39 -45
- package/dist/development/index-react-server.mjs +39 -45
- package/dist/development/index.d.mts +7 -9
- package/dist/development/index.d.ts +5 -5
- package/dist/development/index.js +122 -163
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +3 -3
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-CNjObrhZ.d.mts → route-data-B3sNokxM.d.mts} +2 -2
- package/dist/development/{routeModules-C3oqzPpI.d.ts → routeModules-DRWHoPcT.d.ts} +844 -7
- package/dist/production/{chunk-YMYXECPK.js → chunk-3PSRBVDP.js} +210 -169
- package/dist/production/{chunk-5Y7ELDIJ.mjs → chunk-4HHN5NDL.mjs} +34 -75
- package/dist/production/{chunk-KHPQXKYM.js → chunk-NCRSBAFG.js} +123 -180
- package/dist/production/{chunk-PFDCNQUK.mjs → chunk-O46NJYOA.mjs} +185 -201
- package/dist/production/{context-DohQKLID.d.mts → context-D5hQ2yCL.d.mts} +843 -6
- package/dist/production/dom-export.d.mts +20 -2
- package/dist/production/dom-export.d.ts +20 -1
- package/dist/production/dom-export.js +10 -4
- package/dist/production/dom-export.mjs +10 -4
- package/dist/{development/index-react-server-client-BQ6FxdA_.d.ts → production/index-react-server-client-C4AMmMi3.d.ts} +6 -816
- package/dist/{development/index-react-server-client-11fLy3qB.d.mts → production/index-react-server-client-DgVbd8DS.d.mts} +2 -3
- package/dist/production/index-react-server-client.d.mts +3 -4
- package/dist/production/index-react-server-client.d.ts +2 -2
- 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.d.mts +1 -1
- package/dist/production/index-react-server.d.ts +1 -1
- package/dist/production/index-react-server.js +39 -45
- package/dist/production/index-react-server.mjs +39 -45
- package/dist/production/index.d.mts +7 -9
- package/dist/production/index.d.ts +5 -5
- package/dist/production/index.js +122 -163
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +3 -3
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-CNjObrhZ.d.mts → route-data-B3sNokxM.d.mts} +2 -2
- package/dist/production/{routeModules-C3oqzPpI.d.ts → routeModules-DRWHoPcT.d.ts} +844 -7
- package/package.json +1 -1
- package/dist/development/components-CuPfnyiZ.d.mts +0 -814
- package/dist/production/components-CuPfnyiZ.d.mts +0 -814
|
@@ -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.
|
|
2
|
+
* react-router v7.8.2-pre.0
|
|
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 _chunkUMVNFWBWjs = require('./chunk-UMVNFWBW.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -143,7 +143,7 @@ var _chunkIIA3TUI2js = require('./chunk-IIA3TUI2.js');
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
var
|
|
146
|
+
var _chunkKUJAVZYDjs = require('./chunk-KUJAVZYD.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 = _chunkKUJAVZYDjs.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 && _chunkKUJAVZYDjs.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 = _chunkUMVNFWBWjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
182
182
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
183
|
-
|
|
183
|
+
_chunkKUJAVZYDjs.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(_chunkKUJAVZYDjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
199
|
+
_chunkUMVNFWBWjs.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
|
+
_chunkKUJAVZYDjs.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
|
+
_chunkKUJAVZYDjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
250
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.unstable_middleware]) ? new (0, _chunkKUJAVZYDjs.unstable_RouterContextProvider)() : {},
|
|
251
251
|
frameworkContextRef.current.manifest,
|
|
252
252
|
frameworkContextRef.current.routeModules
|
|
253
253
|
);
|
|
254
|
-
routerRef.current =
|
|
254
|
+
routerRef.current = _chunkUMVNFWBWjs.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(_chunkKUJAVZYDjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkUMVNFWBWjs.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 ? _chunkUMVNFWBWjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
275
|
+
HydrateFallback: route.HydrateFallback ? _chunkUMVNFWBWjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
276
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkUMVNFWBWjs.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 || _chunkUMVNFWBWjs.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
|
+
_chunkKUJAVZYDjs.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 (_chunkKUJAVZYDjs.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 = _chunkKUJAVZYDjs.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 (_chunkKUJAVZYDjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkKUJAVZYDjs.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 _chunkKUJAVZYDjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
719
719
|
let data2 = decoded.value;
|
|
720
|
-
if (data2 &&
|
|
721
|
-
let result = data2[
|
|
720
|
+
if (data2 && _chunkKUJAVZYDjs.SingleFetchRedirectSymbol in data2) {
|
|
721
|
+
let result = data2[_chunkKUJAVZYDjs.SingleFetchRedirectSymbol];
|
|
722
722
|
let init = { status: result.status };
|
|
723
723
|
if (result.reload) {
|
|
724
|
-
throw
|
|
724
|
+
throw _chunkKUJAVZYDjs.redirectDocument.call(void 0, result.redirect, init);
|
|
725
725
|
} else if (result.replace) {
|
|
726
|
-
throw
|
|
726
|
+
throw _chunkKUJAVZYDjs.replace.call(void 0, result.redirect, init);
|
|
727
727
|
} else {
|
|
728
|
-
throw
|
|
728
|
+
throw _chunkKUJAVZYDjs.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
|
+
..._chunkKUJAVZYDjs.NO_BODY_STATUS_CODES,
|
|
858
858
|
304
|
|
859
859
|
]);
|
|
860
860
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -884,21 +884,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
884
884
|
return handleQueryError(error);
|
|
885
885
|
}
|
|
886
886
|
function handleQueryResult(result) {
|
|
887
|
-
|
|
888
|
-
result = staticContextToResponse(result);
|
|
889
|
-
}
|
|
890
|
-
if (_chunkTGXCWGPTjs.isRedirectResponse.call(void 0, result)) {
|
|
891
|
-
return generateSingleFetchResponse(request, build, serverMode, {
|
|
892
|
-
result: getSingleFetchRedirect(
|
|
893
|
-
result.status,
|
|
894
|
-
result.headers,
|
|
895
|
-
build.basename
|
|
896
|
-
),
|
|
897
|
-
headers: result.headers,
|
|
898
|
-
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
return result;
|
|
887
|
+
return _chunkKUJAVZYDjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
902
888
|
}
|
|
903
889
|
function handleQueryError(error) {
|
|
904
890
|
handleError(error);
|
|
@@ -910,20 +896,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
910
896
|
}
|
|
911
897
|
function staticContextToResponse(context) {
|
|
912
898
|
let headers = getDocumentHeaders(context, build);
|
|
913
|
-
if (
|
|
914
|
-
return
|
|
915
|
-
result: getSingleFetchRedirect(
|
|
916
|
-
context.statusCode,
|
|
917
|
-
headers,
|
|
918
|
-
build.basename
|
|
919
|
-
),
|
|
920
|
-
headers,
|
|
921
|
-
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
922
|
-
});
|
|
899
|
+
if (_chunkKUJAVZYDjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
900
|
+
return new Response(null, { status: context.statusCode, headers });
|
|
923
901
|
}
|
|
924
902
|
if (context.errors) {
|
|
925
903
|
Object.values(context.errors).forEach((err) => {
|
|
926
|
-
if (!
|
|
904
|
+
if (!_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
927
905
|
handleError(err);
|
|
928
906
|
}
|
|
929
907
|
});
|
|
@@ -970,21 +948,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
970
948
|
return handleQueryError(error);
|
|
971
949
|
}
|
|
972
950
|
function handleQueryResult(result) {
|
|
973
|
-
|
|
974
|
-
if (_chunkTGXCWGPTjs.isRedirectResponse.call(void 0, response)) {
|
|
975
|
-
return generateSingleFetchResponse(request, build, serverMode, {
|
|
976
|
-
result: {
|
|
977
|
-
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
978
|
-
response.status,
|
|
979
|
-
response.headers,
|
|
980
|
-
build.basename
|
|
981
|
-
)
|
|
982
|
-
},
|
|
983
|
-
headers: response.headers,
|
|
984
|
-
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
return response;
|
|
951
|
+
return _chunkKUJAVZYDjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
988
952
|
}
|
|
989
953
|
function handleQueryError(error) {
|
|
990
954
|
handleError(error);
|
|
@@ -996,22 +960,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
996
960
|
}
|
|
997
961
|
function staticContextToResponse(context) {
|
|
998
962
|
let headers = getDocumentHeaders(context, build);
|
|
999
|
-
if (
|
|
1000
|
-
return
|
|
1001
|
-
result: {
|
|
1002
|
-
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
1003
|
-
context.statusCode,
|
|
1004
|
-
headers,
|
|
1005
|
-
build.basename
|
|
1006
|
-
)
|
|
1007
|
-
},
|
|
1008
|
-
headers,
|
|
1009
|
-
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1010
|
-
});
|
|
963
|
+
if (_chunkKUJAVZYDjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
964
|
+
return new Response(null, { status: context.statusCode, headers });
|
|
1011
965
|
}
|
|
1012
966
|
if (context.errors) {
|
|
1013
967
|
Object.values(context.errors).forEach((err) => {
|
|
1014
|
-
if (!
|
|
968
|
+
if (!_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1015
969
|
handleError(err);
|
|
1016
970
|
}
|
|
1017
971
|
});
|
|
@@ -1065,10 +1019,25 @@ function generateSingleFetchResponse(request, build, serverMode, {
|
|
|
1065
1019
|
}
|
|
1066
1020
|
);
|
|
1067
1021
|
}
|
|
1022
|
+
function generateSingleFetchRedirectResponse(redirectResponse, request, build, serverMode) {
|
|
1023
|
+
let redirect2 = getSingleFetchRedirect(
|
|
1024
|
+
redirectResponse.status,
|
|
1025
|
+
redirectResponse.headers,
|
|
1026
|
+
build.basename
|
|
1027
|
+
);
|
|
1028
|
+
let headers = new Headers(redirectResponse.headers);
|
|
1029
|
+
headers.delete("Location");
|
|
1030
|
+
headers.set("Content-Type", "text/x-script");
|
|
1031
|
+
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1032
|
+
result: request.method === "GET" ? { [_chunkKUJAVZYDjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1033
|
+
headers,
|
|
1034
|
+
status: _chunkKUJAVZYDjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1068
1037
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1069
1038
|
let redirect2 = headers.get("Location");
|
|
1070
1039
|
if (basename) {
|
|
1071
|
-
redirect2 =
|
|
1040
|
+
redirect2 = _chunkKUJAVZYDjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1072
1041
|
}
|
|
1073
1042
|
return {
|
|
1074
1043
|
redirect: redirect2,
|
|
@@ -1094,7 +1063,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1094
1063
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1095
1064
|
);
|
|
1096
1065
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1097
|
-
return
|
|
1066
|
+
return _chunkKUJAVZYDjs.encode.call(void 0, data2, {
|
|
1098
1067
|
signal: controller.signal,
|
|
1099
1068
|
plugins: [
|
|
1100
1069
|
(value) => {
|
|
@@ -1102,12 +1071,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1102
1071
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1103
1072
|
return ["SanitizedError", name, message, stack];
|
|
1104
1073
|
}
|
|
1105
|
-
if (value instanceof
|
|
1074
|
+
if (value instanceof _chunkKUJAVZYDjs.ErrorResponseImpl) {
|
|
1106
1075
|
let { data: data3, status, statusText } = value;
|
|
1107
1076
|
return ["ErrorResponse", data3, status, statusText];
|
|
1108
1077
|
}
|
|
1109
|
-
if (value && typeof value === "object" &&
|
|
1110
|
-
return ["SingleFetchRedirect", value[
|
|
1078
|
+
if (value && typeof value === "object" && _chunkKUJAVZYDjs.SingleFetchRedirectSymbol in value) {
|
|
1079
|
+
return ["SingleFetchRedirect", value[_chunkKUJAVZYDjs.SingleFetchRedirectSymbol]];
|
|
1111
1080
|
}
|
|
1112
1081
|
}
|
|
1113
1082
|
],
|
|
@@ -1130,14 +1099,14 @@ function derive(build, mode) {
|
|
|
1130
1099
|
let routes = createRoutes(build.routes);
|
|
1131
1100
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1132
1101
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1133
|
-
let staticHandler =
|
|
1102
|
+
let staticHandler = _chunkKUJAVZYDjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1134
1103
|
basename: build.basename
|
|
1135
1104
|
});
|
|
1136
1105
|
let errorHandler = build.entry.module.handleError || ((error, { request }) => {
|
|
1137
1106
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1138
1107
|
console.error(
|
|
1139
1108
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1140
|
-
|
|
1109
|
+
_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1141
1110
|
);
|
|
1142
1111
|
}
|
|
1143
1112
|
});
|
|
@@ -1183,36 +1152,36 @@ var createRequestHandler = (build, mode) => {
|
|
|
1183
1152
|
});
|
|
1184
1153
|
};
|
|
1185
1154
|
if (_build.future.unstable_middleware) {
|
|
1186
|
-
if (initialContext && !(initialContext instanceof
|
|
1155
|
+
if (initialContext && !(initialContext instanceof _chunkKUJAVZYDjs.unstable_RouterContextProvider)) {
|
|
1187
1156
|
let error = new Error(
|
|
1188
1157
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `unstable_RouterContextProvider` from your `getLoadContext` function."
|
|
1189
1158
|
);
|
|
1190
1159
|
handleError(error);
|
|
1191
1160
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1192
1161
|
}
|
|
1193
|
-
loadContext = initialContext || new (0,
|
|
1162
|
+
loadContext = initialContext || new (0, _chunkKUJAVZYDjs.unstable_RouterContextProvider)();
|
|
1194
1163
|
} else {
|
|
1195
1164
|
loadContext = initialContext || {};
|
|
1196
1165
|
}
|
|
1197
1166
|
let url = new URL(request.url);
|
|
1198
1167
|
let normalizedBasename = _build.basename || "/";
|
|
1199
1168
|
let normalizedPath = url.pathname;
|
|
1200
|
-
if (
|
|
1169
|
+
if (_chunkKUJAVZYDjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1201
1170
|
normalizedPath = normalizedBasename;
|
|
1202
1171
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1203
1172
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1204
1173
|
}
|
|
1205
|
-
if (
|
|
1174
|
+
if (_chunkKUJAVZYDjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1206
1175
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1207
1176
|
}
|
|
1208
1177
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1209
1178
|
if (!_build.ssr) {
|
|
1210
1179
|
let decodedPath = decodeURI(normalizedPath);
|
|
1211
1180
|
if (normalizedBasename !== "/") {
|
|
1212
|
-
let strippedPath =
|
|
1181
|
+
let strippedPath = _chunkKUJAVZYDjs.stripBasename.call(void 0, decodedPath, normalizedBasename);
|
|
1213
1182
|
if (strippedPath == null) {
|
|
1214
1183
|
errorHandler(
|
|
1215
|
-
new (0,
|
|
1184
|
+
new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(
|
|
1216
1185
|
404,
|
|
1217
1186
|
"Not Found",
|
|
1218
1187
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
@@ -1235,7 +1204,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1235
1204
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
1236
1205
|
if (url.pathname.endsWith(".data")) {
|
|
1237
1206
|
errorHandler(
|
|
1238
|
-
new (0,
|
|
1207
|
+
new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(
|
|
1239
1208
|
404,
|
|
1240
1209
|
"Not Found",
|
|
1241
1210
|
`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 +1224,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1255
1224
|
}
|
|
1256
1225
|
}
|
|
1257
1226
|
}
|
|
1258
|
-
let manifestUrl =
|
|
1227
|
+
let manifestUrl = _chunkKUJAVZYDjs.getManifestPath.call(void 0,
|
|
1259
1228
|
_build.routeDiscovery.manifestPath,
|
|
1260
1229
|
normalizedBasename
|
|
1261
1230
|
);
|
|
@@ -1290,36 +1259,26 @@ var createRequestHandler = (build, mode) => {
|
|
|
1290
1259
|
loadContext,
|
|
1291
1260
|
handleError
|
|
1292
1261
|
);
|
|
1262
|
+
if (_chunkKUJAVZYDjs.isRedirectResponse.call(void 0, response)) {
|
|
1263
|
+
response = generateSingleFetchRedirectResponse(
|
|
1264
|
+
response,
|
|
1265
|
+
request,
|
|
1266
|
+
_build,
|
|
1267
|
+
serverMode
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1293
1270
|
if (_build.entry.module.handleDataRequest) {
|
|
1294
1271
|
response = await _build.entry.module.handleDataRequest(response, {
|
|
1295
1272
|
context: loadContext,
|
|
1296
1273
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1297
1274
|
request
|
|
1298
1275
|
});
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1301
|
-
response
|
|
1302
|
-
|
|
1303
|
-
_build
|
|
1304
|
-
|
|
1305
|
-
if (request.method === "GET") {
|
|
1306
|
-
result = {
|
|
1307
|
-
[_chunkTGXCWGPTjs.SingleFetchRedirectSymbol]: result
|
|
1308
|
-
};
|
|
1309
|
-
}
|
|
1310
|
-
let headers = new Headers(response.headers);
|
|
1311
|
-
headers.set("Content-Type", "text/x-script");
|
|
1312
|
-
return new Response(
|
|
1313
|
-
encodeViaTurboStream(
|
|
1314
|
-
result,
|
|
1315
|
-
request.signal,
|
|
1316
|
-
_build.entry.module.streamTimeout,
|
|
1317
|
-
serverMode
|
|
1318
|
-
),
|
|
1319
|
-
{
|
|
1320
|
-
status: _chunkTGXCWGPTjs.SINGLE_FETCH_REDIRECT_STATUS,
|
|
1321
|
-
headers
|
|
1322
|
-
}
|
|
1276
|
+
if (_chunkKUJAVZYDjs.isRedirectResponse.call(void 0, response)) {
|
|
1277
|
+
response = generateSingleFetchRedirectResponse(
|
|
1278
|
+
response,
|
|
1279
|
+
request,
|
|
1280
|
+
_build,
|
|
1281
|
+
serverMode
|
|
1323
1282
|
);
|
|
1324
1283
|
}
|
|
1325
1284
|
}
|
|
@@ -1431,7 +1390,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1431
1390
|
unstable_generateMiddlewareResponse: build.future.unstable_middleware ? async (query) => {
|
|
1432
1391
|
try {
|
|
1433
1392
|
let innerResult = await query(request);
|
|
1434
|
-
if (!
|
|
1393
|
+
if (!_chunkKUJAVZYDjs.isResponse.call(void 0, innerResult)) {
|
|
1435
1394
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1436
1395
|
}
|
|
1437
1396
|
return innerResult;
|
|
@@ -1441,7 +1400,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1441
1400
|
}
|
|
1442
1401
|
} : void 0
|
|
1443
1402
|
});
|
|
1444
|
-
if (!
|
|
1403
|
+
if (!_chunkKUJAVZYDjs.isResponse.call(void 0, result)) {
|
|
1445
1404
|
result = await renderHtml(result, isSpaMode);
|
|
1446
1405
|
}
|
|
1447
1406
|
return result;
|
|
@@ -1456,7 +1415,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1456
1415
|
}
|
|
1457
1416
|
if (context.errors) {
|
|
1458
1417
|
Object.values(context.errors).forEach((err) => {
|
|
1459
|
-
if (!
|
|
1418
|
+
if (!_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1460
1419
|
handleError(err);
|
|
1461
1420
|
}
|
|
1462
1421
|
});
|
|
@@ -1508,10 +1467,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1508
1467
|
} catch (error) {
|
|
1509
1468
|
handleError(error);
|
|
1510
1469
|
let errorForSecondRender = error;
|
|
1511
|
-
if (
|
|
1470
|
+
if (_chunkKUJAVZYDjs.isResponse.call(void 0, error)) {
|
|
1512
1471
|
try {
|
|
1513
1472
|
let data2 = await unwrapResponse(error);
|
|
1514
|
-
errorForSecondRender = new (0,
|
|
1473
|
+
errorForSecondRender = new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(
|
|
1515
1474
|
error.status,
|
|
1516
1475
|
error.statusText,
|
|
1517
1476
|
data2
|
|
@@ -1519,7 +1478,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1519
1478
|
} catch (e) {
|
|
1520
1479
|
}
|
|
1521
1480
|
}
|
|
1522
|
-
context =
|
|
1481
|
+
context = _chunkKUJAVZYDjs.getStaticContextFromError.call(void 0,
|
|
1523
1482
|
staticHandler.dataRoutes,
|
|
1524
1483
|
context,
|
|
1525
1484
|
errorForSecondRender
|
|
@@ -1578,7 +1537,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1578
1537
|
return handleQueryRouteError(error);
|
|
1579
1538
|
}
|
|
1580
1539
|
function handleQueryRouteResult(result) {
|
|
1581
|
-
if (
|
|
1540
|
+
if (_chunkKUJAVZYDjs.isResponse.call(void 0, result)) {
|
|
1582
1541
|
return result;
|
|
1583
1542
|
}
|
|
1584
1543
|
if (typeof result === "string") {
|
|
@@ -1587,11 +1546,11 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1587
1546
|
return Response.json(result);
|
|
1588
1547
|
}
|
|
1589
1548
|
function handleQueryRouteError(error) {
|
|
1590
|
-
if (
|
|
1549
|
+
if (_chunkKUJAVZYDjs.isResponse.call(void 0, error)) {
|
|
1591
1550
|
error.headers.set("X-Remix-Catch", "yes");
|
|
1592
1551
|
return error;
|
|
1593
1552
|
}
|
|
1594
|
-
if (
|
|
1553
|
+
if (_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1595
1554
|
handleError(error);
|
|
1596
1555
|
return errorResponseToJson(error, serverMode);
|
|
1597
1556
|
}
|
|
@@ -1717,7 +1676,7 @@ function createSessionStorage({
|
|
|
1717
1676
|
};
|
|
1718
1677
|
}
|
|
1719
1678
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1720
|
-
|
|
1679
|
+
_chunkKUJAVZYDjs.warnOnce.call(void 0,
|
|
1721
1680
|
cookie.isSigned,
|
|
1722
1681
|
`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
1682
|
);
|
|
@@ -1812,12 +1771,12 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
|
|
|
1812
1771
|
...state,
|
|
1813
1772
|
loaderData: { ...state.loaderData }
|
|
1814
1773
|
};
|
|
1815
|
-
let initialMatches =
|
|
1774
|
+
let initialMatches = _chunkKUJAVZYDjs.matchRoutes.call(void 0, routes, location2, basename);
|
|
1816
1775
|
if (initialMatches) {
|
|
1817
1776
|
for (let match of initialMatches) {
|
|
1818
1777
|
let routeId = match.route.id;
|
|
1819
1778
|
let routeInfo = getRouteInfo(routeId);
|
|
1820
|
-
if (
|
|
1779
|
+
if (_chunkKUJAVZYDjs.shouldHydrateRouteLoader.call(void 0,
|
|
1821
1780
|
routeId,
|
|
1822
1781
|
routeInfo.clientLoader,
|
|
1823
1782
|
routeInfo.hasLoader,
|
|
@@ -1895,7 +1854,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1895
1854
|
}
|
|
1896
1855
|
}
|
|
1897
1856
|
);
|
|
1898
|
-
if (
|
|
1857
|
+
if (_chunkKUJAVZYDjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1899
1858
|
return /* @__PURE__ */ React.default.createElement(
|
|
1900
1859
|
ErrorWrapper,
|
|
1901
1860
|
{
|
|
@@ -1903,7 +1862,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1903
1862
|
title: "Unhandled Thrown Response!"
|
|
1904
1863
|
},
|
|
1905
1864
|
/* @__PURE__ */ React.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
1906
|
-
|
|
1865
|
+
_chunkKUJAVZYDjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
1907
1866
|
);
|
|
1908
1867
|
}
|
|
1909
1868
|
let errorInstance;
|
|
@@ -1929,7 +1888,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1929
1888
|
function RSCDefaultRootErrorBoundary({
|
|
1930
1889
|
hasRootLayout
|
|
1931
1890
|
}) {
|
|
1932
|
-
let error =
|
|
1891
|
+
let error = _chunkKUJAVZYDjs.useRouteError.call(void 0, );
|
|
1933
1892
|
if (hasRootLayout === void 0) {
|
|
1934
1893
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
1935
1894
|
}
|
|
@@ -2073,7 +2032,7 @@ function createRouterFromPayload({
|
|
|
2073
2032
|
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
|
2074
2033
|
let patches = /* @__PURE__ */ new Map();
|
|
2075
2034
|
_optionalChain([payload, 'access', _20 => _20.patches, 'optionalAccess', _21 => _21.forEach, 'call', _22 => _22((patch) => {
|
|
2076
|
-
|
|
2035
|
+
_chunkKUJAVZYDjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
2077
2036
|
if (!patches.has(patch.parentId)) {
|
|
2078
2037
|
patches.set(patch.parentId, []);
|
|
2079
2038
|
}
|
|
@@ -2095,11 +2054,11 @@ function createRouterFromPayload({
|
|
|
2095
2054
|
}
|
|
2096
2055
|
return [route];
|
|
2097
2056
|
}, []);
|
|
2098
|
-
globalVar.__reactRouterDataRouter =
|
|
2057
|
+
globalVar.__reactRouterDataRouter = _chunkKUJAVZYDjs.createRouter.call(void 0, {
|
|
2099
2058
|
routes,
|
|
2100
2059
|
unstable_getContext,
|
|
2101
2060
|
basename: payload.basename,
|
|
2102
|
-
history:
|
|
2061
|
+
history: _chunkKUJAVZYDjs.createBrowserHistory.call(void 0, ),
|
|
2103
2062
|
hydrationData: getHydrationData(
|
|
2104
2063
|
{
|
|
2105
2064
|
loaderData: payload.loaderData,
|
|
@@ -2109,7 +2068,7 @@ function createRouterFromPayload({
|
|
|
2109
2068
|
routes,
|
|
2110
2069
|
(routeId) => {
|
|
2111
2070
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
2112
|
-
|
|
2071
|
+
_chunkKUJAVZYDjs.invariant.call(void 0, match, "Route not found in payload");
|
|
2113
2072
|
return {
|
|
2114
2073
|
clientLoader: match.clientLoader,
|
|
2115
2074
|
hasLoader: match.hasLoader,
|
|
@@ -2207,9 +2166,9 @@ function createRouterFromPayload({
|
|
|
2207
2166
|
routeModules: globalVar.__reactRouterRouteModules
|
|
2208
2167
|
};
|
|
2209
2168
|
}
|
|
2210
|
-
var renderedRoutesContext =
|
|
2169
|
+
var renderedRoutesContext = _chunkKUJAVZYDjs.unstable_createContext.call(void 0, );
|
|
2211
2170
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
2212
|
-
let dataStrategy =
|
|
2171
|
+
let dataStrategy = _chunkKUJAVZYDjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
2213
2172
|
getRouter,
|
|
2214
2173
|
(match) => {
|
|
2215
2174
|
let M = match;
|
|
@@ -2263,20 +2222,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2263
2222
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
2264
2223
|
return async (args, basename, targetRoutes) => {
|
|
2265
2224
|
let { request, context } = args;
|
|
2266
|
-
let url =
|
|
2225
|
+
let url = _chunkKUJAVZYDjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
2267
2226
|
if (request.method === "GET") {
|
|
2268
|
-
url =
|
|
2227
|
+
url = _chunkKUJAVZYDjs.stripIndexParam.call(void 0, url);
|
|
2269
2228
|
if (targetRoutes) {
|
|
2270
2229
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
2271
2230
|
}
|
|
2272
2231
|
}
|
|
2273
2232
|
let res = await fetchImplementation(
|
|
2274
|
-
new Request(url, await
|
|
2233
|
+
new Request(url, await _chunkKUJAVZYDjs.createRequestInit.call(void 0, request))
|
|
2275
2234
|
);
|
|
2276
2235
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
2277
|
-
throw new (0,
|
|
2236
|
+
throw new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(404, "Not Found", true);
|
|
2278
2237
|
}
|
|
2279
|
-
|
|
2238
|
+
_chunkKUJAVZYDjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
2280
2239
|
try {
|
|
2281
2240
|
const payload = await createFromReadableStream(res.body, {
|
|
2282
2241
|
temporaryReferences: void 0
|
|
@@ -2300,7 +2259,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
2300
2259
|
}
|
|
2301
2260
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
2302
2261
|
let results = { routes: {} };
|
|
2303
|
-
const dataKey =
|
|
2262
|
+
const dataKey = _chunkKUJAVZYDjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
2304
2263
|
for (let [routeId, data2] of Object.entries(payload[dataKey] || {})) {
|
|
2305
2264
|
results.routes[routeId] = { data: data2 };
|
|
2306
2265
|
}
|
|
@@ -2338,7 +2297,7 @@ function RSCHydratedRouter({
|
|
|
2338
2297
|
]
|
|
2339
2298
|
);
|
|
2340
2299
|
React4.useEffect(() => {
|
|
2341
|
-
|
|
2300
|
+
_chunkKUJAVZYDjs.setIsHydrated.call(void 0, );
|
|
2342
2301
|
}, []);
|
|
2343
2302
|
React4.useLayoutEffect(() => {
|
|
2344
2303
|
const globalVar = window;
|
|
@@ -2425,7 +2384,7 @@ function RSCHydratedRouter({
|
|
|
2425
2384
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2426
2385
|
routeModules
|
|
2427
2386
|
};
|
|
2428
|
-
return /* @__PURE__ */ React4.createElement(
|
|
2387
|
+
return /* @__PURE__ */ React4.createElement(_chunkKUJAVZYDjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(_chunkKUJAVZYDjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(_chunkUMVNFWBWjs.RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2429
2388
|
}
|
|
2430
2389
|
function createRouteFromServerManifest(match, payload) {
|
|
2431
2390
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -2436,7 +2395,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2436
2395
|
// the server loader flow regardless of whether the client loader calls
|
|
2437
2396
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
2438
2397
|
match.hasComponent && !match.element;
|
|
2439
|
-
|
|
2398
|
+
_chunkKUJAVZYDjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
2440
2399
|
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
|
2441
2400
|
let dataRoute = {
|
|
2442
2401
|
id: match.id,
|
|
@@ -2487,7 +2446,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2487
2446
|
return await callSingleFetch(singleFetch);
|
|
2488
2447
|
}
|
|
2489
2448
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
2490
|
-
throw
|
|
2449
|
+
throw _chunkKUJAVZYDjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
2491
2450
|
},
|
|
2492
2451
|
path: match.path,
|
|
2493
2452
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -2500,7 +2459,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2500
2459
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
2501
2460
|
};
|
|
2502
2461
|
if (typeof dataRoute.loader === "function") {
|
|
2503
|
-
dataRoute.loader.hydrate =
|
|
2462
|
+
dataRoute.loader.hydrate = _chunkKUJAVZYDjs.shouldHydrateRouteLoader.call(void 0,
|
|
2504
2463
|
match.id,
|
|
2505
2464
|
match.clientLoader,
|
|
2506
2465
|
match.hasLoader,
|
|
@@ -2510,7 +2469,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2510
2469
|
return dataRoute;
|
|
2511
2470
|
}
|
|
2512
2471
|
function callSingleFetch(singleFetch) {
|
|
2513
|
-
|
|
2472
|
+
_chunkKUJAVZYDjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
2514
2473
|
return singleFetch();
|
|
2515
2474
|
}
|
|
2516
2475
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -2518,7 +2477,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
2518
2477
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
2519
2478
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
2520
2479
|
console.error(msg);
|
|
2521
|
-
throw new (0,
|
|
2480
|
+
throw new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
2522
2481
|
}
|
|
2523
2482
|
}
|
|
2524
2483
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -2713,7 +2672,7 @@ async function routeRSCServerRequest({
|
|
|
2713
2672
|
};
|
|
2714
2673
|
try {
|
|
2715
2674
|
const payload = await getPayload();
|
|
2716
|
-
if (serverResponse.status ===
|
|
2675
|
+
if (serverResponse.status === _chunkKUJAVZYDjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2717
2676
|
const headers2 = new Headers(serverResponse.headers);
|
|
2718
2677
|
headers2.delete("Content-Encoding");
|
|
2719
2678
|
headers2.delete("Content-Length");
|
|
@@ -2763,7 +2722,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2763
2722
|
if (payload.type !== "render") return null;
|
|
2764
2723
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2765
2724
|
for (const match of payload.matches) {
|
|
2766
|
-
if (
|
|
2725
|
+
if (_chunkKUJAVZYDjs.shouldHydrateRouteLoader.call(void 0,
|
|
2767
2726
|
match.id,
|
|
2768
2727
|
match.clientLoader,
|
|
2769
2728
|
match.hasLoader,
|
|
@@ -2797,7 +2756,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2797
2756
|
}
|
|
2798
2757
|
}))
|
|
2799
2758
|
};
|
|
2800
|
-
const router =
|
|
2759
|
+
const router = _chunkUMVNFWBWjs.createStaticRouter.call(void 0,
|
|
2801
2760
|
payload.matches.reduceRight((previous, match) => {
|
|
2802
2761
|
const route = {
|
|
2803
2762
|
id: match.id,
|
|
@@ -2841,8 +2800,8 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2841
2800
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2842
2801
|
routeModules: createRSCRouteModules(payload)
|
|
2843
2802
|
};
|
|
2844
|
-
return /* @__PURE__ */ React5.createElement(
|
|
2845
|
-
|
|
2803
|
+
return /* @__PURE__ */ React5.createElement(_chunkKUJAVZYDjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(_chunkKUJAVZYDjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2804
|
+
_chunkUMVNFWBWjs.StaticRouterProvider,
|
|
2846
2805
|
{
|
|
2847
2806
|
context,
|
|
2848
2807
|
router,
|
|
@@ -2900,7 +2859,7 @@ function deserializeErrors(errors) {
|
|
|
2900
2859
|
let serialized = {};
|
|
2901
2860
|
for (let [key, val] of entries) {
|
|
2902
2861
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2903
|
-
serialized[key] = new (0,
|
|
2862
|
+
serialized[key] = new (0, _chunkKUJAVZYDjs.ErrorResponseImpl)(
|
|
2904
2863
|
val.status,
|
|
2905
2864
|
val.statusText,
|
|
2906
2865
|
val.data,
|
|
@@ -3058,4 +3017,4 @@ function deserializeErrors(errors) {
|
|
|
3058
3017
|
|
|
3059
3018
|
|
|
3060
3019
|
|
|
3061
|
-
exports.Await =
|
|
3020
|
+
exports.Await = _chunkUMVNFWBWjs.Await; exports.BrowserRouter = _chunkUMVNFWBWjs.BrowserRouter; exports.Form = _chunkUMVNFWBWjs.Form; exports.HashRouter = _chunkUMVNFWBWjs.HashRouter; exports.IDLE_BLOCKER = _chunkKUJAVZYDjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkKUJAVZYDjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkKUJAVZYDjs.IDLE_NAVIGATION; exports.Link = _chunkUMVNFWBWjs.Link; exports.Links = _chunkKUJAVZYDjs.Links; exports.MemoryRouter = _chunkUMVNFWBWjs.MemoryRouter; exports.Meta = _chunkKUJAVZYDjs.Meta; exports.NavLink = _chunkUMVNFWBWjs.NavLink; exports.Navigate = _chunkUMVNFWBWjs.Navigate; exports.NavigationType = _chunkKUJAVZYDjs.Action; exports.Outlet = _chunkUMVNFWBWjs.Outlet; exports.PrefetchPageLinks = _chunkKUJAVZYDjs.PrefetchPageLinks; exports.Route = _chunkUMVNFWBWjs.Route; exports.Router = _chunkUMVNFWBWjs.Router; exports.RouterProvider = _chunkUMVNFWBWjs.RouterProvider; exports.Routes = _chunkUMVNFWBWjs.Routes; exports.Scripts = _chunkKUJAVZYDjs.Scripts; exports.ScrollRestoration = _chunkUMVNFWBWjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunkUMVNFWBWjs.StaticRouter; exports.StaticRouterProvider = _chunkUMVNFWBWjs.StaticRouterProvider; exports.UNSAFE_DataRouterContext = _chunkKUJAVZYDjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkKUJAVZYDjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkKUJAVZYDjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkKUJAVZYDjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkKUJAVZYDjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkKUJAVZYDjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkKUJAVZYDjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkKUJAVZYDjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkKUJAVZYDjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkKUJAVZYDjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkKUJAVZYDjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkUMVNFWBWjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkUMVNFWBWjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkUMVNFWBWjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkKUJAVZYDjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkKUJAVZYDjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkKUJAVZYDjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunkKUJAVZYDjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkKUJAVZYDjs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkKUJAVZYDjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkKUJAVZYDjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkUMVNFWBWjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkKUJAVZYDjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkUMVNFWBWjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkKUJAVZYDjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkKUJAVZYDjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunkUMVNFWBWjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkUMVNFWBWjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkUMVNFWBWjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkUMVNFWBWjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunkUMVNFWBWjs.createBrowserRouter; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunkUMVNFWBWjs.createHashRouter; exports.createMemoryRouter = _chunkUMVNFWBWjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkKUJAVZYDjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkUMVNFWBWjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkUMVNFWBWjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunkUMVNFWBWjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunkUMVNFWBWjs.createStaticHandler; exports.createStaticRouter = _chunkUMVNFWBWjs.createStaticRouter; exports.data = _chunkKUJAVZYDjs.data; exports.generatePath = _chunkKUJAVZYDjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkKUJAVZYDjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkKUJAVZYDjs.matchPath; exports.matchRoutes = _chunkKUJAVZYDjs.matchRoutes; exports.parsePath = _chunkKUJAVZYDjs.parsePath; exports.redirect = _chunkKUJAVZYDjs.redirect; exports.redirectDocument = _chunkKUJAVZYDjs.redirectDocument; exports.renderMatches = _chunkUMVNFWBWjs.renderMatches; exports.replace = _chunkKUJAVZYDjs.replace; exports.resolvePath = _chunkKUJAVZYDjs.resolvePath; exports.unstable_HistoryRouter = _chunkUMVNFWBWjs.HistoryRouter; exports.unstable_RSCHydratedRouter = RSCHydratedRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_RouterContextProvider = _chunkKUJAVZYDjs.unstable_RouterContextProvider; exports.unstable_createCallServer = createCallServer; exports.unstable_createContext = _chunkKUJAVZYDjs.unstable_createContext; exports.unstable_getRSCStream = getRSCStream; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunkUMVNFWBWjs.usePrompt; exports.useActionData = _chunkKUJAVZYDjs.useActionData; exports.useAsyncError = _chunkKUJAVZYDjs.useAsyncError; exports.useAsyncValue = _chunkKUJAVZYDjs.useAsyncValue; exports.useBeforeUnload = _chunkUMVNFWBWjs.useBeforeUnload; exports.useBlocker = _chunkKUJAVZYDjs.useBlocker; exports.useFetcher = _chunkUMVNFWBWjs.useFetcher; exports.useFetchers = _chunkUMVNFWBWjs.useFetchers; exports.useFormAction = _chunkUMVNFWBWjs.useFormAction; exports.useHref = _chunkKUJAVZYDjs.useHref; exports.useInRouterContext = _chunkKUJAVZYDjs.useInRouterContext; exports.useLinkClickHandler = _chunkUMVNFWBWjs.useLinkClickHandler; exports.useLoaderData = _chunkKUJAVZYDjs.useLoaderData; exports.useLocation = _chunkKUJAVZYDjs.useLocation; exports.useMatch = _chunkKUJAVZYDjs.useMatch; exports.useMatches = _chunkKUJAVZYDjs.useMatches; exports.useNavigate = _chunkKUJAVZYDjs.useNavigate; exports.useNavigation = _chunkKUJAVZYDjs.useNavigation; exports.useNavigationType = _chunkKUJAVZYDjs.useNavigationType; exports.useOutlet = _chunkKUJAVZYDjs.useOutlet; exports.useOutletContext = _chunkKUJAVZYDjs.useOutletContext; exports.useParams = _chunkKUJAVZYDjs.useParams; exports.useResolvedPath = _chunkKUJAVZYDjs.useResolvedPath; exports.useRevalidator = _chunkKUJAVZYDjs.useRevalidator; exports.useRouteError = _chunkKUJAVZYDjs.useRouteError; exports.useRouteLoaderData = _chunkKUJAVZYDjs.useRouteLoaderData; exports.useRoutes = _chunkKUJAVZYDjs.useRoutes; exports.useSearchParams = _chunkUMVNFWBWjs.useSearchParams; exports.useSubmit = _chunkUMVNFWBWjs.useSubmit; exports.useViewTransitionState = _chunkUMVNFWBWjs.useViewTransitionState;
|