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