react-router 7.9.1 → 7.9.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 +19 -9
- package/dist/development/{chunk-PW3F6ATG.js → chunk-ED2JHW2I.js} +102 -70
- package/dist/development/{chunk-B7RQU5TL.mjs → chunk-EPSRV6KC.mjs} +64 -26
- package/dist/{production/chunk-RCAZODXZ.mjs → development/chunk-PVJ3J6E6.mjs} +94 -9
- package/dist/{production/chunk-3SXVZXGI.js → development/chunk-VM65TX2A.js} +138 -132
- package/dist/development/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{production/index-react-server-client-BYr9g50r.d.ts → development/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/development/index-react-server-client.d.mts +3 -3
- 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 +10 -0
- package/dist/development/index-react-server.d.ts +10 -0
- package/dist/development/index-react-server.js +3 -3
- package/dist/development/index-react-server.mjs +3 -3
- package/dist/development/index.d.mts +16 -12
- package/dist/development/index.d.ts +14 -10
- package/dist/development/index.js +190 -105
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{production/routeModules-DnUHijGz.d.ts → development/routeModules-BmVo7q9e.d.ts} +20 -0
- package/dist/production/{chunk-HMYSPRGR.js → chunk-22I2H6CR.js} +102 -70
- package/dist/production/{chunk-P25HWPOZ.mjs → chunk-662O2YDJ.mjs} +64 -26
- package/dist/{development/chunk-SKNKB5VI.mjs → production/chunk-HAV7J4RO.mjs} +94 -9
- package/dist/{development/chunk-LWNHKVDL.js → production/chunk-K4BWIVAI.js} +138 -132
- package/dist/production/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{development/index-react-server-client-BYr9g50r.d.ts → production/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/production/index-react-server-client.d.mts +3 -3
- 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 +10 -0
- package/dist/production/index-react-server.d.ts +10 -0
- package/dist/production/index-react-server.js +3 -3
- package/dist/production/index-react-server.mjs +3 -3
- package/dist/production/index.d.mts +16 -12
- package/dist/production/index.d.ts +14 -10
- package/dist/production/index.js +190 -105
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{development/routeModules-DnUHijGz.d.ts → production/routeModules-BmVo7q9e.d.ts} +20 -0
- package/package.json +1 -1
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.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 _chunkK4BWIVAIjs = require('./chunk-K4BWIVAI.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -145,7 +145,7 @@ var _chunk3SXVZXGIjs = require('./chunk-3SXVZXGI.js');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
var
|
|
148
|
+
var _chunk22I2H6CRjs = require('./chunk-22I2H6CR.js');
|
|
149
149
|
|
|
150
150
|
// lib/dom/ssr/server.tsx
|
|
151
151
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react);
|
|
@@ -158,7 +158,7 @@ function ServerRouter({
|
|
|
158
158
|
url = new URL(url);
|
|
159
159
|
}
|
|
160
160
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
161
|
-
let routes =
|
|
161
|
+
let routes = _chunk22I2H6CRjs.createServerRoutes.call(void 0,
|
|
162
162
|
manifest.routes,
|
|
163
163
|
routeModules,
|
|
164
164
|
context.future,
|
|
@@ -171,7 +171,7 @@ function ServerRouter({
|
|
|
171
171
|
let routeId = match.route.id;
|
|
172
172
|
let route = routeModules[routeId];
|
|
173
173
|
let manifestRoute = context.manifest.routes[routeId];
|
|
174
|
-
if (route && manifestRoute &&
|
|
174
|
+
if (route && manifestRoute && _chunk22I2H6CRjs.shouldHydrateRouteLoader.call(void 0,
|
|
175
175
|
routeId,
|
|
176
176
|
route.clientLoader,
|
|
177
177
|
manifestRoute.hasLoader,
|
|
@@ -180,9 +180,9 @@ function ServerRouter({
|
|
|
180
180
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
let router =
|
|
183
|
+
let router = _chunkK4BWIVAIjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
184
184
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
185
|
-
|
|
185
|
+
_chunk22I2H6CRjs.FrameworkContext.Provider,
|
|
186
186
|
{
|
|
187
187
|
value: {
|
|
188
188
|
manifest,
|
|
@@ -197,8 +197,8 @@ function ServerRouter({
|
|
|
197
197
|
renderMeta: context.renderMeta
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
|
-
/* @__PURE__ */ React.createElement(
|
|
201
|
-
|
|
200
|
+
/* @__PURE__ */ React.createElement(_chunk22I2H6CRjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
201
|
+
_chunkK4BWIVAIjs.StaticRouterProvider,
|
|
202
202
|
{
|
|
203
203
|
router,
|
|
204
204
|
context: context.staticHandlerContext,
|
|
@@ -206,7 +206,7 @@ function ServerRouter({
|
|
|
206
206
|
}
|
|
207
207
|
))
|
|
208
208
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
209
|
-
|
|
209
|
+
_chunk22I2H6CRjs.StreamTransfer,
|
|
210
210
|
{
|
|
211
211
|
context,
|
|
212
212
|
identifier: 0,
|
|
@@ -248,18 +248,18 @@ function createRoutesStub(routes, _context) {
|
|
|
248
248
|
let patched = processRoutes(
|
|
249
249
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
250
250
|
// types compared to `AgnosticRouteObject`
|
|
251
|
-
|
|
252
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0,
|
|
251
|
+
_chunk22I2H6CRjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
252
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0, _chunk22I2H6CRjs.RouterContextProvider)() : {},
|
|
253
253
|
frameworkContextRef.current.manifest,
|
|
254
254
|
frameworkContextRef.current.routeModules
|
|
255
255
|
);
|
|
256
|
-
routerRef.current =
|
|
256
|
+
routerRef.current = _chunkK4BWIVAIjs.createMemoryRouter.call(void 0, patched, {
|
|
257
257
|
initialEntries,
|
|
258
258
|
initialIndex,
|
|
259
259
|
hydrationData
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
|
-
return /* @__PURE__ */ React2.createElement(
|
|
262
|
+
return /* @__PURE__ */ React2.createElement(_chunk22I2H6CRjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkK4BWIVAIjs.RouterProvider, { router: routerRef.current }));
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -273,11 +273,17 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
273
273
|
id: route.id,
|
|
274
274
|
path: route.path,
|
|
275
275
|
index: route.index,
|
|
276
|
-
Component: route.Component ?
|
|
277
|
-
HydrateFallback: route.HydrateFallback ?
|
|
278
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
276
|
+
Component: route.Component ? _chunkK4BWIVAIjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
277
|
+
HydrateFallback: route.HydrateFallback ? _chunkK4BWIVAIjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
278
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkK4BWIVAIjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
279
279
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
280
280
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
281
|
+
middleware: route.middleware ? route.middleware.map(
|
|
282
|
+
(mw) => (...args) => mw(
|
|
283
|
+
{ ...args[0], context },
|
|
284
|
+
args[1]
|
|
285
|
+
)
|
|
286
|
+
) : void 0,
|
|
281
287
|
handle: route.handle,
|
|
282
288
|
shouldRevalidate: route.shouldRevalidate
|
|
283
289
|
};
|
|
@@ -304,7 +310,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
304
310
|
};
|
|
305
311
|
manifest.routes[newRoute.id] = entryRoute;
|
|
306
312
|
routeModules[route.id] = {
|
|
307
|
-
default: newRoute.Component ||
|
|
313
|
+
default: newRoute.Component || _chunkK4BWIVAIjs.Outlet,
|
|
308
314
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
309
315
|
handle: route.handle,
|
|
310
316
|
links: route.links,
|
|
@@ -499,7 +505,7 @@ function myUnescape(value) {
|
|
|
499
505
|
return result;
|
|
500
506
|
}
|
|
501
507
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
502
|
-
|
|
508
|
+
_chunk22I2H6CRjs.warnOnce.call(void 0,
|
|
503
509
|
!expires,
|
|
504
510
|
`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.`
|
|
505
511
|
);
|
|
@@ -553,7 +559,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
553
559
|
let entries = Object.entries(errors);
|
|
554
560
|
let serialized = {};
|
|
555
561
|
for (let [key, val] of entries) {
|
|
556
|
-
if (
|
|
562
|
+
if (_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, val)) {
|
|
557
563
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
558
564
|
} else if (val instanceof Error) {
|
|
559
565
|
let sanitized = sanitizeError(val, serverMode);
|
|
@@ -578,7 +584,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
578
584
|
|
|
579
585
|
// lib/server-runtime/routeMatching.ts
|
|
580
586
|
function matchServerRoutes(routes, pathname, basename) {
|
|
581
|
-
let matches =
|
|
587
|
+
let matches = _chunk22I2H6CRjs.matchRoutes.call(void 0,
|
|
582
588
|
routes,
|
|
583
589
|
pathname,
|
|
584
590
|
basename
|
|
@@ -598,7 +604,7 @@ async function callRouteHandler(handler, args) {
|
|
|
598
604
|
params: args.params,
|
|
599
605
|
context: args.context
|
|
600
606
|
});
|
|
601
|
-
if (
|
|
607
|
+
if (_chunk22I2H6CRjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunk22I2H6CRjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
602
608
|
throw new Response(null, result.init);
|
|
603
609
|
}
|
|
604
610
|
return result;
|
|
@@ -717,17 +723,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
717
723
|
controller.close();
|
|
718
724
|
}
|
|
719
725
|
});
|
|
720
|
-
let decoded = await
|
|
726
|
+
let decoded = await _chunk22I2H6CRjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
721
727
|
let data2 = decoded.value;
|
|
722
|
-
if (data2 &&
|
|
723
|
-
let result = data2[
|
|
728
|
+
if (data2 && _chunk22I2H6CRjs.SingleFetchRedirectSymbol in data2) {
|
|
729
|
+
let result = data2[_chunk22I2H6CRjs.SingleFetchRedirectSymbol];
|
|
724
730
|
let init = { status: result.status };
|
|
725
731
|
if (result.reload) {
|
|
726
|
-
throw
|
|
732
|
+
throw _chunk22I2H6CRjs.redirectDocument.call(void 0, result.redirect, init);
|
|
727
733
|
} else if (result.replace) {
|
|
728
|
-
throw
|
|
734
|
+
throw _chunk22I2H6CRjs.replace.call(void 0, result.redirect, init);
|
|
729
735
|
} else {
|
|
730
|
-
throw
|
|
736
|
+
throw _chunk22I2H6CRjs.redirect.call(void 0, result.redirect, init);
|
|
731
737
|
}
|
|
732
738
|
} else {
|
|
733
739
|
invariant2(
|
|
@@ -766,7 +772,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
766
772
|
|
|
767
773
|
// lib/server-runtime/serverHandoff.ts
|
|
768
774
|
function createServerHandoffString(serverHandoff) {
|
|
769
|
-
return
|
|
775
|
+
return _chunk22I2H6CRjs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
770
776
|
}
|
|
771
777
|
|
|
772
778
|
// lib/server-runtime/headers.ts
|
|
@@ -843,7 +849,7 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
843
849
|
|
|
844
850
|
// lib/server-runtime/single-fetch.ts
|
|
845
851
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
846
|
-
...
|
|
852
|
+
..._chunk22I2H6CRjs.NO_BODY_STATUS_CODES,
|
|
847
853
|
304
|
|
848
854
|
]);
|
|
849
855
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -873,7 +879,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
873
879
|
return handleQueryError(error);
|
|
874
880
|
}
|
|
875
881
|
function handleQueryResult(result) {
|
|
876
|
-
return
|
|
882
|
+
return _chunk22I2H6CRjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
877
883
|
}
|
|
878
884
|
function handleQueryError(error) {
|
|
879
885
|
handleError(error);
|
|
@@ -885,12 +891,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
885
891
|
}
|
|
886
892
|
function staticContextToResponse(context) {
|
|
887
893
|
let headers = getDocumentHeaders(context, build);
|
|
888
|
-
if (
|
|
894
|
+
if (_chunk22I2H6CRjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
889
895
|
return new Response(null, { status: context.statusCode, headers });
|
|
890
896
|
}
|
|
891
897
|
if (context.errors) {
|
|
892
898
|
Object.values(context.errors).forEach((err) => {
|
|
893
|
-
if (!
|
|
899
|
+
if (!_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
894
900
|
handleError(err);
|
|
895
901
|
}
|
|
896
902
|
});
|
|
@@ -937,7 +943,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
937
943
|
return handleQueryError(error);
|
|
938
944
|
}
|
|
939
945
|
function handleQueryResult(result) {
|
|
940
|
-
return
|
|
946
|
+
return _chunk22I2H6CRjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
941
947
|
}
|
|
942
948
|
function handleQueryError(error) {
|
|
943
949
|
handleError(error);
|
|
@@ -949,12 +955,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
949
955
|
}
|
|
950
956
|
function staticContextToResponse(context) {
|
|
951
957
|
let headers = getDocumentHeaders(context, build);
|
|
952
|
-
if (
|
|
958
|
+
if (_chunk22I2H6CRjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
953
959
|
return new Response(null, { status: context.statusCode, headers });
|
|
954
960
|
}
|
|
955
961
|
if (context.errors) {
|
|
956
962
|
Object.values(context.errors).forEach((err) => {
|
|
957
|
-
if (!
|
|
963
|
+
if (!_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
958
964
|
handleError(err);
|
|
959
965
|
}
|
|
960
966
|
});
|
|
@@ -1018,15 +1024,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1018
1024
|
headers.delete("Location");
|
|
1019
1025
|
headers.set("Content-Type", "text/x-script");
|
|
1020
1026
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1021
|
-
result: request.method === "GET" ? { [
|
|
1027
|
+
result: request.method === "GET" ? { [_chunk22I2H6CRjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1022
1028
|
headers,
|
|
1023
|
-
status:
|
|
1029
|
+
status: _chunk22I2H6CRjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1024
1030
|
});
|
|
1025
1031
|
}
|
|
1026
1032
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1027
1033
|
let redirect2 = headers.get("Location");
|
|
1028
1034
|
if (basename) {
|
|
1029
|
-
redirect2 =
|
|
1035
|
+
redirect2 = _chunk22I2H6CRjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1030
1036
|
}
|
|
1031
1037
|
return {
|
|
1032
1038
|
redirect: redirect2,
|
|
@@ -1052,7 +1058,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1052
1058
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1053
1059
|
);
|
|
1054
1060
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1055
|
-
return
|
|
1061
|
+
return _chunk22I2H6CRjs.encode.call(void 0, data2, {
|
|
1056
1062
|
signal: controller.signal,
|
|
1057
1063
|
plugins: [
|
|
1058
1064
|
(value) => {
|
|
@@ -1060,12 +1066,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1060
1066
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1061
1067
|
return ["SanitizedError", name, message, stack];
|
|
1062
1068
|
}
|
|
1063
|
-
if (value instanceof
|
|
1069
|
+
if (value instanceof _chunk22I2H6CRjs.ErrorResponseImpl) {
|
|
1064
1070
|
let { data: data3, status, statusText } = value;
|
|
1065
1071
|
return ["ErrorResponse", data3, status, statusText];
|
|
1066
1072
|
}
|
|
1067
|
-
if (value && typeof value === "object" &&
|
|
1068
|
-
return ["SingleFetchRedirect", value[
|
|
1073
|
+
if (value && typeof value === "object" && _chunk22I2H6CRjs.SingleFetchRedirectSymbol in value) {
|
|
1074
|
+
return ["SingleFetchRedirect", value[_chunk22I2H6CRjs.SingleFetchRedirectSymbol]];
|
|
1069
1075
|
}
|
|
1070
1076
|
}
|
|
1071
1077
|
],
|
|
@@ -1088,14 +1094,14 @@ function derive(build, mode) {
|
|
|
1088
1094
|
let routes = createRoutes(build.routes);
|
|
1089
1095
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1090
1096
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1091
|
-
let staticHandler =
|
|
1097
|
+
let staticHandler = _chunk22I2H6CRjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1092
1098
|
basename: build.basename
|
|
1093
1099
|
});
|
|
1094
1100
|
let errorHandler = build.entry.module.handleError || ((error, { request }) => {
|
|
1095
1101
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1096
1102
|
console.error(
|
|
1097
1103
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1098
|
-
|
|
1104
|
+
_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1099
1105
|
);
|
|
1100
1106
|
}
|
|
1101
1107
|
});
|
|
@@ -1141,36 +1147,36 @@ var createRequestHandler = (build, mode) => {
|
|
|
1141
1147
|
});
|
|
1142
1148
|
};
|
|
1143
1149
|
if (_build.future.v8_middleware) {
|
|
1144
|
-
if (initialContext && !(initialContext instanceof
|
|
1150
|
+
if (initialContext && !(initialContext instanceof _chunk22I2H6CRjs.RouterContextProvider)) {
|
|
1145
1151
|
let error = new Error(
|
|
1146
1152
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1147
1153
|
);
|
|
1148
1154
|
handleError(error);
|
|
1149
1155
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1150
1156
|
}
|
|
1151
|
-
loadContext = initialContext || new (0,
|
|
1157
|
+
loadContext = initialContext || new (0, _chunk22I2H6CRjs.RouterContextProvider)();
|
|
1152
1158
|
} else {
|
|
1153
1159
|
loadContext = initialContext || {};
|
|
1154
1160
|
}
|
|
1155
1161
|
let url = new URL(request.url);
|
|
1156
1162
|
let normalizedBasename = _build.basename || "/";
|
|
1157
1163
|
let normalizedPath = url.pathname;
|
|
1158
|
-
if (
|
|
1164
|
+
if (_chunk22I2H6CRjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1159
1165
|
normalizedPath = normalizedBasename;
|
|
1160
1166
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1161
1167
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1162
1168
|
}
|
|
1163
|
-
if (
|
|
1169
|
+
if (_chunk22I2H6CRjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1164
1170
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1165
1171
|
}
|
|
1166
1172
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1167
1173
|
if (!_build.ssr) {
|
|
1168
1174
|
let decodedPath = decodeURI(normalizedPath);
|
|
1169
1175
|
if (normalizedBasename !== "/") {
|
|
1170
|
-
let strippedPath =
|
|
1176
|
+
let strippedPath = _chunk22I2H6CRjs.stripBasename.call(void 0, decodedPath, normalizedBasename);
|
|
1171
1177
|
if (strippedPath == null) {
|
|
1172
1178
|
errorHandler(
|
|
1173
|
-
new (0,
|
|
1179
|
+
new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(
|
|
1174
1180
|
404,
|
|
1175
1181
|
"Not Found",
|
|
1176
1182
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
@@ -1193,7 +1199,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1193
1199
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
1194
1200
|
if (url.pathname.endsWith(".data")) {
|
|
1195
1201
|
errorHandler(
|
|
1196
|
-
new (0,
|
|
1202
|
+
new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(
|
|
1197
1203
|
404,
|
|
1198
1204
|
"Not Found",
|
|
1199
1205
|
`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.`
|
|
@@ -1213,7 +1219,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1213
1219
|
}
|
|
1214
1220
|
}
|
|
1215
1221
|
}
|
|
1216
|
-
let manifestUrl =
|
|
1222
|
+
let manifestUrl = _chunk22I2H6CRjs.getManifestPath.call(void 0,
|
|
1217
1223
|
_build.routeDiscovery.manifestPath,
|
|
1218
1224
|
normalizedBasename
|
|
1219
1225
|
);
|
|
@@ -1248,7 +1254,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1248
1254
|
loadContext,
|
|
1249
1255
|
handleError
|
|
1250
1256
|
);
|
|
1251
|
-
if (
|
|
1257
|
+
if (_chunk22I2H6CRjs.isRedirectResponse.call(void 0, response)) {
|
|
1252
1258
|
response = generateSingleFetchRedirectResponse(
|
|
1253
1259
|
response,
|
|
1254
1260
|
request,
|
|
@@ -1262,7 +1268,7 @@ var createRequestHandler = (build, mode) => {
|
|
|
1262
1268
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1263
1269
|
request
|
|
1264
1270
|
});
|
|
1265
|
-
if (
|
|
1271
|
+
if (_chunk22I2H6CRjs.isRedirectResponse.call(void 0, response)) {
|
|
1266
1272
|
response = generateSingleFetchRedirectResponse(
|
|
1267
1273
|
response,
|
|
1268
1274
|
request,
|
|
@@ -1320,9 +1326,11 @@ async function handleManifestRequest(build, routes, url) {
|
|
|
1320
1326
|
});
|
|
1321
1327
|
}
|
|
1322
1328
|
let patches = {};
|
|
1323
|
-
if (url.searchParams.has("
|
|
1329
|
+
if (url.searchParams.has("paths")) {
|
|
1324
1330
|
let paths = /* @__PURE__ */ new Set();
|
|
1325
|
-
url.searchParams.
|
|
1331
|
+
let pathParam = url.searchParams.get("paths") || "";
|
|
1332
|
+
let requestedPaths = pathParam.split(",").filter(Boolean);
|
|
1333
|
+
requestedPaths.forEach((path) => {
|
|
1326
1334
|
if (!path.startsWith("/")) {
|
|
1327
1335
|
path = `/${path}`;
|
|
1328
1336
|
}
|
|
@@ -1379,7 +1387,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1379
1387
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1380
1388
|
try {
|
|
1381
1389
|
let innerResult = await query(request);
|
|
1382
|
-
if (!
|
|
1390
|
+
if (!_chunk22I2H6CRjs.isResponse.call(void 0, innerResult)) {
|
|
1383
1391
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1384
1392
|
}
|
|
1385
1393
|
return innerResult;
|
|
@@ -1389,7 +1397,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1389
1397
|
}
|
|
1390
1398
|
} : void 0
|
|
1391
1399
|
});
|
|
1392
|
-
if (!
|
|
1400
|
+
if (!_chunk22I2H6CRjs.isResponse.call(void 0, result)) {
|
|
1393
1401
|
result = await renderHtml(result, isSpaMode);
|
|
1394
1402
|
}
|
|
1395
1403
|
return result;
|
|
@@ -1404,7 +1412,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1404
1412
|
}
|
|
1405
1413
|
if (context.errors) {
|
|
1406
1414
|
Object.values(context.errors).forEach((err) => {
|
|
1407
|
-
if (!
|
|
1415
|
+
if (!_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1408
1416
|
handleError(err);
|
|
1409
1417
|
}
|
|
1410
1418
|
});
|
|
@@ -1456,10 +1464,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1456
1464
|
} catch (error) {
|
|
1457
1465
|
handleError(error);
|
|
1458
1466
|
let errorForSecondRender = error;
|
|
1459
|
-
if (
|
|
1467
|
+
if (_chunk22I2H6CRjs.isResponse.call(void 0, error)) {
|
|
1460
1468
|
try {
|
|
1461
1469
|
let data2 = await unwrapResponse(error);
|
|
1462
|
-
errorForSecondRender = new (0,
|
|
1470
|
+
errorForSecondRender = new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(
|
|
1463
1471
|
error.status,
|
|
1464
1472
|
error.statusText,
|
|
1465
1473
|
data2
|
|
@@ -1467,7 +1475,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1467
1475
|
} catch (e) {
|
|
1468
1476
|
}
|
|
1469
1477
|
}
|
|
1470
|
-
context =
|
|
1478
|
+
context = _chunk22I2H6CRjs.getStaticContextFromError.call(void 0,
|
|
1471
1479
|
staticHandler.dataRoutes,
|
|
1472
1480
|
context,
|
|
1473
1481
|
errorForSecondRender
|
|
@@ -1526,7 +1534,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1526
1534
|
return handleQueryRouteError(error);
|
|
1527
1535
|
}
|
|
1528
1536
|
function handleQueryRouteResult(result) {
|
|
1529
|
-
if (
|
|
1537
|
+
if (_chunk22I2H6CRjs.isResponse.call(void 0, result)) {
|
|
1530
1538
|
return result;
|
|
1531
1539
|
}
|
|
1532
1540
|
if (typeof result === "string") {
|
|
@@ -1535,11 +1543,11 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1535
1543
|
return Response.json(result);
|
|
1536
1544
|
}
|
|
1537
1545
|
function handleQueryRouteError(error) {
|
|
1538
|
-
if (
|
|
1546
|
+
if (_chunk22I2H6CRjs.isResponse.call(void 0, error)) {
|
|
1539
1547
|
error.headers.set("X-Remix-Catch", "yes");
|
|
1540
1548
|
return error;
|
|
1541
1549
|
}
|
|
1542
|
-
if (
|
|
1550
|
+
if (_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1543
1551
|
handleError(error);
|
|
1544
1552
|
return errorResponseToJson(error, serverMode);
|
|
1545
1553
|
}
|
|
@@ -1665,7 +1673,7 @@ function createSessionStorage({
|
|
|
1665
1673
|
};
|
|
1666
1674
|
}
|
|
1667
1675
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1668
|
-
|
|
1676
|
+
_chunk22I2H6CRjs.warnOnce.call(void 0,
|
|
1669
1677
|
cookie.isSigned,
|
|
1670
1678
|
`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.`
|
|
1671
1679
|
);
|
|
@@ -1772,12 +1780,12 @@ function getHydrationData({
|
|
|
1772
1780
|
...state,
|
|
1773
1781
|
loaderData: { ...state.loaderData }
|
|
1774
1782
|
};
|
|
1775
|
-
let initialMatches =
|
|
1783
|
+
let initialMatches = _chunk22I2H6CRjs.matchRoutes.call(void 0, routes, location2, basename);
|
|
1776
1784
|
if (initialMatches) {
|
|
1777
1785
|
for (let match of initialMatches) {
|
|
1778
1786
|
let routeId = match.route.id;
|
|
1779
1787
|
let routeInfo = getRouteInfo(routeId);
|
|
1780
|
-
if (
|
|
1788
|
+
if (_chunk22I2H6CRjs.shouldHydrateRouteLoader.call(void 0,
|
|
1781
1789
|
routeId,
|
|
1782
1790
|
routeInfo.clientLoader,
|
|
1783
1791
|
routeInfo.hasLoader,
|
|
@@ -1855,7 +1863,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1855
1863
|
}
|
|
1856
1864
|
}
|
|
1857
1865
|
);
|
|
1858
|
-
if (
|
|
1866
|
+
if (_chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1859
1867
|
return /* @__PURE__ */ React.default.createElement(
|
|
1860
1868
|
ErrorWrapper,
|
|
1861
1869
|
{
|
|
@@ -1863,7 +1871,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1863
1871
|
title: "Unhandled Thrown Response!"
|
|
1864
1872
|
},
|
|
1865
1873
|
/* @__PURE__ */ React.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
1866
|
-
|
|
1874
|
+
_chunk22I2H6CRjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
1867
1875
|
);
|
|
1868
1876
|
}
|
|
1869
1877
|
let errorInstance;
|
|
@@ -1889,7 +1897,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1889
1897
|
function RSCDefaultRootErrorBoundary({
|
|
1890
1898
|
hasRootLayout
|
|
1891
1899
|
}) {
|
|
1892
|
-
let error =
|
|
1900
|
+
let error = _chunk22I2H6CRjs.useRouteError.call(void 0, );
|
|
1893
1901
|
if (hasRootLayout === void 0) {
|
|
1894
1902
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
1895
1903
|
}
|
|
@@ -2033,7 +2041,7 @@ function createRouterFromPayload({
|
|
|
2033
2041
|
populateRSCRouteModules(globalVar.__reactRouterRouteModules, payload.matches);
|
|
2034
2042
|
let patches = /* @__PURE__ */ new Map();
|
|
2035
2043
|
_optionalChain([payload, 'access', _20 => _20.patches, 'optionalAccess', _21 => _21.forEach, 'call', _22 => _22((patch) => {
|
|
2036
|
-
|
|
2044
|
+
_chunk22I2H6CRjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
2037
2045
|
if (!patches.has(patch.parentId)) {
|
|
2038
2046
|
patches.set(patch.parentId, []);
|
|
2039
2047
|
}
|
|
@@ -2055,11 +2063,11 @@ function createRouterFromPayload({
|
|
|
2055
2063
|
}
|
|
2056
2064
|
return [route];
|
|
2057
2065
|
}, []);
|
|
2058
|
-
globalVar.__reactRouterDataRouter =
|
|
2066
|
+
globalVar.__reactRouterDataRouter = _chunk22I2H6CRjs.createRouter.call(void 0, {
|
|
2059
2067
|
routes,
|
|
2060
2068
|
getContext,
|
|
2061
2069
|
basename: payload.basename,
|
|
2062
|
-
history:
|
|
2070
|
+
history: _chunk22I2H6CRjs.createBrowserHistory.call(void 0, ),
|
|
2063
2071
|
hydrationData: getHydrationData({
|
|
2064
2072
|
state: {
|
|
2065
2073
|
loaderData: payload.loaderData,
|
|
@@ -2069,7 +2077,7 @@ function createRouterFromPayload({
|
|
|
2069
2077
|
routes,
|
|
2070
2078
|
getRouteInfo: (routeId) => {
|
|
2071
2079
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
2072
|
-
|
|
2080
|
+
_chunk22I2H6CRjs.invariant.call(void 0, match, "Route not found in payload");
|
|
2073
2081
|
return {
|
|
2074
2082
|
clientLoader: match.clientLoader,
|
|
2075
2083
|
hasLoader: match.hasLoader,
|
|
@@ -2167,9 +2175,9 @@ function createRouterFromPayload({
|
|
|
2167
2175
|
routeModules: globalVar.__reactRouterRouteModules
|
|
2168
2176
|
};
|
|
2169
2177
|
}
|
|
2170
|
-
var renderedRoutesContext =
|
|
2178
|
+
var renderedRoutesContext = _chunk22I2H6CRjs.createContext.call(void 0, );
|
|
2171
2179
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
2172
|
-
let dataStrategy =
|
|
2180
|
+
let dataStrategy = _chunk22I2H6CRjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
2173
2181
|
getRouter,
|
|
2174
2182
|
(match) => {
|
|
2175
2183
|
let M = match;
|
|
@@ -2223,20 +2231,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2223
2231
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
2224
2232
|
return async (args, basename, targetRoutes) => {
|
|
2225
2233
|
let { request, context } = args;
|
|
2226
|
-
let url =
|
|
2234
|
+
let url = _chunk22I2H6CRjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
2227
2235
|
if (request.method === "GET") {
|
|
2228
|
-
url =
|
|
2236
|
+
url = _chunk22I2H6CRjs.stripIndexParam.call(void 0, url);
|
|
2229
2237
|
if (targetRoutes) {
|
|
2230
2238
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
2231
2239
|
}
|
|
2232
2240
|
}
|
|
2233
2241
|
let res = await fetchImplementation(
|
|
2234
|
-
new Request(url, await
|
|
2242
|
+
new Request(url, await _chunk22I2H6CRjs.createRequestInit.call(void 0, request))
|
|
2235
2243
|
);
|
|
2236
2244
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
2237
|
-
throw new (0,
|
|
2245
|
+
throw new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(404, "Not Found", true);
|
|
2238
2246
|
}
|
|
2239
|
-
|
|
2247
|
+
_chunk22I2H6CRjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
2240
2248
|
try {
|
|
2241
2249
|
const payload = await createFromReadableStream(res.body, {
|
|
2242
2250
|
temporaryReferences: void 0
|
|
@@ -2260,7 +2268,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
2260
2268
|
}
|
|
2261
2269
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
2262
2270
|
let results = { routes: {} };
|
|
2263
|
-
const dataKey =
|
|
2271
|
+
const dataKey = _chunk22I2H6CRjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
2264
2272
|
for (let [routeId, data2] of Object.entries(payload[dataKey] || {})) {
|
|
2265
2273
|
results.routes[routeId] = { data: data2 };
|
|
2266
2274
|
}
|
|
@@ -2293,7 +2301,7 @@ function RSCHydratedRouter({
|
|
|
2293
2301
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
2294
2302
|
);
|
|
2295
2303
|
React4.useEffect(() => {
|
|
2296
|
-
|
|
2304
|
+
_chunk22I2H6CRjs.setIsHydrated.call(void 0, );
|
|
2297
2305
|
}, []);
|
|
2298
2306
|
React4.useLayoutEffect(() => {
|
|
2299
2307
|
const globalVar = window;
|
|
@@ -2380,7 +2388,7 @@ function RSCHydratedRouter({
|
|
|
2380
2388
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2381
2389
|
routeModules
|
|
2382
2390
|
};
|
|
2383
|
-
return /* @__PURE__ */ React4.createElement(
|
|
2391
|
+
return /* @__PURE__ */ React4.createElement(_chunk22I2H6CRjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(_chunk22I2H6CRjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(_chunkK4BWIVAIjs.RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2384
2392
|
}
|
|
2385
2393
|
function createRouteFromServerManifest(match, payload) {
|
|
2386
2394
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -2391,7 +2399,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2391
2399
|
// the server loader flow regardless of whether the client loader calls
|
|
2392
2400
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
2393
2401
|
match.hasComponent && !match.element;
|
|
2394
|
-
|
|
2402
|
+
_chunk22I2H6CRjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
2395
2403
|
populateRSCRouteModules(window.__reactRouterRouteModules, match);
|
|
2396
2404
|
let dataRoute = {
|
|
2397
2405
|
id: match.id,
|
|
@@ -2442,7 +2450,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2442
2450
|
return await callSingleFetch(singleFetch);
|
|
2443
2451
|
}
|
|
2444
2452
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
2445
|
-
throw
|
|
2453
|
+
throw _chunk22I2H6CRjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
2446
2454
|
},
|
|
2447
2455
|
path: match.path,
|
|
2448
2456
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -2455,7 +2463,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2455
2463
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
2456
2464
|
};
|
|
2457
2465
|
if (typeof dataRoute.loader === "function") {
|
|
2458
|
-
dataRoute.loader.hydrate =
|
|
2466
|
+
dataRoute.loader.hydrate = _chunk22I2H6CRjs.shouldHydrateRouteLoader.call(void 0,
|
|
2459
2467
|
match.id,
|
|
2460
2468
|
match.clientLoader,
|
|
2461
2469
|
match.hasLoader,
|
|
@@ -2465,7 +2473,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2465
2473
|
return dataRoute;
|
|
2466
2474
|
}
|
|
2467
2475
|
function callSingleFetch(singleFetch) {
|
|
2468
|
-
|
|
2476
|
+
_chunk22I2H6CRjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
2469
2477
|
return singleFetch();
|
|
2470
2478
|
}
|
|
2471
2479
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -2473,7 +2481,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
2473
2481
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
2474
2482
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
2475
2483
|
console.error(msg);
|
|
2476
|
-
throw new (0,
|
|
2484
|
+
throw new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
2477
2485
|
}
|
|
2478
2486
|
}
|
|
2479
2487
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -2493,7 +2501,7 @@ function getManifestUrl(paths) {
|
|
|
2493
2501
|
""
|
|
2494
2502
|
);
|
|
2495
2503
|
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
|
2496
|
-
|
|
2504
|
+
url.searchParams.set("paths", paths.sort().join(","));
|
|
2497
2505
|
return url;
|
|
2498
2506
|
}
|
|
2499
2507
|
async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fetchImplementation, signal) {
|
|
@@ -2687,8 +2695,28 @@ async function routeRSCServerRequest({
|
|
|
2687
2695
|
}
|
|
2688
2696
|
});
|
|
2689
2697
|
};
|
|
2690
|
-
|
|
2691
|
-
|
|
2698
|
+
let deepestRenderedBoundaryId = null;
|
|
2699
|
+
const getPayload = () => {
|
|
2700
|
+
const payloadPromise = Promise.resolve(
|
|
2701
|
+
createFromReadableStream(createStream())
|
|
2702
|
+
);
|
|
2703
|
+
return Object.defineProperties(payloadPromise, {
|
|
2704
|
+
_deepestRenderedBoundaryId: {
|
|
2705
|
+
get() {
|
|
2706
|
+
return deepestRenderedBoundaryId;
|
|
2707
|
+
},
|
|
2708
|
+
set(boundaryId) {
|
|
2709
|
+
deepestRenderedBoundaryId = boundaryId;
|
|
2710
|
+
}
|
|
2711
|
+
},
|
|
2712
|
+
formState: {
|
|
2713
|
+
get() {
|
|
2714
|
+
return payloadPromise.then(
|
|
2715
|
+
(payload) => payload.type === "render" ? payload.formState : void 0
|
|
2716
|
+
);
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2692
2720
|
};
|
|
2693
2721
|
try {
|
|
2694
2722
|
if (!detectRedirectResponse.body) {
|
|
@@ -2697,7 +2725,7 @@ async function routeRSCServerRequest({
|
|
|
2697
2725
|
const payload = await createFromReadableStream(
|
|
2698
2726
|
detectRedirectResponse.body
|
|
2699
2727
|
);
|
|
2700
|
-
if (serverResponse.status ===
|
|
2728
|
+
if (serverResponse.status === _chunk22I2H6CRjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2701
2729
|
const headers2 = new Headers(serverResponse.headers);
|
|
2702
2730
|
headers2.delete("Content-Encoding");
|
|
2703
2731
|
headers2.delete("Content-Length");
|
|
@@ -2712,7 +2740,7 @@ async function routeRSCServerRequest({
|
|
|
2712
2740
|
}
|
|
2713
2741
|
const html = await renderHTML(getPayload);
|
|
2714
2742
|
const headers = new Headers(serverResponse.headers);
|
|
2715
|
-
headers.set("Content-Type", "text/html");
|
|
2743
|
+
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2716
2744
|
if (!hydrate) {
|
|
2717
2745
|
return new Response(html, {
|
|
2718
2746
|
status: serverResponse.status,
|
|
@@ -2731,11 +2759,62 @@ async function routeRSCServerRequest({
|
|
|
2731
2759
|
if (reason instanceof Response) {
|
|
2732
2760
|
return reason;
|
|
2733
2761
|
}
|
|
2762
|
+
try {
|
|
2763
|
+
const status = _chunk22I2H6CRjs.isRouteErrorResponse.call(void 0, reason) ? reason.status : 500;
|
|
2764
|
+
const html = await renderHTML(() => {
|
|
2765
|
+
const decoded = Promise.resolve(
|
|
2766
|
+
createFromReadableStream(createStream())
|
|
2767
|
+
);
|
|
2768
|
+
const payloadPromise = decoded.then(
|
|
2769
|
+
(payload) => Object.assign(payload, {
|
|
2770
|
+
status,
|
|
2771
|
+
errors: deepestRenderedBoundaryId ? {
|
|
2772
|
+
[deepestRenderedBoundaryId]: reason
|
|
2773
|
+
} : {}
|
|
2774
|
+
})
|
|
2775
|
+
);
|
|
2776
|
+
return Object.defineProperties(payloadPromise, {
|
|
2777
|
+
_deepestRenderedBoundaryId: {
|
|
2778
|
+
get() {
|
|
2779
|
+
return deepestRenderedBoundaryId;
|
|
2780
|
+
},
|
|
2781
|
+
set(boundaryId) {
|
|
2782
|
+
deepestRenderedBoundaryId = boundaryId;
|
|
2783
|
+
}
|
|
2784
|
+
},
|
|
2785
|
+
formState: {
|
|
2786
|
+
get() {
|
|
2787
|
+
return payloadPromise.then(
|
|
2788
|
+
(payload) => payload.type === "render" ? payload.formState : void 0
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
});
|
|
2794
|
+
const headers = new Headers(serverResponse.headers);
|
|
2795
|
+
headers.set("Content-Type", "text/html");
|
|
2796
|
+
if (!hydrate) {
|
|
2797
|
+
return new Response(html, {
|
|
2798
|
+
status,
|
|
2799
|
+
headers
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _39 => _39.body])) {
|
|
2803
|
+
throw new Error("Failed to clone server response");
|
|
2804
|
+
}
|
|
2805
|
+
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body));
|
|
2806
|
+
return new Response(body2, {
|
|
2807
|
+
status,
|
|
2808
|
+
headers
|
|
2809
|
+
});
|
|
2810
|
+
} catch (e2) {
|
|
2811
|
+
}
|
|
2734
2812
|
throw reason;
|
|
2735
2813
|
}
|
|
2736
2814
|
}
|
|
2737
2815
|
function RSCStaticRouter({ getPayload }) {
|
|
2738
|
-
const
|
|
2816
|
+
const decoded = getPayload();
|
|
2817
|
+
const payload = useSafe(decoded);
|
|
2739
2818
|
if (payload.type === "redirect") {
|
|
2740
2819
|
throw new Response(null, {
|
|
2741
2820
|
status: payload.status,
|
|
@@ -2747,7 +2826,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2747
2826
|
if (payload.type !== "render") return null;
|
|
2748
2827
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2749
2828
|
for (const match of payload.matches) {
|
|
2750
|
-
if (
|
|
2829
|
+
if (_chunk22I2H6CRjs.shouldHydrateRouteLoader.call(void 0,
|
|
2751
2830
|
match.id,
|
|
2752
2831
|
match.clientLoader,
|
|
2753
2832
|
match.hasLoader,
|
|
@@ -2757,6 +2836,12 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2757
2836
|
}
|
|
2758
2837
|
}
|
|
2759
2838
|
const context = {
|
|
2839
|
+
get _deepestRenderedBoundaryId() {
|
|
2840
|
+
return _nullishCoalesce(decoded._deepestRenderedBoundaryId, () => ( null));
|
|
2841
|
+
},
|
|
2842
|
+
set _deepestRenderedBoundaryId(boundaryId) {
|
|
2843
|
+
decoded._deepestRenderedBoundaryId = boundaryId;
|
|
2844
|
+
},
|
|
2760
2845
|
actionData: payload.actionData,
|
|
2761
2846
|
actionHeaders: {},
|
|
2762
2847
|
basename: payload.basename,
|
|
@@ -2781,7 +2866,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2781
2866
|
}
|
|
2782
2867
|
}))
|
|
2783
2868
|
};
|
|
2784
|
-
const router =
|
|
2869
|
+
const router = _chunkK4BWIVAIjs.createStaticRouter.call(void 0,
|
|
2785
2870
|
payload.matches.reduceRight((previous, match) => {
|
|
2786
2871
|
const route = {
|
|
2787
2872
|
id: match.id,
|
|
@@ -2825,8 +2910,8 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2825
2910
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2826
2911
|
routeModules: createRSCRouteModules(payload)
|
|
2827
2912
|
};
|
|
2828
|
-
return /* @__PURE__ */ React5.createElement(
|
|
2829
|
-
|
|
2913
|
+
return /* @__PURE__ */ React5.createElement(_chunk22I2H6CRjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(_chunk22I2H6CRjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2914
|
+
_chunkK4BWIVAIjs.StaticRouterProvider,
|
|
2830
2915
|
{
|
|
2831
2916
|
context,
|
|
2832
2917
|
router,
|
|
@@ -2869,10 +2954,10 @@ function getRSCStream() {
|
|
|
2869
2954
|
});
|
|
2870
2955
|
if (typeof document !== "undefined" && document.readyState === "loading") {
|
|
2871
2956
|
document.addEventListener("DOMContentLoaded", () => {
|
|
2872
|
-
_optionalChain([streamController, 'optionalAccess',
|
|
2957
|
+
_optionalChain([streamController, 'optionalAccess', _40 => _40.close, 'call', _41 => _41()]);
|
|
2873
2958
|
});
|
|
2874
2959
|
} else {
|
|
2875
|
-
_optionalChain([streamController, 'optionalAccess',
|
|
2960
|
+
_optionalChain([streamController, 'optionalAccess', _42 => _42.close, 'call', _43 => _43()]);
|
|
2876
2961
|
}
|
|
2877
2962
|
return rscStream;
|
|
2878
2963
|
}
|
|
@@ -2884,7 +2969,7 @@ function deserializeErrors(errors) {
|
|
|
2884
2969
|
let serialized = {};
|
|
2885
2970
|
for (let [key, val] of entries) {
|
|
2886
2971
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2887
|
-
serialized[key] = new (0,
|
|
2972
|
+
serialized[key] = new (0, _chunk22I2H6CRjs.ErrorResponseImpl)(
|
|
2888
2973
|
val.status,
|
|
2889
2974
|
val.statusText,
|
|
2890
2975
|
val.data,
|
|
@@ -3043,4 +3128,4 @@ function deserializeErrors(errors) {
|
|
|
3043
3128
|
|
|
3044
3129
|
|
|
3045
3130
|
|
|
3046
|
-
exports.Await =
|
|
3131
|
+
exports.Await = _chunkK4BWIVAIjs.Await; exports.BrowserRouter = _chunkK4BWIVAIjs.BrowserRouter; exports.Form = _chunkK4BWIVAIjs.Form; exports.HashRouter = _chunkK4BWIVAIjs.HashRouter; exports.IDLE_BLOCKER = _chunk22I2H6CRjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunk22I2H6CRjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunk22I2H6CRjs.IDLE_NAVIGATION; exports.Link = _chunkK4BWIVAIjs.Link; exports.Links = _chunk22I2H6CRjs.Links; exports.MemoryRouter = _chunkK4BWIVAIjs.MemoryRouter; exports.Meta = _chunk22I2H6CRjs.Meta; exports.NavLink = _chunkK4BWIVAIjs.NavLink; exports.Navigate = _chunkK4BWIVAIjs.Navigate; exports.NavigationType = _chunk22I2H6CRjs.Action; exports.Outlet = _chunkK4BWIVAIjs.Outlet; exports.PrefetchPageLinks = _chunk22I2H6CRjs.PrefetchPageLinks; exports.Route = _chunkK4BWIVAIjs.Route; exports.Router = _chunkK4BWIVAIjs.Router; exports.RouterContextProvider = _chunk22I2H6CRjs.RouterContextProvider; exports.RouterProvider = _chunkK4BWIVAIjs.RouterProvider; exports.Routes = _chunkK4BWIVAIjs.Routes; exports.Scripts = _chunk22I2H6CRjs.Scripts; exports.ScrollRestoration = _chunkK4BWIVAIjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunkK4BWIVAIjs.StaticRouter; exports.StaticRouterProvider = _chunkK4BWIVAIjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk22I2H6CRjs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunk22I2H6CRjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunk22I2H6CRjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunk22I2H6CRjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunk22I2H6CRjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunk22I2H6CRjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunk22I2H6CRjs.LocationContext; exports.UNSAFE_NavigationContext = _chunk22I2H6CRjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunk22I2H6CRjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunk22I2H6CRjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunk22I2H6CRjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunk22I2H6CRjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkK4BWIVAIjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkK4BWIVAIjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkK4BWIVAIjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunk22I2H6CRjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunk22I2H6CRjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunk22I2H6CRjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunk22I2H6CRjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunk22I2H6CRjs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunk22I2H6CRjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunk22I2H6CRjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkK4BWIVAIjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunk22I2H6CRjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkK4BWIVAIjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunk22I2H6CRjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunk22I2H6CRjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunkK4BWIVAIjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkK4BWIVAIjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkK4BWIVAIjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkK4BWIVAIjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunkK4BWIVAIjs.createBrowserRouter; exports.createContext = _chunk22I2H6CRjs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunkK4BWIVAIjs.createHashRouter; exports.createMemoryRouter = _chunkK4BWIVAIjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunk22I2H6CRjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkK4BWIVAIjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkK4BWIVAIjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunkK4BWIVAIjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunkK4BWIVAIjs.createStaticHandler; exports.createStaticRouter = _chunkK4BWIVAIjs.createStaticRouter; exports.data = _chunk22I2H6CRjs.data; exports.generatePath = _chunk22I2H6CRjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunk22I2H6CRjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunk22I2H6CRjs.matchPath; exports.matchRoutes = _chunk22I2H6CRjs.matchRoutes; exports.parsePath = _chunk22I2H6CRjs.parsePath; exports.redirect = _chunk22I2H6CRjs.redirect; exports.redirectDocument = _chunk22I2H6CRjs.redirectDocument; exports.renderMatches = _chunkK4BWIVAIjs.renderMatches; exports.replace = _chunk22I2H6CRjs.replace; exports.resolvePath = _chunk22I2H6CRjs.resolvePath; exports.unstable_HistoryRouter = _chunkK4BWIVAIjs.HistoryRouter; exports.unstable_RSCHydratedRouter = RSCHydratedRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_createCallServer = createCallServer; exports.unstable_getRSCStream = getRSCStream; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunkK4BWIVAIjs.usePrompt; exports.useActionData = _chunk22I2H6CRjs.useActionData; exports.useAsyncError = _chunk22I2H6CRjs.useAsyncError; exports.useAsyncValue = _chunk22I2H6CRjs.useAsyncValue; exports.useBeforeUnload = _chunkK4BWIVAIjs.useBeforeUnload; exports.useBlocker = _chunk22I2H6CRjs.useBlocker; exports.useFetcher = _chunkK4BWIVAIjs.useFetcher; exports.useFetchers = _chunkK4BWIVAIjs.useFetchers; exports.useFormAction = _chunkK4BWIVAIjs.useFormAction; exports.useHref = _chunk22I2H6CRjs.useHref; exports.useInRouterContext = _chunk22I2H6CRjs.useInRouterContext; exports.useLinkClickHandler = _chunkK4BWIVAIjs.useLinkClickHandler; exports.useLoaderData = _chunk22I2H6CRjs.useLoaderData; exports.useLocation = _chunk22I2H6CRjs.useLocation; exports.useMatch = _chunk22I2H6CRjs.useMatch; exports.useMatches = _chunk22I2H6CRjs.useMatches; exports.useNavigate = _chunk22I2H6CRjs.useNavigate; exports.useNavigation = _chunk22I2H6CRjs.useNavigation; exports.useNavigationType = _chunk22I2H6CRjs.useNavigationType; exports.useOutlet = _chunk22I2H6CRjs.useOutlet; exports.useOutletContext = _chunk22I2H6CRjs.useOutletContext; exports.useParams = _chunk22I2H6CRjs.useParams; exports.useResolvedPath = _chunk22I2H6CRjs.useResolvedPath; exports.useRevalidator = _chunk22I2H6CRjs.useRevalidator; exports.useRouteError = _chunk22I2H6CRjs.useRouteError; exports.useRouteLoaderData = _chunk22I2H6CRjs.useRouteLoaderData; exports.useRoutes = _chunk22I2H6CRjs.useRoutes; exports.useSearchParams = _chunkK4BWIVAIjs.useSearchParams; exports.useSubmit = _chunkK4BWIVAIjs.useSubmit; exports.useViewTransitionState = _chunkK4BWIVAIjs.useViewTransitionState;
|