react-router 7.7.0-pre.1 → 7.7.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 +9 -7
- package/dist/development/{browser-BSrXyLft.d.mts → browser-CcxeZJcQ.d.mts} +3 -30
- package/dist/development/{chunk-6ZHKKNZG.js → chunk-4ADB4KIO.js} +170 -140
- package/dist/development/{chunk-YNUF36W5.mjs → chunk-EF7DTUVF.mjs} +52 -22
- package/dist/{production/chunk-KZZC37RO.mjs → development/chunk-T3VM44WY.mjs} +31 -26
- package/dist/development/{chunk-Z7T4GLA7.js → chunk-V6PEDDZI.js} +1 -1
- package/dist/development/components-DzqPLVI1.d.mts +464 -0
- package/dist/development/dom-export.d.mts +3 -3
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/{production/index-react-server-client-DOK8MfYF.d.mts → development/index-react-server-client-CUidsuu_.d.mts} +2 -2
- package/dist/development/{index-react-server-client-LrDNRnlX.d.ts → index-react-server-client-kY8DvDF3.d.ts} +177 -529
- 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 +10 -4
- package/dist/development/index-react-server-client.mjs +9 -3
- package/dist/development/index-react-server.js +20 -6
- package/dist/development/index-react-server.mjs +21 -6
- package/dist/development/index.d.mts +396 -9
- package/dist/development/index.d.ts +372 -12
- package/dist/development/index.js +131 -120
- package/dist/development/index.mjs +9 -3
- package/dist/development/lib/types/internal.d.mts +1 -1
- 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/{production/route-data-DAw7Esur.d.mts → development/route-data-DjzmHYNR.d.mts} +1 -1
- package/dist/{production/route-data-7aXBQ4I3.d.ts → development/routeModules-g5PTiDfO.d.ts} +156 -156
- package/dist/production/{browser-BSrXyLft.d.mts → browser-CcxeZJcQ.d.mts} +3 -30
- package/dist/production/{chunk-W77PDD2Y.js → chunk-2TYFPE3B.js} +170 -140
- package/dist/production/{chunk-SH44XSL4.js → chunk-5KHO4FML.js} +1 -1
- package/dist/{development/chunk-YP7CIEHK.mjs → production/chunk-GNZILI6H.mjs} +31 -26
- package/dist/production/{chunk-4FKAWASN.mjs → chunk-WPPIQDYG.mjs} +52 -22
- package/dist/production/components-DzqPLVI1.d.mts +464 -0
- package/dist/production/dom-export.d.mts +3 -3
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/{development/index-react-server-client-DOK8MfYF.d.mts → production/index-react-server-client-CUidsuu_.d.mts} +2 -2
- package/dist/production/{index-react-server-client-LrDNRnlX.d.ts → index-react-server-client-kY8DvDF3.d.ts} +177 -529
- 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 +10 -4
- package/dist/production/index-react-server-client.mjs +9 -3
- package/dist/production/index-react-server.js +20 -6
- package/dist/production/index-react-server.mjs +21 -6
- package/dist/production/index.d.mts +396 -9
- package/dist/production/index.d.ts +372 -12
- package/dist/production/index.js +131 -120
- package/dist/production/index.mjs +9 -3
- package/dist/production/lib/types/internal.d.mts +1 -1
- 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/{development/route-data-DAw7Esur.d.mts → production/route-data-DjzmHYNR.d.mts} +1 -1
- package/dist/{development/route-data-7aXBQ4I3.d.ts → production/routeModules-g5PTiDfO.d.ts} +156 -156
- package/package.json +1 -1
- package/dist/development/components-IaVqGBuO.d.mts +0 -816
- package/dist/production/components-IaVqGBuO.d.mts +0 -816
|
@@ -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.7.0
|
|
2
|
+
* react-router v7.7.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var _chunk6ZHKKNZGjs = require('./chunk-6ZHKKNZG.js');
|
|
55
54
|
|
|
56
55
|
|
|
57
56
|
|
|
57
|
+
var _chunk4ADB4KIOjs = require('./chunk-4ADB4KIO.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
@@ -139,7 +139,10 @@ var _chunk6ZHKKNZGjs = require('./chunk-6ZHKKNZG.js');
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
var _chunkV6PEDDZIjs = require('./chunk-V6PEDDZI.js');
|
|
143
146
|
|
|
144
147
|
// lib/dom/ssr/server.tsx
|
|
145
148
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react); var React5 = _interopRequireWildcard(_react);
|
|
@@ -152,7 +155,7 @@ function ServerRouter({
|
|
|
152
155
|
url = new URL(url);
|
|
153
156
|
}
|
|
154
157
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
155
|
-
let routes =
|
|
158
|
+
let routes = _chunkV6PEDDZIjs.createServerRoutes.call(void 0,
|
|
156
159
|
manifest.routes,
|
|
157
160
|
routeModules,
|
|
158
161
|
context.future,
|
|
@@ -165,7 +168,7 @@ function ServerRouter({
|
|
|
165
168
|
let routeId = match.route.id;
|
|
166
169
|
let route = routeModules[routeId];
|
|
167
170
|
let manifestRoute = context.manifest.routes[routeId];
|
|
168
|
-
if (route && manifestRoute &&
|
|
171
|
+
if (route && manifestRoute && _chunkV6PEDDZIjs.shouldHydrateRouteLoader.call(void 0,
|
|
169
172
|
routeId,
|
|
170
173
|
route.clientLoader,
|
|
171
174
|
manifestRoute.hasLoader,
|
|
@@ -174,9 +177,9 @@ function ServerRouter({
|
|
|
174
177
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
|
-
let router =
|
|
180
|
+
let router = _chunk4ADB4KIOjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext);
|
|
178
181
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
179
|
-
|
|
182
|
+
_chunkV6PEDDZIjs.FrameworkContext.Provider,
|
|
180
183
|
{
|
|
181
184
|
value: {
|
|
182
185
|
manifest,
|
|
@@ -191,8 +194,8 @@ function ServerRouter({
|
|
|
191
194
|
renderMeta: context.renderMeta
|
|
192
195
|
}
|
|
193
196
|
},
|
|
194
|
-
/* @__PURE__ */ React.createElement(
|
|
195
|
-
|
|
197
|
+
/* @__PURE__ */ React.createElement(_chunkV6PEDDZIjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
198
|
+
_chunk4ADB4KIOjs.StaticRouterProvider,
|
|
196
199
|
{
|
|
197
200
|
router,
|
|
198
201
|
context: context.staticHandlerContext,
|
|
@@ -200,7 +203,7 @@ function ServerRouter({
|
|
|
200
203
|
}
|
|
201
204
|
))
|
|
202
205
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
203
|
-
|
|
206
|
+
_chunkV6PEDDZIjs.StreamTransfer,
|
|
204
207
|
{
|
|
205
208
|
context,
|
|
206
209
|
identifier: 0,
|
|
@@ -242,18 +245,18 @@ function createRoutesStub(routes, _context) {
|
|
|
242
245
|
let patched = processRoutes(
|
|
243
246
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
244
247
|
// types compared to `AgnosticRouteObject`
|
|
245
|
-
|
|
246
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.unstable_middleware]) ? new (0,
|
|
248
|
+
_chunkV6PEDDZIjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
249
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _4 => _4.unstable_middleware]) ? new (0, _chunkV6PEDDZIjs.unstable_RouterContextProvider)() : {},
|
|
247
250
|
frameworkContextRef.current.manifest,
|
|
248
251
|
frameworkContextRef.current.routeModules
|
|
249
252
|
);
|
|
250
|
-
routerRef.current =
|
|
253
|
+
routerRef.current = _chunk4ADB4KIOjs.createMemoryRouter.call(void 0, patched, {
|
|
251
254
|
initialEntries,
|
|
252
255
|
initialIndex,
|
|
253
256
|
hydrationData
|
|
254
257
|
});
|
|
255
258
|
}
|
|
256
|
-
return /* @__PURE__ */ React2.createElement(
|
|
259
|
+
return /* @__PURE__ */ React2.createElement(_chunkV6PEDDZIjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunk4ADB4KIOjs.RouterProvider, { router: routerRef.current }));
|
|
257
260
|
};
|
|
258
261
|
}
|
|
259
262
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -267,9 +270,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
267
270
|
id: route.id,
|
|
268
271
|
path: route.path,
|
|
269
272
|
index: route.index,
|
|
270
|
-
Component: route.Component ?
|
|
271
|
-
HydrateFallback: route.HydrateFallback ?
|
|
272
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
273
|
+
Component: route.Component ? _chunk4ADB4KIOjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
274
|
+
HydrateFallback: route.HydrateFallback ? _chunk4ADB4KIOjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
275
|
+
ErrorBoundary: route.ErrorBoundary ? _chunk4ADB4KIOjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
273
276
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
274
277
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
275
278
|
handle: route.handle,
|
|
@@ -298,7 +301,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
298
301
|
};
|
|
299
302
|
manifest.routes[newRoute.id] = entryRoute;
|
|
300
303
|
routeModules[route.id] = {
|
|
301
|
-
default: newRoute.Component ||
|
|
304
|
+
default: newRoute.Component || _chunk4ADB4KIOjs.Outlet,
|
|
302
305
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
303
306
|
handle: route.handle,
|
|
304
307
|
links: route.links,
|
|
@@ -493,7 +496,7 @@ function myUnescape(value) {
|
|
|
493
496
|
return result;
|
|
494
497
|
}
|
|
495
498
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
496
|
-
|
|
499
|
+
_chunkV6PEDDZIjs.warnOnce.call(void 0,
|
|
497
500
|
!expires,
|
|
498
501
|
`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.`
|
|
499
502
|
);
|
|
@@ -547,7 +550,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
547
550
|
let entries = Object.entries(errors);
|
|
548
551
|
let serialized = {};
|
|
549
552
|
for (let [key, val] of entries) {
|
|
550
|
-
if (
|
|
553
|
+
if (_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, val)) {
|
|
551
554
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
552
555
|
} else if (val instanceof Error) {
|
|
553
556
|
let sanitized = sanitizeError(val, serverMode);
|
|
@@ -572,7 +575,7 @@ function serializeErrors(errors, serverMode) {
|
|
|
572
575
|
|
|
573
576
|
// lib/server-runtime/routeMatching.ts
|
|
574
577
|
function matchServerRoutes(routes, pathname, basename) {
|
|
575
|
-
let matches =
|
|
578
|
+
let matches = _chunkV6PEDDZIjs.matchRoutes.call(void 0,
|
|
576
579
|
routes,
|
|
577
580
|
pathname,
|
|
578
581
|
basename
|
|
@@ -592,7 +595,7 @@ async function callRouteHandler(handler, args) {
|
|
|
592
595
|
params: args.params,
|
|
593
596
|
context: args.context
|
|
594
597
|
});
|
|
595
|
-
if (
|
|
598
|
+
if (_chunkV6PEDDZIjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkV6PEDDZIjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
596
599
|
throw new Response(null, result.init);
|
|
597
600
|
}
|
|
598
601
|
return result;
|
|
@@ -711,17 +714,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
711
714
|
controller.close();
|
|
712
715
|
}
|
|
713
716
|
});
|
|
714
|
-
let decoded = await
|
|
717
|
+
let decoded = await _chunkV6PEDDZIjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
715
718
|
let data2 = decoded.value;
|
|
716
|
-
if (data2 &&
|
|
717
|
-
let result = data2[
|
|
719
|
+
if (data2 && _chunkV6PEDDZIjs.SingleFetchRedirectSymbol in data2) {
|
|
720
|
+
let result = data2[_chunkV6PEDDZIjs.SingleFetchRedirectSymbol];
|
|
718
721
|
let init = { status: result.status };
|
|
719
722
|
if (result.reload) {
|
|
720
|
-
throw
|
|
723
|
+
throw _chunkV6PEDDZIjs.redirectDocument.call(void 0, result.redirect, init);
|
|
721
724
|
} else if (result.replace) {
|
|
722
|
-
throw
|
|
725
|
+
throw _chunkV6PEDDZIjs.replace.call(void 0, result.redirect, init);
|
|
723
726
|
} else {
|
|
724
|
-
throw
|
|
727
|
+
throw _chunkV6PEDDZIjs.redirect.call(void 0, result.redirect, init);
|
|
725
728
|
}
|
|
726
729
|
} else {
|
|
727
730
|
invariant2(
|
|
@@ -849,14 +852,14 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
849
852
|
|
|
850
853
|
// lib/server-runtime/single-fetch.ts
|
|
851
854
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
852
|
-
...
|
|
855
|
+
..._chunkV6PEDDZIjs.NO_BODY_STATUS_CODES,
|
|
853
856
|
304
|
|
854
857
|
]);
|
|
855
858
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
856
859
|
try {
|
|
857
860
|
let respond2 = function(context) {
|
|
858
861
|
let headers = getDocumentHeaders(context, build);
|
|
859
|
-
if (
|
|
862
|
+
if (_chunkV6PEDDZIjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
860
863
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
861
864
|
result: getSingleFetchRedirect(
|
|
862
865
|
context.statusCode,
|
|
@@ -864,12 +867,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
864
867
|
build.basename
|
|
865
868
|
),
|
|
866
869
|
headers,
|
|
867
|
-
status:
|
|
870
|
+
status: _chunkV6PEDDZIjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
868
871
|
});
|
|
869
872
|
}
|
|
870
873
|
if (context.errors) {
|
|
871
874
|
Object.values(context.errors).forEach((err) => {
|
|
872
|
-
if (!
|
|
875
|
+
if (!_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
873
876
|
handleError(err);
|
|
874
877
|
}
|
|
875
878
|
});
|
|
@@ -903,10 +906,10 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
903
906
|
skipRevalidation: true,
|
|
904
907
|
unstable_respond: respond2
|
|
905
908
|
});
|
|
906
|
-
if (!
|
|
909
|
+
if (!_chunkV6PEDDZIjs.isResponse.call(void 0, result)) {
|
|
907
910
|
result = respond2(result);
|
|
908
911
|
}
|
|
909
|
-
if (
|
|
912
|
+
if (_chunkV6PEDDZIjs.isRedirectResponse.call(void 0, result)) {
|
|
910
913
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
911
914
|
result: getSingleFetchRedirect(
|
|
912
915
|
result.status,
|
|
@@ -914,7 +917,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
914
917
|
build.basename
|
|
915
918
|
),
|
|
916
919
|
headers: result.headers,
|
|
917
|
-
status:
|
|
920
|
+
status: _chunkV6PEDDZIjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
918
921
|
});
|
|
919
922
|
}
|
|
920
923
|
return result;
|
|
@@ -931,22 +934,22 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
931
934
|
try {
|
|
932
935
|
let respond2 = function(context) {
|
|
933
936
|
let headers = getDocumentHeaders(context, build);
|
|
934
|
-
if (
|
|
937
|
+
if (_chunkV6PEDDZIjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
935
938
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
936
939
|
result: {
|
|
937
|
-
[
|
|
940
|
+
[_chunkV6PEDDZIjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
938
941
|
context.statusCode,
|
|
939
942
|
headers,
|
|
940
943
|
build.basename
|
|
941
944
|
)
|
|
942
945
|
},
|
|
943
946
|
headers,
|
|
944
|
-
status:
|
|
947
|
+
status: _chunkV6PEDDZIjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
945
948
|
});
|
|
946
949
|
}
|
|
947
950
|
if (context.errors) {
|
|
948
951
|
Object.values(context.errors).forEach((err) => {
|
|
949
|
-
if (!
|
|
952
|
+
if (!_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
950
953
|
handleError(err);
|
|
951
954
|
}
|
|
952
955
|
});
|
|
@@ -987,20 +990,20 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
987
990
|
skipLoaderErrorBubbling: true,
|
|
988
991
|
unstable_respond: respond2
|
|
989
992
|
});
|
|
990
|
-
if (!
|
|
993
|
+
if (!_chunkV6PEDDZIjs.isResponse.call(void 0, result)) {
|
|
991
994
|
result = respond2(result);
|
|
992
995
|
}
|
|
993
|
-
if (
|
|
996
|
+
if (_chunkV6PEDDZIjs.isRedirectResponse.call(void 0, result)) {
|
|
994
997
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
995
998
|
result: {
|
|
996
|
-
[
|
|
999
|
+
[_chunkV6PEDDZIjs.SingleFetchRedirectSymbol]: getSingleFetchRedirect(
|
|
997
1000
|
result.status,
|
|
998
1001
|
result.headers,
|
|
999
1002
|
build.basename
|
|
1000
1003
|
)
|
|
1001
1004
|
},
|
|
1002
1005
|
headers: result.headers,
|
|
1003
|
-
status:
|
|
1006
|
+
status: _chunkV6PEDDZIjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1004
1007
|
});
|
|
1005
1008
|
}
|
|
1006
1009
|
return result;
|
|
@@ -1041,7 +1044,7 @@ function generateSingleFetchResponse(request, build, serverMode, {
|
|
|
1041
1044
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1042
1045
|
let redirect2 = headers.get("Location");
|
|
1043
1046
|
if (basename) {
|
|
1044
|
-
redirect2 =
|
|
1047
|
+
redirect2 = _chunkV6PEDDZIjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1045
1048
|
}
|
|
1046
1049
|
return {
|
|
1047
1050
|
redirect: redirect2,
|
|
@@ -1067,7 +1070,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1067
1070
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1068
1071
|
);
|
|
1069
1072
|
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
|
|
1070
|
-
return
|
|
1073
|
+
return _chunkV6PEDDZIjs.encode.call(void 0, data2, {
|
|
1071
1074
|
signal: controller.signal,
|
|
1072
1075
|
plugins: [
|
|
1073
1076
|
(value) => {
|
|
@@ -1075,12 +1078,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1075
1078
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1076
1079
|
return ["SanitizedError", name, message, stack];
|
|
1077
1080
|
}
|
|
1078
|
-
if (value instanceof
|
|
1081
|
+
if (value instanceof _chunkV6PEDDZIjs.ErrorResponseImpl) {
|
|
1079
1082
|
let { data: data3, status, statusText } = value;
|
|
1080
1083
|
return ["ErrorResponse", data3, status, statusText];
|
|
1081
1084
|
}
|
|
1082
|
-
if (value && typeof value === "object" &&
|
|
1083
|
-
return ["SingleFetchRedirect", value[
|
|
1085
|
+
if (value && typeof value === "object" && _chunkV6PEDDZIjs.SingleFetchRedirectSymbol in value) {
|
|
1086
|
+
return ["SingleFetchRedirect", value[_chunkV6PEDDZIjs.SingleFetchRedirectSymbol]];
|
|
1084
1087
|
}
|
|
1085
1088
|
}
|
|
1086
1089
|
],
|
|
@@ -1103,14 +1106,14 @@ function derive(build, mode) {
|
|
|
1103
1106
|
let routes = createRoutes(build.routes);
|
|
1104
1107
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1105
1108
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1106
|
-
let staticHandler =
|
|
1109
|
+
let staticHandler = _chunkV6PEDDZIjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1107
1110
|
basename: build.basename
|
|
1108
1111
|
});
|
|
1109
1112
|
let errorHandler = build.entry.module.handleError || ((error, { request }) => {
|
|
1110
1113
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1111
1114
|
console.error(
|
|
1112
1115
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1113
|
-
|
|
1116
|
+
_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1114
1117
|
);
|
|
1115
1118
|
}
|
|
1116
1119
|
});
|
|
@@ -1157,10 +1160,10 @@ var createRequestHandler = (build, mode) => {
|
|
|
1157
1160
|
};
|
|
1158
1161
|
if (_build.future.unstable_middleware) {
|
|
1159
1162
|
if (initialContext == null) {
|
|
1160
|
-
loadContext = new (0,
|
|
1163
|
+
loadContext = new (0, _chunkV6PEDDZIjs.unstable_RouterContextProvider)();
|
|
1161
1164
|
} else {
|
|
1162
1165
|
try {
|
|
1163
|
-
loadContext = new (0,
|
|
1166
|
+
loadContext = new (0, _chunkV6PEDDZIjs.unstable_RouterContextProvider)(
|
|
1164
1167
|
initialContext
|
|
1165
1168
|
);
|
|
1166
1169
|
} catch (e) {
|
|
@@ -1179,12 +1182,12 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1179
1182
|
let url = new URL(request.url);
|
|
1180
1183
|
let normalizedBasename = _build.basename || "/";
|
|
1181
1184
|
let normalizedPath = url.pathname;
|
|
1182
|
-
if (
|
|
1185
|
+
if (_chunkV6PEDDZIjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) === "/_root.data") {
|
|
1183
1186
|
normalizedPath = normalizedBasename;
|
|
1184
1187
|
} else if (normalizedPath.endsWith(".data")) {
|
|
1185
1188
|
normalizedPath = normalizedPath.replace(/\.data$/, "");
|
|
1186
1189
|
}
|
|
1187
|
-
if (
|
|
1190
|
+
if (_chunkV6PEDDZIjs.stripBasename.call(void 0, normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
1188
1191
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
1189
1192
|
}
|
|
1190
1193
|
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
@@ -1195,7 +1198,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1195
1198
|
} else if (!_build.prerender.includes(decodedPath) && !_build.prerender.includes(decodedPath + "/")) {
|
|
1196
1199
|
if (url.pathname.endsWith(".data")) {
|
|
1197
1200
|
errorHandler(
|
|
1198
|
-
new (0,
|
|
1201
|
+
new (0, _chunkV6PEDDZIjs.ErrorResponseImpl)(
|
|
1199
1202
|
404,
|
|
1200
1203
|
"Not Found",
|
|
1201
1204
|
`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.`
|
|
@@ -1215,7 +1218,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1215
1218
|
}
|
|
1216
1219
|
}
|
|
1217
1220
|
}
|
|
1218
|
-
let manifestUrl =
|
|
1221
|
+
let manifestUrl = _chunkV6PEDDZIjs.getManifestPath.call(void 0,
|
|
1219
1222
|
_build.routeDiscovery.manifestPath,
|
|
1220
1223
|
normalizedBasename
|
|
1221
1224
|
);
|
|
@@ -1256,7 +1259,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1256
1259
|
params: singleFetchMatches ? singleFetchMatches[0].params : {},
|
|
1257
1260
|
request
|
|
1258
1261
|
});
|
|
1259
|
-
if (
|
|
1262
|
+
if (_chunkV6PEDDZIjs.isRedirectResponse.call(void 0, response)) {
|
|
1260
1263
|
let result = getSingleFetchRedirect(
|
|
1261
1264
|
response.status,
|
|
1262
1265
|
response.headers,
|
|
@@ -1264,7 +1267,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1264
1267
|
);
|
|
1265
1268
|
if (request.method === "GET") {
|
|
1266
1269
|
result = {
|
|
1267
|
-
[
|
|
1270
|
+
[_chunkV6PEDDZIjs.SingleFetchRedirectSymbol]: result
|
|
1268
1271
|
};
|
|
1269
1272
|
}
|
|
1270
1273
|
let headers = new Headers(response.headers);
|
|
@@ -1277,7 +1280,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
1277
1280
|
serverMode
|
|
1278
1281
|
),
|
|
1279
1282
|
{
|
|
1280
|
-
status:
|
|
1283
|
+
status: _chunkV6PEDDZIjs.SINGLE_FETCH_REDIRECT_STATUS,
|
|
1281
1284
|
headers
|
|
1282
1285
|
}
|
|
1283
1286
|
);
|
|
@@ -1390,13 +1393,13 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1390
1393
|
requestContext: loadContext,
|
|
1391
1394
|
unstable_respond: build.future.unstable_middleware ? (ctx) => renderHtml(ctx, isSpaMode) : void 0
|
|
1392
1395
|
});
|
|
1393
|
-
return
|
|
1396
|
+
return _chunkV6PEDDZIjs.isResponse.call(void 0, response) ? response : renderHtml(response, isSpaMode);
|
|
1394
1397
|
} catch (error) {
|
|
1395
1398
|
handleError(error);
|
|
1396
1399
|
return new Response(null, { status: 500 });
|
|
1397
1400
|
}
|
|
1398
1401
|
async function renderHtml(context, isSpaMode2) {
|
|
1399
|
-
if (
|
|
1402
|
+
if (_chunkV6PEDDZIjs.isResponse.call(void 0, context)) {
|
|
1400
1403
|
return context;
|
|
1401
1404
|
}
|
|
1402
1405
|
let headers = getDocumentHeaders(context, build);
|
|
@@ -1405,7 +1408,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1405
1408
|
}
|
|
1406
1409
|
if (context.errors) {
|
|
1407
1410
|
Object.values(context.errors).forEach((err) => {
|
|
1408
|
-
if (!
|
|
1411
|
+
if (!_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1409
1412
|
handleError(err);
|
|
1410
1413
|
}
|
|
1411
1414
|
});
|
|
@@ -1457,10 +1460,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1457
1460
|
} catch (error) {
|
|
1458
1461
|
handleError(error);
|
|
1459
1462
|
let errorForSecondRender = error;
|
|
1460
|
-
if (
|
|
1463
|
+
if (_chunkV6PEDDZIjs.isResponse.call(void 0, error)) {
|
|
1461
1464
|
try {
|
|
1462
1465
|
let data2 = await unwrapResponse(error);
|
|
1463
|
-
errorForSecondRender = new (0,
|
|
1466
|
+
errorForSecondRender = new (0, _chunkV6PEDDZIjs.ErrorResponseImpl)(
|
|
1464
1467
|
error.status,
|
|
1465
1468
|
error.statusText,
|
|
1466
1469
|
data2
|
|
@@ -1468,7 +1471,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1468
1471
|
} catch (e) {
|
|
1469
1472
|
}
|
|
1470
1473
|
}
|
|
1471
|
-
context =
|
|
1474
|
+
context = _chunkV6PEDDZIjs.getStaticContextFromError.call(void 0,
|
|
1472
1475
|
staticHandler.dataRoutes,
|
|
1473
1476
|
context,
|
|
1474
1477
|
errorForSecondRender
|
|
@@ -1515,7 +1518,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1515
1518
|
requestContext: loadContext,
|
|
1516
1519
|
unstable_respond: build.future.unstable_middleware ? (ctx) => ctx : void 0
|
|
1517
1520
|
});
|
|
1518
|
-
if (
|
|
1521
|
+
if (_chunkV6PEDDZIjs.isResponse.call(void 0, response)) {
|
|
1519
1522
|
return response;
|
|
1520
1523
|
}
|
|
1521
1524
|
if (typeof response === "string") {
|
|
@@ -1523,11 +1526,11 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1523
1526
|
}
|
|
1524
1527
|
return Response.json(response);
|
|
1525
1528
|
} catch (error) {
|
|
1526
|
-
if (
|
|
1529
|
+
if (_chunkV6PEDDZIjs.isResponse.call(void 0, error)) {
|
|
1527
1530
|
error.headers.set("X-Remix-Catch", "yes");
|
|
1528
1531
|
return error;
|
|
1529
1532
|
}
|
|
1530
|
-
if (
|
|
1533
|
+
if (_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1531
1534
|
if (error) {
|
|
1532
1535
|
handleError(error);
|
|
1533
1536
|
}
|
|
@@ -1655,7 +1658,7 @@ function createSessionStorage({
|
|
|
1655
1658
|
};
|
|
1656
1659
|
}
|
|
1657
1660
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1658
|
-
|
|
1661
|
+
_chunkV6PEDDZIjs.warnOnce.call(void 0,
|
|
1659
1662
|
cookie.isSigned,
|
|
1660
1663
|
`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.`
|
|
1661
1664
|
);
|
|
@@ -1750,12 +1753,12 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
|
|
|
1750
1753
|
...state,
|
|
1751
1754
|
loaderData: { ...state.loaderData }
|
|
1752
1755
|
};
|
|
1753
|
-
let initialMatches =
|
|
1756
|
+
let initialMatches = _chunkV6PEDDZIjs.matchRoutes.call(void 0, routes, location2, basename);
|
|
1754
1757
|
if (initialMatches) {
|
|
1755
1758
|
for (let match of initialMatches) {
|
|
1756
1759
|
let routeId = match.route.id;
|
|
1757
1760
|
let routeInfo = getRouteInfo(routeId);
|
|
1758
|
-
if (
|
|
1761
|
+
if (_chunkV6PEDDZIjs.shouldHydrateRouteLoader.call(void 0,
|
|
1759
1762
|
routeId,
|
|
1760
1763
|
routeInfo.clientLoader,
|
|
1761
1764
|
routeInfo.hasLoader,
|
|
@@ -1833,7 +1836,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1833
1836
|
}
|
|
1834
1837
|
}
|
|
1835
1838
|
);
|
|
1836
|
-
if (
|
|
1839
|
+
if (_chunkV6PEDDZIjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1837
1840
|
return /* @__PURE__ */ React.default.createElement(
|
|
1838
1841
|
ErrorWrapper,
|
|
1839
1842
|
{
|
|
@@ -1841,7 +1844,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1841
1844
|
title: "Unhandled Thrown Response!"
|
|
1842
1845
|
},
|
|
1843
1846
|
/* @__PURE__ */ React.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
1844
|
-
|
|
1847
|
+
_chunkV6PEDDZIjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
1845
1848
|
);
|
|
1846
1849
|
}
|
|
1847
1850
|
let errorInstance;
|
|
@@ -1867,7 +1870,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
1867
1870
|
function RSCDefaultRootErrorBoundary({
|
|
1868
1871
|
hasRootLayout
|
|
1869
1872
|
}) {
|
|
1870
|
-
let error =
|
|
1873
|
+
let error = _chunkV6PEDDZIjs.useRouteError.call(void 0, );
|
|
1871
1874
|
if (hasRootLayout === void 0) {
|
|
1872
1875
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
1873
1876
|
}
|
|
@@ -1887,9 +1890,10 @@ function createCallServer({
|
|
|
1887
1890
|
encodeReply,
|
|
1888
1891
|
fetch: fetchImplementation = fetch
|
|
1889
1892
|
}) {
|
|
1893
|
+
const globalVar = window;
|
|
1890
1894
|
let landedActionId = 0;
|
|
1891
1895
|
return async (id, args) => {
|
|
1892
|
-
let actionId =
|
|
1896
|
+
let actionId = globalVar.__routerActionID = (_nullishCoalesce(globalVar.__routerActionID, () => ( (globalVar.__routerActionID = 0)))) + 1;
|
|
1893
1897
|
const temporaryReferences = createTemporaryReferenceSet();
|
|
1894
1898
|
const response = await fetchImplementation(
|
|
1895
1899
|
new Request(location.href, {
|
|
@@ -1912,7 +1916,7 @@ function createCallServer({
|
|
|
1912
1916
|
window.location.href = payload.location;
|
|
1913
1917
|
return;
|
|
1914
1918
|
}
|
|
1915
|
-
|
|
1919
|
+
globalVar.__router.navigate(payload.location, {
|
|
1916
1920
|
replace: payload.replace
|
|
1917
1921
|
});
|
|
1918
1922
|
return payload.actionResult;
|
|
@@ -1926,21 +1930,21 @@ function createCallServer({
|
|
|
1926
1930
|
async () => {
|
|
1927
1931
|
const rerender = await payload.rerender;
|
|
1928
1932
|
if (!rerender) return;
|
|
1929
|
-
if (landedActionId < actionId &&
|
|
1933
|
+
if (landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
1930
1934
|
landedActionId = actionId;
|
|
1931
1935
|
if (rerender.type === "redirect") {
|
|
1932
1936
|
if (rerender.reload) {
|
|
1933
1937
|
window.location.href = rerender.location;
|
|
1934
1938
|
return;
|
|
1935
1939
|
}
|
|
1936
|
-
|
|
1940
|
+
globalVar.__router.navigate(rerender.location, {
|
|
1937
1941
|
replace: rerender.replace
|
|
1938
1942
|
});
|
|
1939
1943
|
return;
|
|
1940
1944
|
}
|
|
1941
1945
|
let lastMatch;
|
|
1942
1946
|
for (const match of rerender.matches) {
|
|
1943
|
-
|
|
1947
|
+
globalVar.__router.patchRoutes(
|
|
1944
1948
|
_nullishCoalesce(_optionalChain([lastMatch, 'optionalAccess', _19 => _19.id]), () => ( null)),
|
|
1945
1949
|
[createRouteFromServerManifest(match)],
|
|
1946
1950
|
true
|
|
@@ -1952,12 +1956,12 @@ function createCallServer({
|
|
|
1952
1956
|
window.__router._internalSetStateDoNotUseOrYouWillBreakYourApp({
|
|
1953
1957
|
loaderData: Object.assign(
|
|
1954
1958
|
{},
|
|
1955
|
-
|
|
1959
|
+
globalVar.__router.state.loaderData,
|
|
1956
1960
|
rerender.loaderData
|
|
1957
1961
|
),
|
|
1958
1962
|
errors: rerender.errors ? Object.assign(
|
|
1959
1963
|
{},
|
|
1960
|
-
|
|
1964
|
+
globalVar.__router.state.errors,
|
|
1961
1965
|
rerender.errors
|
|
1962
1966
|
) : null
|
|
1963
1967
|
});
|
|
@@ -1975,11 +1979,12 @@ function createRouterFromPayload({
|
|
|
1975
1979
|
unstable_getContext,
|
|
1976
1980
|
payload
|
|
1977
1981
|
}) {
|
|
1978
|
-
|
|
1982
|
+
const globalVar = window;
|
|
1983
|
+
if (globalVar.__router) return globalVar.__router;
|
|
1979
1984
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
1980
1985
|
let patches = /* @__PURE__ */ new Map();
|
|
1981
1986
|
_optionalChain([payload, 'access', _20 => _20.patches, 'optionalAccess', _21 => _21.forEach, 'call', _22 => _22((patch) => {
|
|
1982
|
-
|
|
1987
|
+
_chunkV6PEDDZIjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
1983
1988
|
if (!patches.has(patch.parentId)) {
|
|
1984
1989
|
patches.set(patch.parentId, []);
|
|
1985
1990
|
}
|
|
@@ -2001,11 +2006,11 @@ function createRouterFromPayload({
|
|
|
2001
2006
|
}
|
|
2002
2007
|
return [route];
|
|
2003
2008
|
}, []);
|
|
2004
|
-
|
|
2009
|
+
globalVar.__router = _chunkV6PEDDZIjs.createRouter.call(void 0, {
|
|
2005
2010
|
routes,
|
|
2006
2011
|
unstable_getContext,
|
|
2007
2012
|
basename: payload.basename,
|
|
2008
|
-
history:
|
|
2013
|
+
history: _chunkV6PEDDZIjs.createBrowserHistory.call(void 0, ),
|
|
2009
2014
|
hydrationData: getHydrationData(
|
|
2010
2015
|
{
|
|
2011
2016
|
loaderData: payload.loaderData,
|
|
@@ -2015,7 +2020,7 @@ function createRouterFromPayload({
|
|
|
2015
2020
|
routes,
|
|
2016
2021
|
(routeId) => {
|
|
2017
2022
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
2018
|
-
|
|
2023
|
+
_chunkV6PEDDZIjs.invariant.call(void 0, match, "Route not found in payload");
|
|
2019
2024
|
return {
|
|
2020
2025
|
clientLoader: match.clientLoader,
|
|
2021
2026
|
hasLoader: match.hasLoader,
|
|
@@ -2039,30 +2044,30 @@ function createRouterFromPayload({
|
|
|
2039
2044
|
},
|
|
2040
2045
|
// FIXME: Pass `build.ssr` into this function
|
|
2041
2046
|
dataStrategy: getRSCSingleFetchDataStrategy(
|
|
2042
|
-
() =>
|
|
2047
|
+
() => globalVar.__router,
|
|
2043
2048
|
true,
|
|
2044
2049
|
payload.basename,
|
|
2045
2050
|
createFromReadableStream,
|
|
2046
2051
|
fetchImplementation
|
|
2047
2052
|
)
|
|
2048
2053
|
});
|
|
2049
|
-
if (
|
|
2050
|
-
|
|
2051
|
-
|
|
2054
|
+
if (globalVar.__router.state.initialized) {
|
|
2055
|
+
globalVar.__routerInitialized = true;
|
|
2056
|
+
globalVar.__router.initialize();
|
|
2052
2057
|
} else {
|
|
2053
|
-
|
|
2058
|
+
globalVar.__routerInitialized = false;
|
|
2054
2059
|
}
|
|
2055
2060
|
let lastLoaderData = void 0;
|
|
2056
|
-
|
|
2061
|
+
globalVar.__router.subscribe(({ loaderData, actionData }) => {
|
|
2057
2062
|
if (lastLoaderData !== loaderData) {
|
|
2058
|
-
|
|
2063
|
+
globalVar.__routerActionID = (_nullishCoalesce(globalVar.__routerActionID, () => ( (globalVar.__routerActionID = 0)))) + 1;
|
|
2059
2064
|
}
|
|
2060
2065
|
});
|
|
2061
|
-
return
|
|
2066
|
+
return globalVar.__router;
|
|
2062
2067
|
}
|
|
2063
|
-
var renderedRoutesContext =
|
|
2068
|
+
var renderedRoutesContext = _chunkV6PEDDZIjs.unstable_createContext.call(void 0, );
|
|
2064
2069
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
2065
|
-
let dataStrategy =
|
|
2070
|
+
let dataStrategy = _chunkV6PEDDZIjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
2066
2071
|
getRouter,
|
|
2067
2072
|
(match) => {
|
|
2068
2073
|
let M = match;
|
|
@@ -2116,20 +2121,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
2116
2121
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
2117
2122
|
return async (args, basename, targetRoutes) => {
|
|
2118
2123
|
let { request, context } = args;
|
|
2119
|
-
let url =
|
|
2124
|
+
let url = _chunkV6PEDDZIjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
2120
2125
|
if (request.method === "GET") {
|
|
2121
|
-
url =
|
|
2126
|
+
url = _chunkV6PEDDZIjs.stripIndexParam.call(void 0, url);
|
|
2122
2127
|
if (targetRoutes) {
|
|
2123
2128
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
2124
2129
|
}
|
|
2125
2130
|
}
|
|
2126
2131
|
let res = await fetchImplementation(
|
|
2127
|
-
new Request(url, await
|
|
2132
|
+
new Request(url, await _chunkV6PEDDZIjs.createRequestInit.call(void 0, request))
|
|
2128
2133
|
);
|
|
2129
2134
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
2130
|
-
throw new (0,
|
|
2135
|
+
throw new (0, _chunkV6PEDDZIjs.ErrorResponseImpl)(404, "Not Found", true);
|
|
2131
2136
|
}
|
|
2132
|
-
|
|
2137
|
+
_chunkV6PEDDZIjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
2133
2138
|
try {
|
|
2134
2139
|
const payload = await createFromReadableStream(res.body, {
|
|
2135
2140
|
temporaryReferences: void 0
|
|
@@ -2153,7 +2158,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
2153
2158
|
}
|
|
2154
2159
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
2155
2160
|
let results = { routes: {} };
|
|
2156
|
-
const dataKey =
|
|
2161
|
+
const dataKey = _chunkV6PEDDZIjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
2157
2162
|
for (let [routeId, data2] of Object.entries(payload[dataKey] || {})) {
|
|
2158
2163
|
results.routes[routeId] = { data: data2 };
|
|
2159
2164
|
}
|
|
@@ -2191,9 +2196,10 @@ function RSCHydratedRouter({
|
|
|
2191
2196
|
]
|
|
2192
2197
|
);
|
|
2193
2198
|
React4.useLayoutEffect(() => {
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2199
|
+
const globalVar = window;
|
|
2200
|
+
if (!globalVar.__routerInitialized) {
|
|
2201
|
+
globalVar.__routerInitialized = true;
|
|
2202
|
+
globalVar.__router.initialize();
|
|
2197
2203
|
}
|
|
2198
2204
|
}, []);
|
|
2199
2205
|
let [location2, setLocation] = React4.useState(router.state.location);
|
|
@@ -2274,7 +2280,7 @@ function RSCHydratedRouter({
|
|
|
2274
2280
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2275
2281
|
routeModules: {}
|
|
2276
2282
|
};
|
|
2277
|
-
return /* @__PURE__ */ React4.createElement(
|
|
2283
|
+
return /* @__PURE__ */ React4.createElement(_chunkV6PEDDZIjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(_chunkV6PEDDZIjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(_chunk4ADB4KIOjs.RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2278
2284
|
}
|
|
2279
2285
|
function createRouteFromServerManifest(match, payload) {
|
|
2280
2286
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -2334,7 +2340,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2334
2340
|
return await callSingleFetch(singleFetch);
|
|
2335
2341
|
}
|
|
2336
2342
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
2337
|
-
throw
|
|
2343
|
+
throw _chunkV6PEDDZIjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
2338
2344
|
},
|
|
2339
2345
|
path: match.path,
|
|
2340
2346
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -2347,7 +2353,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2347
2353
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
2348
2354
|
};
|
|
2349
2355
|
if (typeof dataRoute.loader === "function") {
|
|
2350
|
-
dataRoute.loader.hydrate =
|
|
2356
|
+
dataRoute.loader.hydrate = _chunkV6PEDDZIjs.shouldHydrateRouteLoader.call(void 0,
|
|
2351
2357
|
match.id,
|
|
2352
2358
|
match.clientLoader,
|
|
2353
2359
|
match.hasLoader,
|
|
@@ -2357,7 +2363,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
2357
2363
|
return dataRoute;
|
|
2358
2364
|
}
|
|
2359
2365
|
function callSingleFetch(singleFetch) {
|
|
2360
|
-
|
|
2366
|
+
_chunkV6PEDDZIjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
2361
2367
|
return singleFetch();
|
|
2362
2368
|
}
|
|
2363
2369
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -2365,7 +2371,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
2365
2371
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
2366
2372
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
2367
2373
|
console.error(msg);
|
|
2368
|
-
throw new (0,
|
|
2374
|
+
throw new (0, _chunkV6PEDDZIjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
2369
2375
|
}
|
|
2370
2376
|
}
|
|
2371
2377
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -2379,7 +2385,8 @@ function getManifestUrl(paths) {
|
|
|
2379
2385
|
if (paths.length === 1) {
|
|
2380
2386
|
return new URL(`${paths[0]}.manifest`, window.location.origin);
|
|
2381
2387
|
}
|
|
2382
|
-
|
|
2388
|
+
const globalVar = window;
|
|
2389
|
+
let basename = (_nullishCoalesce(globalVar.__router.basename, () => ( ""))).replace(/^\/|\/$/g, "");
|
|
2383
2390
|
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
|
2384
2391
|
paths.sort().forEach((path) => url.searchParams.append("p", path));
|
|
2385
2392
|
return url;
|
|
@@ -2405,9 +2412,10 @@ async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fet
|
|
|
2405
2412
|
}
|
|
2406
2413
|
paths.forEach((p) => addToFifoQueue(p, discoveredPaths));
|
|
2407
2414
|
payload.patches.forEach((p) => {
|
|
2408
|
-
window.__router.patchRoutes(
|
|
2409
|
-
|
|
2410
|
-
|
|
2415
|
+
window.__router.patchRoutes(
|
|
2416
|
+
_nullishCoalesce(p.parentId, () => ( null)),
|
|
2417
|
+
[createRouteFromServerManifest(p)]
|
|
2418
|
+
);
|
|
2411
2419
|
});
|
|
2412
2420
|
}
|
|
2413
2421
|
function addToFifoQueue(path, queue) {
|
|
@@ -2585,7 +2593,7 @@ function RSCStaticRouter({
|
|
|
2585
2593
|
if (payload.type !== "render") return null;
|
|
2586
2594
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2587
2595
|
for (const match of payload.matches) {
|
|
2588
|
-
if (
|
|
2596
|
+
if (_chunkV6PEDDZIjs.shouldHydrateRouteLoader.call(void 0,
|
|
2589
2597
|
match.id,
|
|
2590
2598
|
match.clientLoader,
|
|
2591
2599
|
match.hasLoader,
|
|
@@ -2619,7 +2627,7 @@ function RSCStaticRouter({
|
|
|
2619
2627
|
}
|
|
2620
2628
|
}))
|
|
2621
2629
|
};
|
|
2622
|
-
const router =
|
|
2630
|
+
const router = _chunk4ADB4KIOjs.createStaticRouter.call(void 0,
|
|
2623
2631
|
payload.matches.reduceRight((previous, match) => {
|
|
2624
2632
|
const route = {
|
|
2625
2633
|
id: match.id,
|
|
@@ -2663,8 +2671,8 @@ function RSCStaticRouter({
|
|
|
2663
2671
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2664
2672
|
routeModules: {}
|
|
2665
2673
|
};
|
|
2666
|
-
return /* @__PURE__ */ React5.createElement(
|
|
2667
|
-
|
|
2674
|
+
return /* @__PURE__ */ React5.createElement(_chunkV6PEDDZIjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(_chunkV6PEDDZIjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2675
|
+
_chunk4ADB4KIOjs.StaticRouterProvider,
|
|
2668
2676
|
{
|
|
2669
2677
|
context,
|
|
2670
2678
|
router,
|
|
@@ -2722,7 +2730,7 @@ function deserializeErrors(errors) {
|
|
|
2722
2730
|
let serialized = {};
|
|
2723
2731
|
for (let [key, val] of entries) {
|
|
2724
2732
|
if (val && val.__type === "RouteErrorResponse") {
|
|
2725
|
-
serialized[key] = new (0,
|
|
2733
|
+
serialized[key] = new (0, _chunkV6PEDDZIjs.ErrorResponseImpl)(
|
|
2726
2734
|
val.status,
|
|
2727
2735
|
val.statusText,
|
|
2728
2736
|
val.data,
|
|
@@ -2877,4 +2885,7 @@ function deserializeErrors(errors) {
|
|
|
2877
2885
|
|
|
2878
2886
|
|
|
2879
2887
|
|
|
2880
|
-
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
|
+
|
|
2891
|
+
exports.Await = _chunk4ADB4KIOjs.Await; exports.BrowserRouter = _chunk4ADB4KIOjs.BrowserRouter; exports.Form = _chunk4ADB4KIOjs.Form; exports.HashRouter = _chunk4ADB4KIOjs.HashRouter; exports.IDLE_BLOCKER = _chunkV6PEDDZIjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkV6PEDDZIjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkV6PEDDZIjs.IDLE_NAVIGATION; exports.Link = _chunk4ADB4KIOjs.Link; exports.Links = _chunkV6PEDDZIjs.Links; exports.MemoryRouter = _chunk4ADB4KIOjs.MemoryRouter; exports.Meta = _chunkV6PEDDZIjs.Meta; exports.NavLink = _chunk4ADB4KIOjs.NavLink; exports.Navigate = _chunk4ADB4KIOjs.Navigate; exports.NavigationType = _chunkV6PEDDZIjs.Action; exports.Outlet = _chunk4ADB4KIOjs.Outlet; exports.PrefetchPageLinks = _chunkV6PEDDZIjs.PrefetchPageLinks; exports.Route = _chunk4ADB4KIOjs.Route; exports.Router = _chunk4ADB4KIOjs.Router; exports.RouterProvider = _chunk4ADB4KIOjs.RouterProvider; exports.Routes = _chunk4ADB4KIOjs.Routes; exports.Scripts = _chunkV6PEDDZIjs.Scripts; exports.ScrollRestoration = _chunk4ADB4KIOjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunk4ADB4KIOjs.StaticRouter; exports.StaticRouterProvider = _chunk4ADB4KIOjs.StaticRouterProvider; exports.UNSAFE_DataRouterContext = _chunkV6PEDDZIjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkV6PEDDZIjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkV6PEDDZIjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkV6PEDDZIjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkV6PEDDZIjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkV6PEDDZIjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkV6PEDDZIjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkV6PEDDZIjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkV6PEDDZIjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkV6PEDDZIjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkV6PEDDZIjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunk4ADB4KIOjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk4ADB4KIOjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk4ADB4KIOjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkV6PEDDZIjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkV6PEDDZIjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkV6PEDDZIjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createRouter = _chunkV6PEDDZIjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkV6PEDDZIjs.decodeViaTurboStream; exports.UNSAFE_deserializeErrors = deserializeErrors; exports.UNSAFE_getHydrationData = getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkV6PEDDZIjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkV6PEDDZIjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunk4ADB4KIOjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkV6PEDDZIjs.invariant; exports.UNSAFE_mapRouteProperties = _chunk4ADB4KIOjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkV6PEDDZIjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkV6PEDDZIjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunk4ADB4KIOjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunk4ADB4KIOjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunk4ADB4KIOjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunk4ADB4KIOjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunk4ADB4KIOjs.createBrowserRouter; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunk4ADB4KIOjs.createHashRouter; exports.createMemoryRouter = _chunk4ADB4KIOjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkV6PEDDZIjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunk4ADB4KIOjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunk4ADB4KIOjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunk4ADB4KIOjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunk4ADB4KIOjs.createStaticHandler; exports.createStaticRouter = _chunk4ADB4KIOjs.createStaticRouter; exports.data = _chunkV6PEDDZIjs.data; exports.generatePath = _chunkV6PEDDZIjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkV6PEDDZIjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkV6PEDDZIjs.matchPath; exports.matchRoutes = _chunkV6PEDDZIjs.matchRoutes; exports.parsePath = _chunkV6PEDDZIjs.parsePath; exports.redirect = _chunkV6PEDDZIjs.redirect; exports.redirectDocument = _chunkV6PEDDZIjs.redirectDocument; exports.renderMatches = _chunk4ADB4KIOjs.renderMatches; exports.replace = _chunkV6PEDDZIjs.replace; exports.resolvePath = _chunkV6PEDDZIjs.resolvePath; exports.unstable_HistoryRouter = _chunk4ADB4KIOjs.HistoryRouter; exports.unstable_RSCHydratedRouter = RSCHydratedRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_RouterContextProvider = _chunkV6PEDDZIjs.unstable_RouterContextProvider; exports.unstable_createCallServer = createCallServer; exports.unstable_createContext = _chunkV6PEDDZIjs.unstable_createContext; exports.unstable_getRSCStream = getRSCStream; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunk4ADB4KIOjs.usePrompt; exports.useActionData = _chunkV6PEDDZIjs.useActionData; exports.useAsyncError = _chunkV6PEDDZIjs.useAsyncError; exports.useAsyncValue = _chunkV6PEDDZIjs.useAsyncValue; exports.useBeforeUnload = _chunk4ADB4KIOjs.useBeforeUnload; exports.useBlocker = _chunkV6PEDDZIjs.useBlocker; exports.useFetcher = _chunk4ADB4KIOjs.useFetcher; exports.useFetchers = _chunk4ADB4KIOjs.useFetchers; exports.useFormAction = _chunk4ADB4KIOjs.useFormAction; exports.useHref = _chunkV6PEDDZIjs.useHref; exports.useInRouterContext = _chunkV6PEDDZIjs.useInRouterContext; exports.useLinkClickHandler = _chunk4ADB4KIOjs.useLinkClickHandler; exports.useLoaderData = _chunkV6PEDDZIjs.useLoaderData; exports.useLocation = _chunkV6PEDDZIjs.useLocation; exports.useMatch = _chunkV6PEDDZIjs.useMatch; exports.useMatches = _chunkV6PEDDZIjs.useMatches; exports.useNavigate = _chunkV6PEDDZIjs.useNavigate; exports.useNavigation = _chunkV6PEDDZIjs.useNavigation; exports.useNavigationType = _chunkV6PEDDZIjs.useNavigationType; exports.useOutlet = _chunkV6PEDDZIjs.useOutlet; exports.useOutletContext = _chunkV6PEDDZIjs.useOutletContext; exports.useParams = _chunkV6PEDDZIjs.useParams; exports.useResolvedPath = _chunkV6PEDDZIjs.useResolvedPath; exports.useRevalidator = _chunkV6PEDDZIjs.useRevalidator; exports.useRouteError = _chunkV6PEDDZIjs.useRouteError; exports.useRouteLoaderData = _chunkV6PEDDZIjs.useRouteLoaderData; exports.useRoutes = _chunkV6PEDDZIjs.useRoutes; exports.useSearchParams = _chunk4ADB4KIOjs.useSearchParams; exports.useSubmit = _chunk4ADB4KIOjs.useSubmit; exports.useViewTransitionState = _chunk4ADB4KIOjs.useViewTransitionState;
|