react-router 7.10.1-pre.0 → 7.11.0-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 +30 -2
- package/dist/development/{browser-BpxEZgZC.d.ts → browser-Cv4JZyZ5.d.mts} +4 -3
- package/dist/{production/browser-BpxEZgZC.d.ts → development/browser-o-qhcuhA.d.ts} +4 -3
- package/dist/{production/chunk-7NETFFGG.js → development/chunk-JKMHOZYW.js} +111 -121
- package/dist/development/{chunk-SC4UA6B4.mjs → chunk-KRMLYMWA.mjs} +231 -74
- package/dist/development/{chunk-VPK5G3S4.js → chunk-OVG6YSZ5.js} +7 -7
- package/dist/development/{chunk-X3LLUSK4.mjs → chunk-QMKP6CC3.mjs} +147 -38
- package/dist/development/{chunk-BFZIIKOS.js → chunk-UO7KGW2U.js} +279 -110
- package/dist/development/dom-export.d.mts +11 -10
- package/dist/development/dom-export.d.ts +12 -11
- package/dist/development/dom-export.js +30 -31
- package/dist/development/dom-export.mjs +6 -7
- package/dist/{production/index-react-server-client-CCjKYJTH.d.ts → development/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
- package/dist/development/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
- package/dist/development/index-react-server-client.d.mts +2 -2
- 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 +4 -2
- package/dist/development/index-react-server.d.ts +4 -2
- package/dist/development/index-react-server.js +72 -19
- package/dist/development/index-react-server.mjs +72 -19
- package/dist/development/index.d.mts +17 -16
- package/dist/development/index.d.ts +17 -16
- package/dist/development/index.js +220 -111
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-BB0wRuqz.d.ts → development/instrumentation-BlrVzjbg.d.ts} +30 -15
- package/dist/development/lib/types/internal.d.mts +2 -2
- 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/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
- package/dist/development/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
- package/dist/development/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
- package/dist/{development/browser-C5z6FZmz.d.mts → production/browser-Cv4JZyZ5.d.mts} +4 -3
- package/dist/production/{browser-C5z6FZmz.d.mts → browser-o-qhcuhA.d.ts} +4 -3
- package/dist/production/{chunk-322RSYEJ.js → chunk-AO22ZXHI.js} +279 -110
- package/dist/production/{chunk-FI4GMOFC.mjs → chunk-IDHO4Q57.mjs} +231 -74
- package/dist/production/{chunk-KT4GS4WF.mjs → chunk-J4JITZ76.mjs} +147 -38
- package/dist/{development/chunk-NUGUL5OD.js → production/chunk-M5W3Q3T5.js} +111 -121
- package/dist/production/{chunk-3WZYQEC5.js → chunk-YGB3JEIP.js} +7 -7
- package/dist/production/dom-export.d.mts +11 -10
- package/dist/production/dom-export.d.ts +12 -11
- package/dist/production/dom-export.js +30 -31
- package/dist/production/dom-export.mjs +6 -7
- package/dist/{development/index-react-server-client-CCjKYJTH.d.ts → production/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
- package/dist/production/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
- package/dist/production/index-react-server-client.d.mts +2 -2
- 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 +4 -2
- package/dist/production/index-react-server.d.ts +4 -2
- package/dist/production/index-react-server.js +72 -19
- package/dist/production/index-react-server.mjs +72 -19
- package/dist/production/index.d.mts +17 -16
- package/dist/production/index.d.ts +17 -16
- package/dist/production/index.js +220 -111
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-BB0wRuqz.d.ts → production/instrumentation-BlrVzjbg.d.ts} +30 -15
- package/dist/production/lib/types/internal.d.mts +2 -2
- 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/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
- package/dist/production/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
- package/dist/production/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
- package/package.json +5 -4
|
@@ -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.
|
|
2
|
+
* react-router v7.11.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkOVG6YSZ5js = require('./chunk-OVG6YSZ5.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ var _chunkVPK5G3S4js = require('./chunk-VPK5G3S4.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkJKMHOZYWjs = require('./chunk-JKMHOZYW.js');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -145,7 +145,9 @@ var _chunkNUGUL5ODjs = require('./chunk-NUGUL5OD.js');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
var _chunkUO7KGW2Ujs = require('./chunk-UO7KGW2U.js');
|
|
149
151
|
|
|
150
152
|
// lib/dom/ssr/server.tsx
|
|
151
153
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -158,7 +160,7 @@ function ServerRouter({
|
|
|
158
160
|
url = new URL(url);
|
|
159
161
|
}
|
|
160
162
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
161
|
-
let routes =
|
|
163
|
+
let routes = _chunkUO7KGW2Ujs.createServerRoutes.call(void 0,
|
|
162
164
|
manifest.routes,
|
|
163
165
|
routeModules,
|
|
164
166
|
context.future,
|
|
@@ -171,7 +173,7 @@ function ServerRouter({
|
|
|
171
173
|
let routeId = match.route.id;
|
|
172
174
|
let route = routeModules[routeId];
|
|
173
175
|
let manifestRoute = context.manifest.routes[routeId];
|
|
174
|
-
if (route && manifestRoute &&
|
|
176
|
+
if (route && manifestRoute && _chunkUO7KGW2Ujs.shouldHydrateRouteLoader.call(void 0,
|
|
175
177
|
routeId,
|
|
176
178
|
route.clientLoader,
|
|
177
179
|
manifestRoute.hasLoader,
|
|
@@ -180,9 +182,9 @@ function ServerRouter({
|
|
|
180
182
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
|
-
let router =
|
|
185
|
+
let router = _chunkJKMHOZYWjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
184
186
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
185
|
-
|
|
187
|
+
_chunkUO7KGW2Ujs.FrameworkContext.Provider,
|
|
186
188
|
{
|
|
187
189
|
value: {
|
|
188
190
|
manifest,
|
|
@@ -197,8 +199,8 @@ function ServerRouter({
|
|
|
197
199
|
renderMeta: context.renderMeta
|
|
198
200
|
}
|
|
199
201
|
},
|
|
200
|
-
/* @__PURE__ */ React.createElement(
|
|
201
|
-
|
|
202
|
+
/* @__PURE__ */ React.createElement(_chunkUO7KGW2Ujs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
203
|
+
_chunkJKMHOZYWjs.StaticRouterProvider,
|
|
202
204
|
{
|
|
203
205
|
router,
|
|
204
206
|
context: context.staticHandlerContext,
|
|
@@ -206,7 +208,7 @@ function ServerRouter({
|
|
|
206
208
|
}
|
|
207
209
|
))
|
|
208
210
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
209
|
-
|
|
211
|
+
_chunkUO7KGW2Ujs.StreamTransfer,
|
|
210
212
|
{
|
|
211
213
|
context,
|
|
212
214
|
identifier: 0,
|
|
@@ -248,18 +250,18 @@ function createRoutesStub(routes, _context) {
|
|
|
248
250
|
let patched = processRoutes(
|
|
249
251
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
250
252
|
// types compared to `AgnosticRouteObject`
|
|
251
|
-
|
|
252
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0,
|
|
253
|
+
_chunkUO7KGW2Ujs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
254
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.v8_middleware]) ? new (0, _chunkUO7KGW2Ujs.RouterContextProvider)() : {},
|
|
253
255
|
frameworkContextRef.current.manifest,
|
|
254
256
|
frameworkContextRef.current.routeModules
|
|
255
257
|
);
|
|
256
|
-
routerRef.current =
|
|
258
|
+
routerRef.current = _chunkUO7KGW2Ujs.createMemoryRouter.call(void 0, patched, {
|
|
257
259
|
initialEntries,
|
|
258
260
|
initialIndex,
|
|
259
261
|
hydrationData
|
|
260
262
|
});
|
|
261
263
|
}
|
|
262
|
-
return /* @__PURE__ */ React2.createElement(
|
|
264
|
+
return /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkUO7KGW2Ujs.RouterProvider, { router: routerRef.current }));
|
|
263
265
|
};
|
|
264
266
|
}
|
|
265
267
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -273,9 +275,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
273
275
|
id: route.id,
|
|
274
276
|
path: route.path,
|
|
275
277
|
index: route.index,
|
|
276
|
-
Component: route.Component ?
|
|
277
|
-
HydrateFallback: route.HydrateFallback ?
|
|
278
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
278
|
+
Component: route.Component ? _chunkUO7KGW2Ujs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
279
|
+
HydrateFallback: route.HydrateFallback ? _chunkUO7KGW2Ujs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
280
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkUO7KGW2Ujs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
279
281
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
280
282
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
281
283
|
middleware: route.middleware ? route.middleware.map(
|
|
@@ -310,7 +312,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
310
312
|
};
|
|
311
313
|
manifest.routes[newRoute.id] = entryRoute;
|
|
312
314
|
routeModules[route.id] = {
|
|
313
|
-
default: newRoute.Component ||
|
|
315
|
+
default: newRoute.Component || _chunkUO7KGW2Ujs.Outlet,
|
|
314
316
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
315
317
|
handle: route.handle,
|
|
316
318
|
links: route.links,
|
|
@@ -505,7 +507,7 @@ function myUnescape(value) {
|
|
|
505
507
|
return result;
|
|
506
508
|
}
|
|
507
509
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
508
|
-
|
|
510
|
+
_chunkUO7KGW2Ujs.warnOnce.call(void 0,
|
|
509
511
|
!expires,
|
|
510
512
|
`The "${name}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`
|
|
511
513
|
);
|
|
@@ -559,7 +561,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
559
561
|
let entries = Object.entries(errors);
|
|
560
562
|
let serialized = {};
|
|
561
563
|
for (let [key, val] of entries) {
|
|
562
|
-
if (
|
|
564
|
+
if (_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, val)) {
|
|
563
565
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
564
566
|
} else if (val instanceof Error) {
|
|
565
567
|
let sanitized = sanitizeError(val, serverMode);
|
|
@@ -584,7 +586,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
584
586
|
|
|
585
587
|
// lib/server-runtime/routeMatching.ts
|
|
586
588
|
function matchServerRoutes(routes, pathname, basename) {
|
|
587
|
-
let matches =
|
|
589
|
+
let matches = _chunkUO7KGW2Ujs.matchRoutes.call(void 0,
|
|
588
590
|
routes,
|
|
589
591
|
pathname,
|
|
590
592
|
basename
|
|
@@ -605,7 +607,7 @@ async function callRouteHandler(handler, args) {
|
|
|
605
607
|
context: args.context,
|
|
606
608
|
unstable_pattern: args.unstable_pattern
|
|
607
609
|
});
|
|
608
|
-
if (
|
|
610
|
+
if (_chunkUO7KGW2Ujs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkUO7KGW2Ujs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
609
611
|
throw new Response(null, result.init);
|
|
610
612
|
}
|
|
611
613
|
return result;
|
|
@@ -724,17 +726,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
724
726
|
controller.close();
|
|
725
727
|
}
|
|
726
728
|
});
|
|
727
|
-
let decoded = await
|
|
729
|
+
let decoded = await _chunkUO7KGW2Ujs.decodeViaTurboStream.call(void 0, stream, global);
|
|
728
730
|
let data2 = decoded.value;
|
|
729
|
-
if (data2 &&
|
|
730
|
-
let result = data2[
|
|
731
|
+
if (data2 && _chunkUO7KGW2Ujs.SingleFetchRedirectSymbol in data2) {
|
|
732
|
+
let result = data2[_chunkUO7KGW2Ujs.SingleFetchRedirectSymbol];
|
|
731
733
|
let init = { status: result.status };
|
|
732
734
|
if (result.reload) {
|
|
733
|
-
throw
|
|
735
|
+
throw _chunkUO7KGW2Ujs.redirectDocument.call(void 0, result.redirect, init);
|
|
734
736
|
} else if (result.replace) {
|
|
735
|
-
throw
|
|
737
|
+
throw _chunkUO7KGW2Ujs.replace.call(void 0, result.redirect, init);
|
|
736
738
|
} else {
|
|
737
|
-
throw
|
|
739
|
+
throw _chunkUO7KGW2Ujs.redirect.call(void 0, result.redirect, init);
|
|
738
740
|
}
|
|
739
741
|
} else {
|
|
740
742
|
invariant2(
|
|
@@ -773,7 +775,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
773
775
|
|
|
774
776
|
// lib/server-runtime/serverHandoff.ts
|
|
775
777
|
function createServerHandoffString(serverHandoff) {
|
|
776
|
-
return
|
|
778
|
+
return _chunkUO7KGW2Ujs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
777
779
|
}
|
|
778
780
|
|
|
779
781
|
// lib/server-runtime/headers.ts
|
|
@@ -850,7 +852,7 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
850
852
|
|
|
851
853
|
// lib/server-runtime/single-fetch.ts
|
|
852
854
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
853
|
-
...
|
|
855
|
+
..._chunkUO7KGW2Ujs.NO_BODY_STATUS_CODES,
|
|
854
856
|
304
|
|
855
857
|
]);
|
|
856
858
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
@@ -880,7 +882,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
880
882
|
return handleQueryError(error);
|
|
881
883
|
}
|
|
882
884
|
function handleQueryResult(result) {
|
|
883
|
-
return
|
|
885
|
+
return _chunkUO7KGW2Ujs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
884
886
|
}
|
|
885
887
|
function handleQueryError(error) {
|
|
886
888
|
handleError(error);
|
|
@@ -892,12 +894,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
892
894
|
}
|
|
893
895
|
function staticContextToResponse(context) {
|
|
894
896
|
let headers = getDocumentHeaders(context, build);
|
|
895
|
-
if (
|
|
897
|
+
if (_chunkUO7KGW2Ujs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
896
898
|
return new Response(null, { status: context.statusCode, headers });
|
|
897
899
|
}
|
|
898
900
|
if (context.errors) {
|
|
899
901
|
Object.values(context.errors).forEach((err) => {
|
|
900
|
-
if (!
|
|
902
|
+
if (!_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
901
903
|
handleError(err);
|
|
902
904
|
}
|
|
903
905
|
});
|
|
@@ -944,7 +946,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
944
946
|
return handleQueryError(error);
|
|
945
947
|
}
|
|
946
948
|
function handleQueryResult(result) {
|
|
947
|
-
return
|
|
949
|
+
return _chunkUO7KGW2Ujs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
948
950
|
}
|
|
949
951
|
function handleQueryError(error) {
|
|
950
952
|
handleError(error);
|
|
@@ -956,12 +958,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
956
958
|
}
|
|
957
959
|
function staticContextToResponse(context) {
|
|
958
960
|
let headers = getDocumentHeaders(context, build);
|
|
959
|
-
if (
|
|
961
|
+
if (_chunkUO7KGW2Ujs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
960
962
|
return new Response(null, { status: context.statusCode, headers });
|
|
961
963
|
}
|
|
962
964
|
if (context.errors) {
|
|
963
965
|
Object.values(context.errors).forEach((err) => {
|
|
964
|
-
if (!
|
|
966
|
+
if (!_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
965
967
|
handleError(err);
|
|
966
968
|
}
|
|
967
969
|
});
|
|
@@ -1025,15 +1027,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1025
1027
|
headers.delete("Location");
|
|
1026
1028
|
headers.set("Content-Type", "text/x-script");
|
|
1027
1029
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1028
|
-
result: request.method === "GET" ? { [
|
|
1030
|
+
result: request.method === "GET" ? { [_chunkUO7KGW2Ujs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1029
1031
|
headers,
|
|
1030
|
-
status:
|
|
1032
|
+
status: _chunkUO7KGW2Ujs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1031
1033
|
});
|
|
1032
1034
|
}
|
|
1033
1035
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1034
1036
|
let redirect2 = headers.get("Location");
|
|
1035
1037
|
if (basename) {
|
|
1036
|
-
redirect2 =
|
|
1038
|
+
redirect2 = _chunkUO7KGW2Ujs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1037
1039
|
}
|
|
1038
1040
|
return {
|
|
1039
1041
|
redirect: redirect2,
|
|
@@ -1059,7 +1061,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1059
1061
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1060
1062
|
);
|
|
1061
1063
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1062
|
-
return
|
|
1064
|
+
return _chunkUO7KGW2Ujs.encode.call(void 0, data2, {
|
|
1063
1065
|
signal: controller.signal,
|
|
1064
1066
|
plugins: [
|
|
1065
1067
|
(value) => {
|
|
@@ -1067,12 +1069,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1067
1069
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1068
1070
|
return ["SanitizedError", name, message, stack];
|
|
1069
1071
|
}
|
|
1070
|
-
if (value instanceof
|
|
1072
|
+
if (value instanceof _chunkUO7KGW2Ujs.ErrorResponseImpl) {
|
|
1071
1073
|
let { data: data3, status, statusText } = value;
|
|
1072
1074
|
return ["ErrorResponse", data3, status, statusText];
|
|
1073
1075
|
}
|
|
1074
|
-
if (value && typeof value === "object" &&
|
|
1075
|
-
return ["SingleFetchRedirect", value[
|
|
1076
|
+
if (value && typeof value === "object" && _chunkUO7KGW2Ujs.SingleFetchRedirectSymbol in value) {
|
|
1077
|
+
return ["SingleFetchRedirect", value[_chunkUO7KGW2Ujs.SingleFetchRedirectSymbol]];
|
|
1076
1078
|
}
|
|
1077
1079
|
}
|
|
1078
1080
|
],
|
|
@@ -1095,7 +1097,7 @@ function derive(build, mode) {
|
|
|
1095
1097
|
let routes = createRoutes(build.routes);
|
|
1096
1098
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1097
1099
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1098
|
-
let staticHandler =
|
|
1100
|
+
let staticHandler = _chunkUO7KGW2Ujs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1099
1101
|
basename: build.basename,
|
|
1100
1102
|
unstable_instrumentations: build.entry.module.unstable_instrumentations
|
|
1101
1103
|
});
|
|
@@ -1103,7 +1105,7 @@ function derive(build, mode) {
|
|
|
1103
1105
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1104
1106
|
console.error(
|
|
1105
1107
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1106
|
-
|
|
1108
|
+
_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1107
1109
|
);
|
|
1108
1110
|
}
|
|
1109
1111
|
});
|
|
@@ -1121,36 +1123,36 @@ function derive(build, mode) {
|
|
|
1121
1123
|
});
|
|
1122
1124
|
};
|
|
1123
1125
|
if (build.future.v8_middleware) {
|
|
1124
|
-
if (initialContext && !(initialContext instanceof
|
|
1126
|
+
if (initialContext && !(initialContext instanceof _chunkUO7KGW2Ujs.RouterContextProvider)) {
|
|
1125
1127
|
let error = new Error(
|
|
1126
1128
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1127
1129
|
);
|
|
1128
1130
|
handleError(error);
|
|
1129
1131
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1130
1132
|
}
|
|
1131
|
-
loadContext = initialContext || new (0,
|
|
1133
|
+
loadContext = initialContext || new (0, _chunkUO7KGW2Ujs.RouterContextProvider)();
|
|
1132
1134
|
} else {
|
|
1133
1135
|
loadContext = initialContext || {};
|
|
1134
1136
|
}
|
|
1135
1137
|
let url = new URL(request.url);
|
|
1136
1138
|
let normalizedBasename = build.basename || "/";
|
|
1137
1139
|
let normalizedPath = url.pathname;
|
|
1138
|
-
if (
|
|
1140
|
+
if (_chunkUO7KGW2Ujs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1139
1141
|
normalizedPath = normalizedBasename;
|
|
1140
1142
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1141
1143
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1142
1144
|
}
|
|
1143
|
-
if (
|
|
1145
|
+
if (_chunkUO7KGW2Ujs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1144
1146
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1145
1147
|
}
|
|
1146
1148
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
1147
1149
|
if (!build.ssr) {
|
|
1148
1150
|
let decodedPath = decodeURI(normalizedPath);
|
|
1149
1151
|
if (normalizedBasename !== "/") {
|
|
1150
|
-
let strippedPath =
|
|
1152
|
+
let strippedPath = _chunkUO7KGW2Ujs.stripBasename.call(void 0, decodedPath, normalizedBasename);
|
|
1151
1153
|
if (strippedPath == null) {
|
|
1152
1154
|
errorHandler(
|
|
1153
|
-
new (0,
|
|
1155
|
+
new (0, _chunkUO7KGW2Ujs.ErrorResponseImpl)(
|
|
1154
1156
|
404,
|
|
1155
1157
|
"Not Found",
|
|
1156
1158
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
|
|
@@ -1173,7 +1175,7 @@ function derive(build, mode) {
|
|
|
1173
1175
|
} else if (!build.prerender.includes(decodedPath) && !build.prerender.includes(decodedPath + "/")) {
|
|
1174
1176
|
if (url.pathname.endsWith(".data")) {
|
|
1175
1177
|
errorHandler(
|
|
1176
|
-
new (0,
|
|
1178
|
+
new (0, _chunkUO7KGW2Ujs.ErrorResponseImpl)(
|
|
1177
1179
|
404,
|
|
1178
1180
|
"Not Found",
|
|
1179
1181
|
`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.`
|
|
@@ -1193,7 +1195,7 @@ function derive(build, mode) {
|
|
|
1193
1195
|
}
|
|
1194
1196
|
}
|
|
1195
1197
|
}
|
|
1196
|
-
let manifestUrl =
|
|
1198
|
+
let manifestUrl = _chunkUO7KGW2Ujs.getManifestPath.call(void 0,
|
|
1197
1199
|
build.routeDiscovery.manifestPath,
|
|
1198
1200
|
normalizedBasename
|
|
1199
1201
|
);
|
|
@@ -1228,7 +1230,7 @@ function derive(build, mode) {
|
|
|
1228
1230
|
loadContext,
|
|
1229
1231
|
handleError
|
|
1230
1232
|
);
|
|
1231
|
-
if (
|
|
1233
|
+
if (_chunkUO7KGW2Ujs.isRedirectResponse.call(void 0, response)) {
|
|
1232
1234
|
response = generateSingleFetchRedirectResponse(
|
|
1233
1235
|
response,
|
|
1234
1236
|
request,
|
|
@@ -1242,7 +1244,7 @@ function derive(build, mode) {
|
|
|
1242
1244
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1243
1245
|
request
|
|
1244
1246
|
});
|
|
1245
|
-
if (
|
|
1247
|
+
if (_chunkUO7KGW2Ujs.isRedirectResponse.call(void 0, response)) {
|
|
1246
1248
|
response = generateSingleFetchRedirectResponse(
|
|
1247
1249
|
response,
|
|
1248
1250
|
request,
|
|
@@ -1290,7 +1292,7 @@ function derive(build, mode) {
|
|
|
1290
1292
|
return response;
|
|
1291
1293
|
};
|
|
1292
1294
|
if (build.entry.module.unstable_instrumentations) {
|
|
1293
|
-
requestHandler =
|
|
1295
|
+
requestHandler = _chunkUO7KGW2Ujs.instrumentHandler.call(void 0,
|
|
1294
1296
|
requestHandler,
|
|
1295
1297
|
build.entry.module.unstable_instrumentations.map((i) => i.handler).filter(Boolean)
|
|
1296
1298
|
);
|
|
@@ -1402,7 +1404,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1402
1404
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1403
1405
|
try {
|
|
1404
1406
|
let innerResult = await query(request);
|
|
1405
|
-
if (!
|
|
1407
|
+
if (!_chunkUO7KGW2Ujs.isResponse.call(void 0, innerResult)) {
|
|
1406
1408
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1407
1409
|
}
|
|
1408
1410
|
return innerResult;
|
|
@@ -1412,7 +1414,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1412
1414
|
}
|
|
1413
1415
|
} : void 0
|
|
1414
1416
|
});
|
|
1415
|
-
if (!
|
|
1417
|
+
if (!_chunkUO7KGW2Ujs.isResponse.call(void 0, result)) {
|
|
1416
1418
|
result = await renderHtml(result, isSpaMode);
|
|
1417
1419
|
}
|
|
1418
1420
|
return result;
|
|
@@ -1427,7 +1429,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1427
1429
|
}
|
|
1428
1430
|
if (context.errors) {
|
|
1429
1431
|
Object.values(context.errors).forEach((err) => {
|
|
1430
|
-
if (!
|
|
1432
|
+
if (!_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1431
1433
|
handleError(err);
|
|
1432
1434
|
}
|
|
1433
1435
|
});
|
|
@@ -1479,10 +1481,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1479
1481
|
} catch (error) {
|
|
1480
1482
|
handleError(error);
|
|
1481
1483
|
let errorForSecondRender = error;
|
|
1482
|
-
if (
|
|
1484
|
+
if (_chunkUO7KGW2Ujs.isResponse.call(void 0, error)) {
|
|
1483
1485
|
try {
|
|
1484
1486
|
let data2 = await unwrapResponse(error);
|
|
1485
|
-
errorForSecondRender = new (0,
|
|
1487
|
+
errorForSecondRender = new (0, _chunkUO7KGW2Ujs.ErrorResponseImpl)(
|
|
1486
1488
|
error.status,
|
|
1487
1489
|
error.statusText,
|
|
1488
1490
|
data2
|
|
@@ -1490,7 +1492,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1490
1492
|
} catch (e) {
|
|
1491
1493
|
}
|
|
1492
1494
|
}
|
|
1493
|
-
context =
|
|
1495
|
+
context = _chunkUO7KGW2Ujs.getStaticContextFromError.call(void 0,
|
|
1494
1496
|
staticHandler.dataRoutes,
|
|
1495
1497
|
context,
|
|
1496
1498
|
errorForSecondRender
|
|
@@ -1549,7 +1551,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1549
1551
|
return handleQueryRouteError(error);
|
|
1550
1552
|
}
|
|
1551
1553
|
function handleQueryRouteResult(result) {
|
|
1552
|
-
if (
|
|
1554
|
+
if (_chunkUO7KGW2Ujs.isResponse.call(void 0, result)) {
|
|
1553
1555
|
return result;
|
|
1554
1556
|
}
|
|
1555
1557
|
if (typeof result === "string") {
|
|
@@ -1558,10 +1560,10 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1558
1560
|
return Response.json(result);
|
|
1559
1561
|
}
|
|
1560
1562
|
function handleQueryRouteError(error) {
|
|
1561
|
-
if (
|
|
1563
|
+
if (_chunkUO7KGW2Ujs.isResponse.call(void 0, error)) {
|
|
1562
1564
|
return error;
|
|
1563
1565
|
}
|
|
1564
|
-
if (
|
|
1566
|
+
if (_chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, error)) {
|
|
1565
1567
|
handleError(error);
|
|
1566
1568
|
return errorResponseToJson(error, serverMode);
|
|
1567
1569
|
}
|
|
@@ -1684,7 +1686,7 @@ function createSessionStorage({
|
|
|
1684
1686
|
};
|
|
1685
1687
|
}
|
|
1686
1688
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1687
|
-
|
|
1689
|
+
_chunkUO7KGW2Ujs.warnOnce.call(void 0,
|
|
1688
1690
|
cookie.isSigned,
|
|
1689
1691
|
`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.`
|
|
1690
1692
|
);
|
|
@@ -1886,7 +1888,7 @@ function useSafe(promise) {
|
|
|
1886
1888
|
}
|
|
1887
1889
|
async function routeRSCServerRequest({
|
|
1888
1890
|
request,
|
|
1889
|
-
|
|
1891
|
+
serverResponse,
|
|
1890
1892
|
createFromReadableStream,
|
|
1891
1893
|
renderHTML,
|
|
1892
1894
|
hydrate = true
|
|
@@ -1894,7 +1896,6 @@ async function routeRSCServerRequest({
|
|
|
1894
1896
|
const url = new URL(request.url);
|
|
1895
1897
|
const isDataRequest = isReactServerRequest(url);
|
|
1896
1898
|
const respondWithRSCPayload = isDataRequest || isManifestRequest(url) || request.headers.has("rsc-action-id");
|
|
1897
|
-
const serverResponse = await fetchServer(request);
|
|
1898
1899
|
if (respondWithRSCPayload || serverResponse.headers.get("React-Router-Resource") === "true") {
|
|
1899
1900
|
return serverResponse;
|
|
1900
1901
|
}
|
|
@@ -1956,6 +1957,8 @@ async function routeRSCServerRequest({
|
|
|
1956
1957
|
}
|
|
1957
1958
|
});
|
|
1958
1959
|
};
|
|
1960
|
+
let renderRedirect;
|
|
1961
|
+
let renderError;
|
|
1959
1962
|
try {
|
|
1960
1963
|
if (!detectRedirectResponse.body) {
|
|
1961
1964
|
throw new Error("Failed to clone server response");
|
|
@@ -1963,7 +1966,7 @@ async function routeRSCServerRequest({
|
|
|
1963
1966
|
const payload = await createFromReadableStream(
|
|
1964
1967
|
detectRedirectResponse.body
|
|
1965
1968
|
);
|
|
1966
|
-
if (serverResponse.status ===
|
|
1969
|
+
if (serverResponse.status === _chunkUO7KGW2Ujs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
1967
1970
|
const headers2 = new Headers(serverResponse.headers);
|
|
1968
1971
|
headers2.delete("Content-Encoding");
|
|
1969
1972
|
headers2.delete("Content-Length");
|
|
@@ -1976,73 +1979,179 @@ async function routeRSCServerRequest({
|
|
|
1976
1979
|
statusText: serverResponse.statusText
|
|
1977
1980
|
});
|
|
1978
1981
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1982
|
+
let reactHeaders = new Headers();
|
|
1983
|
+
let status = serverResponse.status;
|
|
1984
|
+
let statusText = serverResponse.statusText;
|
|
1985
|
+
let html = await renderHTML(getPayload, {
|
|
1986
|
+
onError(error) {
|
|
1987
|
+
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
1988
|
+
renderRedirect = _chunkUO7KGW2Ujs.decodeRedirectErrorDigest.call(void 0, error.digest);
|
|
1989
|
+
if (renderRedirect) {
|
|
1990
|
+
return error.digest;
|
|
1991
|
+
}
|
|
1992
|
+
let routeErrorResponse = _chunkUO7KGW2Ujs.decodeRouteErrorResponseDigest.call(void 0, error.digest);
|
|
1993
|
+
if (routeErrorResponse) {
|
|
1994
|
+
renderError = routeErrorResponse;
|
|
1995
|
+
status = routeErrorResponse.status;
|
|
1996
|
+
statusText = routeErrorResponse.statusText;
|
|
1997
|
+
return error.digest;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
},
|
|
2001
|
+
onHeaders(headers2) {
|
|
2002
|
+
for (const [key, value] of headers2) {
|
|
2003
|
+
reactHeaders.append(key, value);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
});
|
|
2007
|
+
const headers = new Headers(reactHeaders);
|
|
2008
|
+
for (const [key, value] of serverResponse.headers) {
|
|
2009
|
+
headers.append(key, value);
|
|
2010
|
+
}
|
|
1981
2011
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
1982
|
-
if (
|
|
2012
|
+
if (renderRedirect) {
|
|
2013
|
+
headers.set("Location", renderRedirect.location);
|
|
1983
2014
|
return new Response(html, {
|
|
1984
|
-
status:
|
|
2015
|
+
status: renderRedirect.status,
|
|
2016
|
+
headers
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
const redirectTransform = new TransformStream({
|
|
2020
|
+
flush(controller) {
|
|
2021
|
+
if (renderRedirect) {
|
|
2022
|
+
controller.enqueue(
|
|
2023
|
+
new TextEncoder().encode(
|
|
2024
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkUO7KGW2Ujs.escapeHtml.call(void 0, renderRedirect.location)}"/>`
|
|
2025
|
+
)
|
|
2026
|
+
);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
});
|
|
2030
|
+
if (!hydrate) {
|
|
2031
|
+
return new Response(html.pipeThrough(redirectTransform), {
|
|
2032
|
+
status,
|
|
2033
|
+
statusText,
|
|
1985
2034
|
headers
|
|
1986
2035
|
});
|
|
1987
2036
|
}
|
|
1988
2037
|
if (!_optionalChain([serverResponseB, 'optionalAccess', _22 => _22.body])) {
|
|
1989
2038
|
throw new Error("Failed to clone server response");
|
|
1990
2039
|
}
|
|
1991
|
-
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body));
|
|
2040
|
+
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(redirectTransform);
|
|
1992
2041
|
return new Response(body2, {
|
|
1993
|
-
status
|
|
2042
|
+
status,
|
|
2043
|
+
statusText,
|
|
1994
2044
|
headers
|
|
1995
2045
|
});
|
|
1996
2046
|
} catch (reason) {
|
|
1997
2047
|
if (reason instanceof Response) {
|
|
1998
2048
|
return reason;
|
|
1999
2049
|
}
|
|
2050
|
+
if (renderRedirect) {
|
|
2051
|
+
return new Response(`Redirect: ${renderRedirect.location}`, {
|
|
2052
|
+
status: renderRedirect.status,
|
|
2053
|
+
headers: {
|
|
2054
|
+
Location: renderRedirect.location
|
|
2055
|
+
}
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2000
2058
|
try {
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2059
|
+
reason = _nullishCoalesce(renderError, () => ( reason));
|
|
2060
|
+
let [status, statusText] = _chunkUO7KGW2Ujs.isRouteErrorResponse.call(void 0, reason) ? [reason.status, reason.statusText] : [500, ""];
|
|
2061
|
+
let retryRedirect;
|
|
2062
|
+
let reactHeaders = new Headers();
|
|
2063
|
+
const html = await renderHTML(
|
|
2064
|
+
() => {
|
|
2065
|
+
const decoded = Promise.resolve(
|
|
2066
|
+
createFromReadableStream(createStream())
|
|
2067
|
+
);
|
|
2068
|
+
const payloadPromise = decoded.then(
|
|
2069
|
+
(payload) => Object.assign(payload, {
|
|
2070
|
+
status,
|
|
2071
|
+
errors: deepestRenderedBoundaryId ? {
|
|
2072
|
+
[deepestRenderedBoundaryId]: reason
|
|
2073
|
+
} : {}
|
|
2074
|
+
})
|
|
2075
|
+
);
|
|
2076
|
+
return Object.defineProperties(payloadPromise, {
|
|
2077
|
+
_deepestRenderedBoundaryId: {
|
|
2078
|
+
get() {
|
|
2079
|
+
return deepestRenderedBoundaryId;
|
|
2080
|
+
},
|
|
2081
|
+
set(boundaryId) {
|
|
2082
|
+
deepestRenderedBoundaryId = boundaryId;
|
|
2083
|
+
}
|
|
2018
2084
|
},
|
|
2019
|
-
|
|
2020
|
-
|
|
2085
|
+
formState: {
|
|
2086
|
+
get() {
|
|
2087
|
+
return payloadPromise.then(
|
|
2088
|
+
(payload) => payload.type === "render" ? payload.formState : void 0
|
|
2089
|
+
);
|
|
2090
|
+
}
|
|
2021
2091
|
}
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2092
|
+
});
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
onError(error) {
|
|
2096
|
+
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
2097
|
+
retryRedirect = _chunkUO7KGW2Ujs.decodeRedirectErrorDigest.call(void 0, error.digest);
|
|
2098
|
+
if (retryRedirect) {
|
|
2099
|
+
return error.digest;
|
|
2100
|
+
}
|
|
2101
|
+
let routeErrorResponse = _chunkUO7KGW2Ujs.decodeRouteErrorResponseDigest.call(void 0,
|
|
2102
|
+
error.digest
|
|
2027
2103
|
);
|
|
2104
|
+
if (routeErrorResponse) {
|
|
2105
|
+
status = routeErrorResponse.status;
|
|
2106
|
+
statusText = routeErrorResponse.statusText;
|
|
2107
|
+
return error.digest;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
},
|
|
2111
|
+
onHeaders(headers2) {
|
|
2112
|
+
for (const [key, value] of headers2) {
|
|
2113
|
+
reactHeaders.append(key, value);
|
|
2028
2114
|
}
|
|
2029
2115
|
}
|
|
2116
|
+
}
|
|
2117
|
+
);
|
|
2118
|
+
const headers = new Headers(reactHeaders);
|
|
2119
|
+
for (const [key, value] of serverResponse.headers) {
|
|
2120
|
+
headers.append(key, value);
|
|
2121
|
+
}
|
|
2122
|
+
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2123
|
+
if (retryRedirect) {
|
|
2124
|
+
headers.set("Location", retryRedirect.location);
|
|
2125
|
+
return new Response(html, {
|
|
2126
|
+
status: retryRedirect.status,
|
|
2127
|
+
headers
|
|
2030
2128
|
});
|
|
2129
|
+
}
|
|
2130
|
+
const retryRedirectTransform = new TransformStream({
|
|
2131
|
+
flush(controller) {
|
|
2132
|
+
if (retryRedirect) {
|
|
2133
|
+
controller.enqueue(
|
|
2134
|
+
new TextEncoder().encode(
|
|
2135
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkUO7KGW2Ujs.escapeHtml.call(void 0, retryRedirect.location)}"/>`
|
|
2136
|
+
)
|
|
2137
|
+
);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2031
2140
|
});
|
|
2032
|
-
const headers = new Headers(serverResponse.headers);
|
|
2033
|
-
headers.set("Content-Type", "text/html");
|
|
2034
2141
|
if (!hydrate) {
|
|
2035
|
-
return new Response(html, {
|
|
2142
|
+
return new Response(html.pipeThrough(retryRedirectTransform), {
|
|
2036
2143
|
status,
|
|
2144
|
+
statusText,
|
|
2037
2145
|
headers
|
|
2038
2146
|
});
|
|
2039
2147
|
}
|
|
2040
2148
|
if (!_optionalChain([serverResponseB, 'optionalAccess', _23 => _23.body])) {
|
|
2041
2149
|
throw new Error("Failed to clone server response");
|
|
2042
2150
|
}
|
|
2043
|
-
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body));
|
|
2151
|
+
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(retryRedirectTransform);
|
|
2044
2152
|
return new Response(body2, {
|
|
2045
2153
|
status,
|
|
2154
|
+
statusText,
|
|
2046
2155
|
headers
|
|
2047
2156
|
});
|
|
2048
2157
|
} catch (e2) {
|
|
@@ -2064,7 +2173,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2064
2173
|
if (payload.type !== "render") return null;
|
|
2065
2174
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2066
2175
|
for (const match of payload.matches) {
|
|
2067
|
-
if (
|
|
2176
|
+
if (_chunkUO7KGW2Ujs.shouldHydrateRouteLoader.call(void 0,
|
|
2068
2177
|
match.id,
|
|
2069
2178
|
match.clientLoader,
|
|
2070
2179
|
match.hasLoader,
|
|
@@ -2104,7 +2213,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2104
2213
|
}
|
|
2105
2214
|
}))
|
|
2106
2215
|
};
|
|
2107
|
-
const router =
|
|
2216
|
+
const router = _chunkJKMHOZYWjs.createStaticRouter.call(void 0,
|
|
2108
2217
|
payload.matches.reduceRight((previous, match) => {
|
|
2109
2218
|
const route = {
|
|
2110
2219
|
id: match.id,
|
|
@@ -2146,10 +2255,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2146
2255
|
}
|
|
2147
2256
|
},
|
|
2148
2257
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2149
|
-
routeModules:
|
|
2258
|
+
routeModules: _chunkOVG6YSZ5js.createRSCRouteModules.call(void 0, payload)
|
|
2150
2259
|
};
|
|
2151
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2152
|
-
|
|
2260
|
+
return /* @__PURE__ */ React3.createElement(_chunkUO7KGW2Ujs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkOVG6YSZ5js.RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React3.createElement(_chunkUO7KGW2Ujs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
2261
|
+
_chunkJKMHOZYWjs.StaticRouterProvider,
|
|
2153
2262
|
{
|
|
2154
2263
|
context,
|
|
2155
2264
|
router,
|
|
@@ -2172,7 +2281,7 @@ function deserializeErrors(errors) {
|
|
|
2172
2281
|
let serialized = {};
|
|
2173
2282
|
for (let [key, val] of entries) {
|
|
2174
2283
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2175
|
-
serialized[key] = new (0,
|
|
2284
|
+
serialized[key] = new (0, _chunkUO7KGW2Ujs.ErrorResponseImpl)(
|
|
2176
2285
|
val.status,
|
|
2177
2286
|
val.statusText,
|
|
2178
2287
|
val.data,
|
|
@@ -2329,4 +2438,4 @@ function deserializeErrors(errors) {
|
|
|
2329
2438
|
|
|
2330
2439
|
|
|
2331
2440
|
|
|
2332
|
-
exports.Await =
|
|
2441
|
+
exports.Await = _chunkUO7KGW2Ujs.Await; exports.BrowserRouter = _chunkJKMHOZYWjs.BrowserRouter; exports.Form = _chunkJKMHOZYWjs.Form; exports.HashRouter = _chunkJKMHOZYWjs.HashRouter; exports.IDLE_BLOCKER = _chunkUO7KGW2Ujs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkUO7KGW2Ujs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkUO7KGW2Ujs.IDLE_NAVIGATION; exports.Link = _chunkJKMHOZYWjs.Link; exports.Links = _chunkUO7KGW2Ujs.Links; exports.MemoryRouter = _chunkUO7KGW2Ujs.MemoryRouter; exports.Meta = _chunkUO7KGW2Ujs.Meta; exports.NavLink = _chunkJKMHOZYWjs.NavLink; exports.Navigate = _chunkUO7KGW2Ujs.Navigate; exports.NavigationType = _chunkUO7KGW2Ujs.Action; exports.Outlet = _chunkUO7KGW2Ujs.Outlet; exports.PrefetchPageLinks = _chunkUO7KGW2Ujs.PrefetchPageLinks; exports.Route = _chunkUO7KGW2Ujs.Route; exports.Router = _chunkUO7KGW2Ujs.Router; exports.RouterContextProvider = _chunkUO7KGW2Ujs.RouterContextProvider; exports.RouterProvider = _chunkUO7KGW2Ujs.RouterProvider; exports.Routes = _chunkUO7KGW2Ujs.Routes; exports.Scripts = _chunkUO7KGW2Ujs.Scripts; exports.ScrollRestoration = _chunkJKMHOZYWjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunkJKMHOZYWjs.StaticRouter; exports.StaticRouterProvider = _chunkJKMHOZYWjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkUO7KGW2Ujs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunkUO7KGW2Ujs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkUO7KGW2Ujs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkUO7KGW2Ujs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkUO7KGW2Ujs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkUO7KGW2Ujs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkUO7KGW2Ujs.LocationContext; exports.UNSAFE_NavigationContext = _chunkUO7KGW2Ujs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = _chunkOVG6YSZ5js.RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkUO7KGW2Ujs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkUO7KGW2Ujs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkUO7KGW2Ujs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkUO7KGW2Ujs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkUO7KGW2Ujs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkUO7KGW2Ujs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkUO7KGW2Ujs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkUO7KGW2Ujs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkUO7KGW2Ujs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkUO7KGW2Ujs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunkUO7KGW2Ujs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkUO7KGW2Ujs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = _chunkOVG6YSZ5js.getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkUO7KGW2Ujs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkUO7KGW2Ujs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkUO7KGW2Ujs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkUO7KGW2Ujs.invariant; exports.UNSAFE_mapRouteProperties = _chunkUO7KGW2Ujs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkUO7KGW2Ujs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkUO7KGW2Ujs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunkJKMHOZYWjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkUO7KGW2Ujs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkUO7KGW2Ujs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkUO7KGW2Ujs.withHydrateFallbackProps; exports.createBrowserRouter = _chunkJKMHOZYWjs.createBrowserRouter; exports.createContext = _chunkUO7KGW2Ujs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunkJKMHOZYWjs.createHashRouter; exports.createMemoryRouter = _chunkUO7KGW2Ujs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkUO7KGW2Ujs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkUO7KGW2Ujs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkUO7KGW2Ujs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunkJKMHOZYWjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunkJKMHOZYWjs.createStaticHandler; exports.createStaticRouter = _chunkJKMHOZYWjs.createStaticRouter; exports.data = _chunkUO7KGW2Ujs.data; exports.generatePath = _chunkUO7KGW2Ujs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkUO7KGW2Ujs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkUO7KGW2Ujs.matchPath; exports.matchRoutes = _chunkUO7KGW2Ujs.matchRoutes; exports.parsePath = _chunkUO7KGW2Ujs.parsePath; exports.redirect = _chunkUO7KGW2Ujs.redirect; exports.redirectDocument = _chunkUO7KGW2Ujs.redirectDocument; exports.renderMatches = _chunkUO7KGW2Ujs.renderMatches; exports.replace = _chunkUO7KGW2Ujs.replace; exports.resolvePath = _chunkUO7KGW2Ujs.resolvePath; exports.unstable_HistoryRouter = _chunkJKMHOZYWjs.HistoryRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunkJKMHOZYWjs.usePrompt; exports.unstable_useRoute = _chunkUO7KGW2Ujs.useRoute; exports.useActionData = _chunkUO7KGW2Ujs.useActionData; exports.useAsyncError = _chunkUO7KGW2Ujs.useAsyncError; exports.useAsyncValue = _chunkUO7KGW2Ujs.useAsyncValue; exports.useBeforeUnload = _chunkJKMHOZYWjs.useBeforeUnload; exports.useBlocker = _chunkUO7KGW2Ujs.useBlocker; exports.useFetcher = _chunkJKMHOZYWjs.useFetcher; exports.useFetchers = _chunkJKMHOZYWjs.useFetchers; exports.useFormAction = _chunkJKMHOZYWjs.useFormAction; exports.useHref = _chunkUO7KGW2Ujs.useHref; exports.useInRouterContext = _chunkUO7KGW2Ujs.useInRouterContext; exports.useLinkClickHandler = _chunkJKMHOZYWjs.useLinkClickHandler; exports.useLoaderData = _chunkUO7KGW2Ujs.useLoaderData; exports.useLocation = _chunkUO7KGW2Ujs.useLocation; exports.useMatch = _chunkUO7KGW2Ujs.useMatch; exports.useMatches = _chunkUO7KGW2Ujs.useMatches; exports.useNavigate = _chunkUO7KGW2Ujs.useNavigate; exports.useNavigation = _chunkUO7KGW2Ujs.useNavigation; exports.useNavigationType = _chunkUO7KGW2Ujs.useNavigationType; exports.useOutlet = _chunkUO7KGW2Ujs.useOutlet; exports.useOutletContext = _chunkUO7KGW2Ujs.useOutletContext; exports.useParams = _chunkUO7KGW2Ujs.useParams; exports.useResolvedPath = _chunkUO7KGW2Ujs.useResolvedPath; exports.useRevalidator = _chunkUO7KGW2Ujs.useRevalidator; exports.useRouteError = _chunkUO7KGW2Ujs.useRouteError; exports.useRouteLoaderData = _chunkUO7KGW2Ujs.useRouteLoaderData; exports.useRoutes = _chunkUO7KGW2Ujs.useRoutes; exports.useSearchParams = _chunkJKMHOZYWjs.useSearchParams; exports.useSubmit = _chunkJKMHOZYWjs.useSubmit; exports.useViewTransitionState = _chunkJKMHOZYWjs.useViewTransitionState;
|