react-router 7.15.1 → 7.18.5
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 +73 -2
- package/dist/development/{browser-BOdXz9dK.d.ts → browser-7x6a6gQP.d.ts} +2 -2
- package/dist/development/{browser-3AnU12UI.d.mts → browser-CiGxXXOl.d.mts} +2 -2
- package/dist/development/{chunk-D6LUOGOQ.js → chunk-2ZBLYC7V.js} +265 -57
- package/dist/development/{chunk-4N6VE7H7.mjs → chunk-6KYCQHYJ.mjs} +268 -60
- package/dist/{production/chunk-Y6IFXO7V.js → development/chunk-IFHLIXZW.js} +7 -7
- package/dist/development/{chunk-RJYABSBD.mjs → chunk-JAHXRPFV.mjs} +71 -122
- package/dist/development/{chunk-66UKHEGQ.js → chunk-NDF5KBLP.js} +112 -108
- package/dist/{production/context-ByvtofY2.d.mts → development/context-BlYKn1tE.d.mts} +24 -5
- package/dist/development/{data-BqZ2x964.d.ts → data-CjO11-hU.d.ts} +10 -2
- package/dist/{production/data-BVUf681J.d.mts → development/data-DEjBmEfD.d.mts} +10 -2
- package/dist/development/dom-export.d.mts +4 -4
- package/dist/development/dom-export.d.ts +4 -4
- package/dist/development/dom-export.js +61 -46
- package/dist/development/dom-export.mjs +39 -24
- package/dist/{production/index-react-server-client-BS5F89FR.d.ts → development/index-react-server-client-BaaZU3sM.d.ts} +32 -9
- package/dist/{production/index-react-server-client-DY04-103.d.mts → development/index-react-server-client-KK-TR-t7.d.mts} +20 -6
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +20 -2
- package/dist/development/index-react-server.d.ts +20 -2
- package/dist/development/index-react-server.js +212 -144
- package/dist/development/index-react-server.mjs +211 -143
- package/dist/development/index.d.mts +22 -15
- package/dist/development/index.d.ts +22 -15
- package/dist/development/index.js +160 -211
- package/dist/development/index.mjs +3 -5
- package/dist/{production/instrumentation-cRWWLfsU.d.ts → development/instrumentation-CPkMwccd.d.ts} +12 -2
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-Df8okEea.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/development/{register-Bsscfj79.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/dist/production/{browser-BOdXz9dK.d.ts → browser-7x6a6gQP.d.ts} +2 -2
- package/dist/production/{browser-3AnU12UI.d.mts → browser-CiGxXXOl.d.mts} +2 -2
- package/dist/production/{chunk-PNZCCTKT.js → chunk-75HN637G.js} +112 -108
- package/dist/production/{chunk-JAKZPQZC.mjs → chunk-7RTFRKQW.mjs} +268 -60
- package/dist/production/{chunk-HUBUW7R3.js → chunk-HNBICOIU.js} +265 -57
- package/dist/production/{chunk-6S4627ZB.mjs → chunk-IAM5GYT3.mjs} +71 -122
- package/dist/{development/chunk-4YRVXM2U.js → production/chunk-K3NA4NUH.js} +7 -7
- package/dist/{development/context-ByvtofY2.d.mts → production/context-BlYKn1tE.d.mts} +24 -5
- package/dist/production/{data-BqZ2x964.d.ts → data-CjO11-hU.d.ts} +10 -2
- package/dist/{development/data-BVUf681J.d.mts → production/data-DEjBmEfD.d.mts} +10 -2
- package/dist/production/dom-export.d.mts +4 -4
- package/dist/production/dom-export.d.ts +4 -4
- package/dist/production/dom-export.js +61 -46
- package/dist/production/dom-export.mjs +39 -24
- package/dist/{development/index-react-server-client-BS5F89FR.d.ts → production/index-react-server-client-BaaZU3sM.d.ts} +32 -9
- package/dist/{development/index-react-server-client-DY04-103.d.mts → production/index-react-server-client-KK-TR-t7.d.mts} +20 -6
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +20 -2
- package/dist/production/index-react-server.d.ts +20 -2
- package/dist/production/index-react-server.js +212 -144
- package/dist/production/index-react-server.mjs +211 -143
- package/dist/production/index.d.mts +22 -15
- package/dist/production/index.d.ts +22 -15
- package/dist/production/index.js +160 -211
- package/dist/production/index.mjs +3 -5
- package/dist/{development/instrumentation-cRWWLfsU.d.ts → production/instrumentation-CPkMwccd.d.ts} +12 -2
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-Df8okEea.d.mts → register-CmkRspdl.d.mts} +1 -1
- package/dist/production/{register-Bsscfj79.d.ts → register-roq_0qYo.d.ts} +1 -1
- package/docs/explanation/backend-for-frontend.md +50 -0
- package/docs/explanation/code-splitting.md +61 -0
- package/docs/explanation/concurrency.md +135 -0
- package/docs/explanation/form-vs-fetcher.md +292 -0
- package/docs/explanation/hot-module-replacement.md +137 -0
- package/docs/explanation/hydration.md +14 -0
- package/docs/explanation/index-query-param.md +86 -0
- package/docs/explanation/index.md +4 -0
- package/docs/explanation/lazy-route-discovery.md +78 -0
- package/docs/explanation/location.md +6 -0
- package/docs/explanation/progressive-enhancement.md +150 -0
- package/docs/explanation/race-conditions.md +88 -0
- package/docs/explanation/react-transitions.md +160 -0
- package/docs/explanation/route-matching.md +7 -0
- package/docs/explanation/server-client-execution.md +4 -0
- package/docs/explanation/sessions-and-cookies.md +465 -0
- package/docs/explanation/special-files.md +16 -0
- package/docs/explanation/state-management.md +524 -0
- package/docs/explanation/styling.md +87 -0
- package/docs/explanation/type-safety.md +82 -0
- package/docs/how-to/accessibility.md +44 -0
- package/docs/how-to/client-data.md +199 -0
- package/docs/how-to/data-strategy.md +317 -0
- package/docs/how-to/error-boundary.md +231 -0
- package/docs/how-to/error-reporting.md +142 -0
- package/docs/how-to/fetchers.md +307 -0
- package/docs/how-to/file-route-conventions.md +410 -0
- package/docs/how-to/file-uploads.md +217 -0
- package/docs/how-to/form-validation.md +120 -0
- package/docs/how-to/headers.md +165 -0
- package/docs/how-to/index.md +4 -0
- package/docs/how-to/instrumentation.md +556 -0
- package/docs/how-to/meta.md +40 -0
- package/docs/how-to/middleware.md +763 -0
- package/docs/how-to/navigation-blocking.md +233 -0
- package/docs/how-to/optimize-revalidation.md +12 -0
- package/docs/how-to/pre-rendering.md +225 -0
- package/docs/how-to/presets.md +103 -0
- package/docs/how-to/react-server-components.md +899 -0
- package/docs/how-to/resource-routes.md +126 -0
- package/docs/how-to/route-module-type-safety.md +100 -0
- package/docs/how-to/search-params.md +4 -0
- package/docs/how-to/security.md +32 -0
- package/docs/how-to/server-bundles.md +66 -0
- package/docs/how-to/spa.md +120 -0
- package/docs/how-to/status.md +63 -0
- package/docs/how-to/suspense.md +132 -0
- package/docs/how-to/using-handle.md +117 -0
- package/docs/how-to/view-transitions.md +237 -0
- package/docs/how-to/webhook.md +50 -0
- package/docs/index.md +39 -0
- package/docs/start/data/actions.md +138 -0
- package/docs/start/data/custom.md +198 -0
- package/docs/start/data/data-loading.md +44 -0
- package/docs/start/data/index.md +4 -0
- package/docs/start/data/installation.md +56 -0
- package/docs/start/data/navigating.md +12 -0
- package/docs/start/data/pending-ui.md +12 -0
- package/docs/start/data/route-object.md +268 -0
- package/docs/start/data/routing.md +281 -0
- package/docs/start/data/testing.md +8 -0
- package/docs/start/declarative/index.md +4 -0
- package/docs/start/declarative/installation.md +43 -0
- package/docs/start/declarative/navigating.md +133 -0
- package/docs/start/declarative/routing.md +237 -0
- package/docs/start/declarative/url-values.md +65 -0
- package/docs/start/framework/actions.md +174 -0
- package/docs/start/framework/data-loading.md +201 -0
- package/docs/start/framework/deploying.md +100 -0
- package/docs/start/framework/index.md +4 -0
- package/docs/start/framework/installation.md +41 -0
- package/docs/start/framework/navigating.md +182 -0
- package/docs/start/framework/pending-ui.md +142 -0
- package/docs/start/framework/rendering.md +59 -0
- package/docs/start/framework/route-module.md +527 -0
- package/docs/start/framework/routing.md +362 -0
- package/docs/start/framework/testing.md +133 -0
- package/docs/start/index.md +4 -0
- package/docs/start/modes.md +201 -0
- package/docs/upgrading/component-routes.md +363 -0
- package/docs/upgrading/future.md +490 -0
- package/docs/upgrading/index.md +4 -0
- package/docs/upgrading/remix.md +403 -0
- package/docs/upgrading/router-provider.md +442 -0
- package/docs/upgrading/v6.md +382 -0
- package/package.json +2 -1
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.18.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkK3NA4NUHjs = require('./chunk-K3NA4NUH.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ var _chunkY6IFXO7Vjs = require('./chunk-Y6IFXO7V.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunk75HN637Gjs = require('./chunk-75HN637G.js');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -153,7 +153,11 @@ var _chunkPNZCCTKTjs = require('./chunk-PNZCCTKT.js');
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
var _chunkHNBICOIUjs = require('./chunk-HNBICOIU.js');
|
|
157
161
|
|
|
158
162
|
// lib/dom/ssr/server.tsx
|
|
159
163
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -166,7 +170,7 @@ function ServerRouter({
|
|
|
166
170
|
url = new URL(url);
|
|
167
171
|
}
|
|
168
172
|
let { manifest, routeModules, criticalCss, serverHandoffString } = context;
|
|
169
|
-
let routes =
|
|
173
|
+
let routes = _chunkHNBICOIUjs.createServerRoutes.call(void 0,
|
|
170
174
|
manifest.routes,
|
|
171
175
|
routeModules,
|
|
172
176
|
context.future,
|
|
@@ -179,7 +183,7 @@ function ServerRouter({
|
|
|
179
183
|
let routeId = match.route.id;
|
|
180
184
|
let route = routeModules[routeId];
|
|
181
185
|
let manifestRoute = context.manifest.routes[routeId];
|
|
182
|
-
if (route && manifestRoute &&
|
|
186
|
+
if (route && manifestRoute && _chunkHNBICOIUjs.shouldHydrateRouteLoader.call(void 0,
|
|
183
187
|
routeId,
|
|
184
188
|
route.clientLoader,
|
|
185
189
|
manifestRoute.hasLoader,
|
|
@@ -188,11 +192,11 @@ function ServerRouter({
|
|
|
188
192
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
|
-
let router =
|
|
195
|
+
let router = _chunk75HN637Gjs.createStaticRouter.call(void 0, routes, context.staticHandlerContext, {
|
|
192
196
|
branches: context.branches
|
|
193
197
|
});
|
|
194
198
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
195
|
-
|
|
199
|
+
_chunkHNBICOIUjs.FrameworkContext.Provider,
|
|
196
200
|
{
|
|
197
201
|
value: {
|
|
198
202
|
manifest,
|
|
@@ -203,12 +207,13 @@ function ServerRouter({
|
|
|
203
207
|
ssr: context.ssr,
|
|
204
208
|
isSpaMode: context.isSpaMode,
|
|
205
209
|
routeDiscovery: context.routeDiscovery,
|
|
210
|
+
nonce,
|
|
206
211
|
serializeError: context.serializeError,
|
|
207
212
|
renderMeta: context.renderMeta
|
|
208
213
|
}
|
|
209
214
|
},
|
|
210
|
-
/* @__PURE__ */ React.createElement(
|
|
211
|
-
|
|
215
|
+
/* @__PURE__ */ React.createElement(_chunkHNBICOIUjs.RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
216
|
+
_chunk75HN637Gjs.StaticRouterProvider,
|
|
212
217
|
{
|
|
213
218
|
router,
|
|
214
219
|
context: context.staticHandlerContext,
|
|
@@ -216,7 +221,7 @@ function ServerRouter({
|
|
|
216
221
|
}
|
|
217
222
|
))
|
|
218
223
|
), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
|
|
219
|
-
|
|
224
|
+
_chunkHNBICOIUjs.StreamTransfer,
|
|
220
225
|
{
|
|
221
226
|
context,
|
|
222
227
|
identifier: 0,
|
|
@@ -243,7 +248,7 @@ function createRoutesStub(routes, _context) {
|
|
|
243
248
|
future: {
|
|
244
249
|
v8_passThroughRequests: _optionalChain([future, 'optionalAccess', _2 => _2.v8_passThroughRequests]) === true,
|
|
245
250
|
v8_middleware: _optionalChain([future, 'optionalAccess', _3 => _3.v8_middleware]) === true,
|
|
246
|
-
|
|
251
|
+
v8_trailingSlashAwareDataRequests: _optionalChain([future, 'optionalAccess', _4 => _4.v8_trailingSlashAwareDataRequests]) === true
|
|
247
252
|
},
|
|
248
253
|
manifest: {
|
|
249
254
|
routes: {},
|
|
@@ -259,18 +264,18 @@ function createRoutesStub(routes, _context) {
|
|
|
259
264
|
let patched = processRoutes(
|
|
260
265
|
// @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
|
|
261
266
|
// types compared to `RouteObject`
|
|
262
|
-
|
|
263
|
-
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0,
|
|
267
|
+
_chunkHNBICOIUjs.convertRoutesToDataRoutes.call(void 0, routes, (r) => r),
|
|
268
|
+
_context !== void 0 ? _context : _optionalChain([future, 'optionalAccess', _5 => _5.v8_middleware]) ? new (0, _chunkHNBICOIUjs.RouterContextProvider)() : {},
|
|
264
269
|
frameworkContextRef.current.manifest,
|
|
265
270
|
frameworkContextRef.current.routeModules
|
|
266
271
|
);
|
|
267
|
-
routerRef.current =
|
|
272
|
+
routerRef.current = _chunkHNBICOIUjs.createMemoryRouter.call(void 0, patched, {
|
|
268
273
|
initialEntries,
|
|
269
274
|
initialIndex,
|
|
270
275
|
hydrationData
|
|
271
276
|
});
|
|
272
277
|
}
|
|
273
|
-
return /* @__PURE__ */ React2.createElement(
|
|
278
|
+
return /* @__PURE__ */ React2.createElement(_chunkHNBICOIUjs.FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(_chunkHNBICOIUjs.RouterProvider, { router: routerRef.current }));
|
|
274
279
|
};
|
|
275
280
|
}
|
|
276
281
|
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
@@ -284,9 +289,9 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
284
289
|
id: route.id,
|
|
285
290
|
path: route.path,
|
|
286
291
|
index: route.index,
|
|
287
|
-
Component: route.Component ?
|
|
288
|
-
HydrateFallback: route.HydrateFallback ?
|
|
289
|
-
ErrorBoundary: route.ErrorBoundary ?
|
|
292
|
+
Component: route.Component ? _chunkHNBICOIUjs.withComponentProps.call(void 0, route.Component) : void 0,
|
|
293
|
+
HydrateFallback: route.HydrateFallback ? _chunkHNBICOIUjs.withHydrateFallbackProps.call(void 0, route.HydrateFallback) : void 0,
|
|
294
|
+
ErrorBoundary: route.ErrorBoundary ? _chunkHNBICOIUjs.withErrorBoundaryProps.call(void 0, route.ErrorBoundary) : void 0,
|
|
290
295
|
action: route.action ? (args) => route.action({ ...args, context }) : void 0,
|
|
291
296
|
loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
|
|
292
297
|
middleware: route.middleware ? route.middleware.map(
|
|
@@ -321,7 +326,7 @@ function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
|
321
326
|
};
|
|
322
327
|
manifest.routes[newRoute.id] = entryRoute;
|
|
323
328
|
routeModules[route.id] = {
|
|
324
|
-
default: newRoute.Component ||
|
|
329
|
+
default: newRoute.Component || _chunkHNBICOIUjs.Outlet,
|
|
325
330
|
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
326
331
|
handle: route.handle,
|
|
327
332
|
links: route.links,
|
|
@@ -516,7 +521,7 @@ function myUnescape(value) {
|
|
|
516
521
|
return result;
|
|
517
522
|
}
|
|
518
523
|
function warnOnceAboutExpiresCookie(name, expires) {
|
|
519
|
-
|
|
524
|
+
_chunkHNBICOIUjs.warnOnce.call(void 0,
|
|
520
525
|
!expires,
|
|
521
526
|
`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.`
|
|
522
527
|
);
|
|
@@ -565,33 +570,6 @@ function serializeError(error, serverMode) {
|
|
|
565
570
|
stack: sanitized.stack
|
|
566
571
|
};
|
|
567
572
|
}
|
|
568
|
-
function serializeErrors(errors, serverMode) {
|
|
569
|
-
if (!errors) return null;
|
|
570
|
-
let entries = Object.entries(errors);
|
|
571
|
-
let serialized = {};
|
|
572
|
-
for (let [key, val] of entries) {
|
|
573
|
-
if (_chunkHUBUW7R3js.isRouteErrorResponse.call(void 0, val)) {
|
|
574
|
-
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
575
|
-
} else if (val instanceof Error) {
|
|
576
|
-
let sanitized = sanitizeError(val, serverMode);
|
|
577
|
-
serialized[key] = {
|
|
578
|
-
message: sanitized.message,
|
|
579
|
-
stack: sanitized.stack,
|
|
580
|
-
__type: "Error",
|
|
581
|
-
// If this is a subclass (i.e., ReferenceError), send up the type so we
|
|
582
|
-
// can re-create the same type during hydration. This will only apply
|
|
583
|
-
// in dev mode since all production errors are sanitized to normal
|
|
584
|
-
// Error instances
|
|
585
|
-
...sanitized.name !== "Error" ? {
|
|
586
|
-
__subType: sanitized.name
|
|
587
|
-
} : {}
|
|
588
|
-
};
|
|
589
|
-
} else {
|
|
590
|
-
serialized[key] = val;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
return serialized;
|
|
594
|
-
}
|
|
595
573
|
|
|
596
574
|
// lib/server-runtime/invariant.ts
|
|
597
575
|
function invariant2(value, message) {
|
|
@@ -605,7 +583,7 @@ function invariant2(value, message) {
|
|
|
605
583
|
|
|
606
584
|
// lib/server-runtime/routeMatching.ts
|
|
607
585
|
function matchServerRoutes(manifest, dataRoutes, branches, pathname, basename) {
|
|
608
|
-
let matches =
|
|
586
|
+
let matches = _chunkHNBICOIUjs.matchRoutesImpl.call(void 0,
|
|
609
587
|
dataRoutes,
|
|
610
588
|
pathname,
|
|
611
589
|
_nullishCoalesce(basename, () => ( "/")),
|
|
@@ -636,7 +614,7 @@ async function callRouteHandler(handler, args, future) {
|
|
|
636
614
|
context: args.context,
|
|
637
615
|
pattern: args.pattern
|
|
638
616
|
});
|
|
639
|
-
if (
|
|
617
|
+
if (_chunkHNBICOIUjs.isDataWithResponseInit.call(void 0, result) && result.init && result.init.status && _chunkHNBICOIUjs.isRedirectStatusCode.call(void 0, result.init.status)) {
|
|
640
618
|
throw new Response(null, result.init);
|
|
641
619
|
}
|
|
642
620
|
return result;
|
|
@@ -739,17 +717,17 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
739
717
|
controller.close();
|
|
740
718
|
}
|
|
741
719
|
});
|
|
742
|
-
let decoded = await
|
|
720
|
+
let decoded = await _chunkHNBICOIUjs.decodeViaTurboStream.call(void 0, stream, global);
|
|
743
721
|
let data2 = decoded.value;
|
|
744
|
-
if (data2 &&
|
|
745
|
-
let result = data2[
|
|
722
|
+
if (data2 && _chunkHNBICOIUjs.SingleFetchRedirectSymbol in data2) {
|
|
723
|
+
let result = data2[_chunkHNBICOIUjs.SingleFetchRedirectSymbol];
|
|
746
724
|
let init = { status: result.status };
|
|
747
725
|
if (result.reload) {
|
|
748
|
-
throw
|
|
726
|
+
throw _chunkHNBICOIUjs.redirectDocument.call(void 0, result.redirect, init);
|
|
749
727
|
} else if (result.replace) {
|
|
750
|
-
throw
|
|
728
|
+
throw _chunkHNBICOIUjs.replace.call(void 0, result.redirect, init);
|
|
751
729
|
} else {
|
|
752
|
-
throw
|
|
730
|
+
throw _chunkHNBICOIUjs.redirect.call(void 0, result.redirect, init);
|
|
753
731
|
}
|
|
754
732
|
} else {
|
|
755
733
|
invariant2(
|
|
@@ -792,7 +770,7 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
792
770
|
|
|
793
771
|
// lib/server-runtime/serverHandoff.ts
|
|
794
772
|
function createServerHandoffString(serverHandoff) {
|
|
795
|
-
return
|
|
773
|
+
return _chunkHNBICOIUjs.escapeHtml.call(void 0, JSON.stringify(serverHandoff));
|
|
796
774
|
}
|
|
797
775
|
|
|
798
776
|
// lib/server-runtime/headers.ts
|
|
@@ -868,28 +846,29 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
868
846
|
}
|
|
869
847
|
|
|
870
848
|
// lib/actions.ts
|
|
871
|
-
function throwIfPotentialCSRFAttack(
|
|
872
|
-
let originHeader = headers.get("origin");
|
|
849
|
+
function throwIfPotentialCSRFAttack(request, allowedActionOrigins) {
|
|
850
|
+
let originHeader = request.headers.get("origin");
|
|
873
851
|
let originDomain = null;
|
|
852
|
+
let originUrl = null;
|
|
874
853
|
try {
|
|
875
|
-
|
|
854
|
+
if (typeof originHeader === "string" && originHeader !== "null") {
|
|
855
|
+
originUrl = new URL(originHeader);
|
|
856
|
+
originDomain = originUrl.host;
|
|
857
|
+
} else {
|
|
858
|
+
originDomain = originHeader;
|
|
859
|
+
}
|
|
876
860
|
} catch (e2) {
|
|
877
861
|
throw new Error(
|
|
878
862
|
`\`origin\` header is not a valid URL. Aborting the action.`
|
|
879
863
|
);
|
|
880
864
|
}
|
|
881
|
-
let
|
|
882
|
-
|
|
865
|
+
let requestUrl = new URL(request.url);
|
|
866
|
+
let originMatchesRequest = originUrl ? originUrl.origin === requestUrl.origin : originDomain === requestUrl.host;
|
|
867
|
+
if (originDomain && !originMatchesRequest) {
|
|
883
868
|
if (!isAllowedOrigin(originDomain, allowedActionOrigins)) {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
);
|
|
888
|
-
} else {
|
|
889
|
-
throw new Error(
|
|
890
|
-
"`x-forwarded-host` or `host` headers are not provided. One of these is needed to compare the `origin` header from a forwarded action request. Aborting the action."
|
|
891
|
-
);
|
|
892
|
-
}
|
|
869
|
+
throw new Error(
|
|
870
|
+
"The `request.url` origin does not match `origin` header from a forwarded action request. Aborting the action."
|
|
871
|
+
);
|
|
893
872
|
}
|
|
894
873
|
}
|
|
895
874
|
}
|
|
@@ -937,37 +916,25 @@ function isAllowedOrigin(originDomain, allowedActionOrigins = []) {
|
|
|
937
916
|
(allowedOrigin) => allowedOrigin && (allowedOrigin === originDomain || matchWildcardDomain(originDomain, allowedOrigin))
|
|
938
917
|
);
|
|
939
918
|
}
|
|
940
|
-
function parseHostHeader(headers) {
|
|
941
|
-
let forwardedHostHeader = headers.get("x-forwarded-host");
|
|
942
|
-
let forwardedHostValue = _optionalChain([forwardedHostHeader, 'optionalAccess', _6 => _6.split, 'call', _7 => _7(","), 'access', _8 => _8[0], 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]);
|
|
943
|
-
let hostHeader = headers.get("host");
|
|
944
|
-
return forwardedHostValue ? {
|
|
945
|
-
type: "x-forwarded-host",
|
|
946
|
-
value: forwardedHostValue
|
|
947
|
-
} : hostHeader ? {
|
|
948
|
-
type: "host",
|
|
949
|
-
value: hostHeader
|
|
950
|
-
} : void 0;
|
|
951
|
-
}
|
|
952
919
|
|
|
953
920
|
// lib/server-runtime/urls.ts
|
|
954
921
|
function getNormalizedPath(request, basename, future) {
|
|
955
922
|
basename = basename || "/";
|
|
956
923
|
let url = new URL(request.url);
|
|
957
924
|
let pathname = url.pathname;
|
|
958
|
-
if (_optionalChain([future, 'optionalAccess',
|
|
925
|
+
if (_optionalChain([future, 'optionalAccess', _6 => _6.v8_trailingSlashAwareDataRequests])) {
|
|
959
926
|
if (pathname.endsWith("/_.data")) {
|
|
960
927
|
pathname = pathname.replace(/_\.data$/, "");
|
|
961
928
|
} else {
|
|
962
929
|
pathname = pathname.replace(/\.data$/, "");
|
|
963
930
|
}
|
|
964
931
|
} else {
|
|
965
|
-
if (
|
|
932
|
+
if (_chunkHNBICOIUjs.stripBasename.call(void 0, pathname, basename) === "/_root.data") {
|
|
966
933
|
pathname = basename;
|
|
967
934
|
} else if (pathname.endsWith(".data")) {
|
|
968
935
|
pathname = pathname.replace(/\.data$/, "");
|
|
969
936
|
}
|
|
970
|
-
if (
|
|
937
|
+
if (_chunkHNBICOIUjs.stripBasename.call(void 0, pathname, basename) !== "/" && pathname.endsWith("/")) {
|
|
971
938
|
pathname = pathname.slice(0, -1);
|
|
972
939
|
}
|
|
973
940
|
}
|
|
@@ -987,14 +954,14 @@ function getNormalizedPath(request, basename, future) {
|
|
|
987
954
|
|
|
988
955
|
// lib/server-runtime/single-fetch.ts
|
|
989
956
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
990
|
-
...
|
|
957
|
+
..._chunkHNBICOIUjs.NO_BODY_STATUS_CODES,
|
|
991
958
|
304
|
|
992
959
|
]);
|
|
993
960
|
async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
|
|
994
961
|
try {
|
|
995
962
|
try {
|
|
996
963
|
throwIfPotentialCSRFAttack(
|
|
997
|
-
request
|
|
964
|
+
request,
|
|
998
965
|
Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
|
|
999
966
|
);
|
|
1000
967
|
} catch (e) {
|
|
@@ -1026,7 +993,7 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
1026
993
|
return handleQueryError(error);
|
|
1027
994
|
}
|
|
1028
995
|
function handleQueryResult(result) {
|
|
1029
|
-
return
|
|
996
|
+
return _chunkHNBICOIUjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
1030
997
|
}
|
|
1031
998
|
function handleQueryError(error, status = 500) {
|
|
1032
999
|
handleError(error);
|
|
@@ -1038,12 +1005,12 @@ async function singleFetchAction(build, serverMode, staticHandler, request, hand
|
|
|
1038
1005
|
}
|
|
1039
1006
|
function staticContextToResponse(context) {
|
|
1040
1007
|
let headers = getDocumentHeaders(context, build);
|
|
1041
|
-
if (
|
|
1008
|
+
if (_chunkHNBICOIUjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1042
1009
|
return new Response(null, { status: context.statusCode, headers });
|
|
1043
1010
|
}
|
|
1044
1011
|
if (context.errors) {
|
|
1045
1012
|
Object.values(context.errors).forEach((err) => {
|
|
1046
|
-
if (!
|
|
1013
|
+
if (!_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1047
1014
|
handleError(err);
|
|
1048
1015
|
}
|
|
1049
1016
|
});
|
|
@@ -1091,7 +1058,7 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1091
1058
|
return handleQueryError(error);
|
|
1092
1059
|
}
|
|
1093
1060
|
function handleQueryResult(result) {
|
|
1094
|
-
return
|
|
1061
|
+
return _chunkHNBICOIUjs.isResponse.call(void 0, result) ? result : staticContextToResponse(result);
|
|
1095
1062
|
}
|
|
1096
1063
|
function handleQueryError(error) {
|
|
1097
1064
|
handleError(error);
|
|
@@ -1103,12 +1070,12 @@ async function singleFetchLoaders(build, serverMode, staticHandler, request, han
|
|
|
1103
1070
|
}
|
|
1104
1071
|
function staticContextToResponse(context) {
|
|
1105
1072
|
let headers = getDocumentHeaders(context, build);
|
|
1106
|
-
if (
|
|
1073
|
+
if (_chunkHNBICOIUjs.isRedirectStatusCode.call(void 0, context.statusCode) && headers.has("Location")) {
|
|
1107
1074
|
return new Response(null, { status: context.statusCode, headers });
|
|
1108
1075
|
}
|
|
1109
1076
|
if (context.errors) {
|
|
1110
1077
|
Object.values(context.errors).forEach((err) => {
|
|
1111
|
-
if (!
|
|
1078
|
+
if (!_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1112
1079
|
handleError(err);
|
|
1113
1080
|
}
|
|
1114
1081
|
});
|
|
@@ -1172,15 +1139,15 @@ function generateSingleFetchRedirectResponse(redirectResponse, request, build, s
|
|
|
1172
1139
|
headers.delete("Location");
|
|
1173
1140
|
headers.set("Content-Type", "text/x-script");
|
|
1174
1141
|
return generateSingleFetchResponse(request, build, serverMode, {
|
|
1175
|
-
result: request.method === "GET" ? { [
|
|
1142
|
+
result: request.method === "GET" ? { [_chunkHNBICOIUjs.SingleFetchRedirectSymbol]: redirect2 } : redirect2,
|
|
1176
1143
|
headers,
|
|
1177
|
-
status:
|
|
1144
|
+
status: _chunkHNBICOIUjs.SINGLE_FETCH_REDIRECT_STATUS
|
|
1178
1145
|
});
|
|
1179
1146
|
}
|
|
1180
1147
|
function getSingleFetchRedirect(status, headers, basename) {
|
|
1181
1148
|
let redirect2 = headers.get("Location");
|
|
1182
1149
|
if (basename) {
|
|
1183
|
-
redirect2 =
|
|
1150
|
+
redirect2 = _chunkHNBICOIUjs.stripBasename.call(void 0, redirect2, basename) || redirect2;
|
|
1184
1151
|
}
|
|
1185
1152
|
return {
|
|
1186
1153
|
redirect: redirect2,
|
|
@@ -1217,7 +1184,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1217
1184
|
clearTimeout(timeoutId);
|
|
1218
1185
|
requestSignal.removeEventListener("abort", abortControllerOnRequestAbort);
|
|
1219
1186
|
};
|
|
1220
|
-
return
|
|
1187
|
+
return _chunkHNBICOIUjs.encode.call(void 0, data2, {
|
|
1221
1188
|
signal: controller.signal,
|
|
1222
1189
|
onComplete: cleanupCallbacks,
|
|
1223
1190
|
plugins: [
|
|
@@ -1226,12 +1193,12 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1226
1193
|
let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
|
|
1227
1194
|
return ["SanitizedError", name, message, stack];
|
|
1228
1195
|
}
|
|
1229
|
-
if (value instanceof
|
|
1196
|
+
if (value instanceof _chunkHNBICOIUjs.ErrorResponseImpl) {
|
|
1230
1197
|
let { data: data3, status, statusText } = value;
|
|
1231
1198
|
return ["ErrorResponse", data3, status, statusText];
|
|
1232
1199
|
}
|
|
1233
|
-
if (value && typeof value === "object" &&
|
|
1234
|
-
return ["SingleFetchRedirect", value[
|
|
1200
|
+
if (value && typeof value === "object" && _chunkHNBICOIUjs.SingleFetchRedirectSymbol in value) {
|
|
1201
|
+
return ["SingleFetchRedirect", value[_chunkHNBICOIUjs.SingleFetchRedirectSymbol]];
|
|
1235
1202
|
}
|
|
1236
1203
|
}
|
|
1237
1204
|
],
|
|
@@ -1253,7 +1220,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
|
1253
1220
|
function derive(build, mode) {
|
|
1254
1221
|
let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
|
|
1255
1222
|
let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
|
|
1256
|
-
let staticHandler =
|
|
1223
|
+
let staticHandler = _chunkHNBICOIUjs.createStaticHandler.call(void 0, dataRoutes, {
|
|
1257
1224
|
basename: build.basename,
|
|
1258
1225
|
instrumentations: build.entry.module.instrumentations,
|
|
1259
1226
|
future: build.future
|
|
@@ -1262,7 +1229,7 @@ function derive(build, mode) {
|
|
|
1262
1229
|
if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
|
|
1263
1230
|
console.error(
|
|
1264
1231
|
// @ts-expect-error This is "private" from users but intended for internal use
|
|
1265
|
-
|
|
1232
|
+
_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, error) && error.error ? error.error : error
|
|
1266
1233
|
);
|
|
1267
1234
|
}
|
|
1268
1235
|
});
|
|
@@ -1271,7 +1238,7 @@ function derive(build, mode) {
|
|
|
1271
1238
|
let loadContext;
|
|
1272
1239
|
let handleError = (error) => {
|
|
1273
1240
|
if (mode === "development" /* Development */) {
|
|
1274
|
-
_optionalChain([getDevServerHooks, 'call',
|
|
1241
|
+
_optionalChain([getDevServerHooks, 'call', _7 => _7(), 'optionalAccess', _8 => _8.processRequestError, 'optionalCall', _9 => _9(error)]);
|
|
1275
1242
|
}
|
|
1276
1243
|
errorHandler(error, {
|
|
1277
1244
|
context: loadContext,
|
|
@@ -1280,14 +1247,14 @@ function derive(build, mode) {
|
|
|
1280
1247
|
});
|
|
1281
1248
|
};
|
|
1282
1249
|
if (build.future.v8_middleware) {
|
|
1283
|
-
if (initialContext && !(initialContext instanceof
|
|
1250
|
+
if (initialContext && !(initialContext instanceof _chunkHNBICOIUjs.RouterContextProvider)) {
|
|
1284
1251
|
let error = new Error(
|
|
1285
1252
|
"Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
|
|
1286
1253
|
);
|
|
1287
1254
|
handleError(error);
|
|
1288
1255
|
return returnLastResortErrorResponse(error, serverMode);
|
|
1289
1256
|
}
|
|
1290
|
-
loadContext = initialContext || new (0,
|
|
1257
|
+
loadContext = initialContext || new (0, _chunkHNBICOIUjs.RouterContextProvider)();
|
|
1291
1258
|
} else {
|
|
1292
1259
|
loadContext = initialContext || {};
|
|
1293
1260
|
}
|
|
@@ -1301,10 +1268,10 @@ function derive(build, mode) {
|
|
|
1301
1268
|
if (!build.ssr) {
|
|
1302
1269
|
let decodedPath = decodeURI(normalizedPathname);
|
|
1303
1270
|
if (build.basename && build.basename !== "/") {
|
|
1304
|
-
let strippedPath =
|
|
1271
|
+
let strippedPath = _chunkHNBICOIUjs.stripBasename.call(void 0, decodedPath, build.basename);
|
|
1305
1272
|
if (strippedPath == null) {
|
|
1306
1273
|
errorHandler(
|
|
1307
|
-
new (0,
|
|
1274
|
+
new (0, _chunkHNBICOIUjs.ErrorResponseImpl)(
|
|
1308
1275
|
404,
|
|
1309
1276
|
"Not Found",
|
|
1310
1277
|
`Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${build.basename}\``
|
|
@@ -1324,10 +1291,10 @@ function derive(build, mode) {
|
|
|
1324
1291
|
}
|
|
1325
1292
|
if (build.prerender.length === 0) {
|
|
1326
1293
|
isSpaMode = true;
|
|
1327
|
-
} else if (!build.prerender.includes(decodedPath) && !build.prerender.includes(decodedPath
|
|
1294
|
+
} else if (!build.prerender.includes(decodedPath.replace(/\/$/, "")) && !build.prerender.includes(decodedPath.replace(/[^/]$/, "/"))) {
|
|
1328
1295
|
if (requestUrl.pathname.endsWith(".data")) {
|
|
1329
1296
|
errorHandler(
|
|
1330
|
-
new (0,
|
|
1297
|
+
new (0, _chunkHNBICOIUjs.ErrorResponseImpl)(
|
|
1331
1298
|
404,
|
|
1332
1299
|
"Not Found",
|
|
1333
1300
|
`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.`
|
|
@@ -1347,11 +1314,11 @@ function derive(build, mode) {
|
|
|
1347
1314
|
}
|
|
1348
1315
|
}
|
|
1349
1316
|
}
|
|
1350
|
-
let manifestUrl =
|
|
1317
|
+
let manifestUrl = _chunkHNBICOIUjs.getManifestPath.call(void 0,
|
|
1351
1318
|
build.routeDiscovery.manifestPath,
|
|
1352
1319
|
build.basename
|
|
1353
1320
|
);
|
|
1354
|
-
if (requestUrl.pathname === manifestUrl) {
|
|
1321
|
+
if (build.routeDiscovery.mode === "lazy" && requestUrl.pathname === manifestUrl) {
|
|
1355
1322
|
try {
|
|
1356
1323
|
let res = await handleManifestRequest(
|
|
1357
1324
|
build,
|
|
@@ -1386,7 +1353,7 @@ function derive(build, mode) {
|
|
|
1386
1353
|
loadContext,
|
|
1387
1354
|
handleError
|
|
1388
1355
|
);
|
|
1389
|
-
if (
|
|
1356
|
+
if (_chunkHNBICOIUjs.isRedirectResponse.call(void 0, response)) {
|
|
1390
1357
|
response = generateSingleFetchRedirectResponse(
|
|
1391
1358
|
response,
|
|
1392
1359
|
request,
|
|
@@ -1400,7 +1367,7 @@ function derive(build, mode) {
|
|
|
1400
1367
|
params: matches ? matches[0].params : {},
|
|
1401
1368
|
request
|
|
1402
1369
|
});
|
|
1403
|
-
if (
|
|
1370
|
+
if (_chunkHNBICOIUjs.isRedirectResponse.call(void 0, response)) {
|
|
1404
1371
|
response = generateSingleFetchRedirectResponse(
|
|
1405
1372
|
response,
|
|
1406
1373
|
request,
|
|
@@ -1424,8 +1391,8 @@ function derive(build, mode) {
|
|
|
1424
1391
|
let criticalCss = void 0;
|
|
1425
1392
|
if (build.unstable_getCriticalCss) {
|
|
1426
1393
|
criticalCss = await build.unstable_getCriticalCss({ pathname });
|
|
1427
|
-
} else if (mode === "development" /* Development */ && _optionalChain([getDevServerHooks, 'call',
|
|
1428
|
-
criticalCss = await _optionalChain([getDevServerHooks, 'call',
|
|
1394
|
+
} else if (mode === "development" /* Development */ && _optionalChain([getDevServerHooks, 'call', _10 => _10(), 'optionalAccess', _11 => _11.getCriticalCss])) {
|
|
1395
|
+
criticalCss = await _optionalChain([getDevServerHooks, 'call', _12 => _12(), 'optionalAccess', _13 => _13.getCriticalCss, 'optionalCall', _14 => _14(pathname)]);
|
|
1429
1396
|
}
|
|
1430
1397
|
response = await handleDocumentRequest(
|
|
1431
1398
|
serverMode,
|
|
@@ -1448,7 +1415,7 @@ function derive(build, mode) {
|
|
|
1448
1415
|
return response;
|
|
1449
1416
|
};
|
|
1450
1417
|
if (build.entry.module.instrumentations) {
|
|
1451
|
-
requestHandler =
|
|
1418
|
+
requestHandler = _chunkHNBICOIUjs.instrumentHandler.call(void 0,
|
|
1452
1419
|
requestHandler,
|
|
1453
1420
|
build.entry.module.instrumentations.map((i) => i.handler).filter(Boolean)
|
|
1454
1421
|
);
|
|
@@ -1485,6 +1452,12 @@ var createRequestHandler = (build, mode) => {
|
|
|
1485
1452
|
};
|
|
1486
1453
|
};
|
|
1487
1454
|
async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
1455
|
+
if (url.toString().length > _chunkHNBICOIUjs.URL_LIMIT) {
|
|
1456
|
+
return new Response(null, {
|
|
1457
|
+
statusText: "Bad Request",
|
|
1458
|
+
status: 400
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1488
1461
|
if (build.assets.version !== url.searchParams.get("version")) {
|
|
1489
1462
|
return new Response(null, {
|
|
1490
1463
|
status: 204,
|
|
@@ -1493,28 +1466,14 @@ async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
|
1493
1466
|
}
|
|
1494
1467
|
});
|
|
1495
1468
|
}
|
|
1496
|
-
if (url.toString().length > _chunkHUBUW7R3js.URL_LIMIT) {
|
|
1497
|
-
return new Response(null, {
|
|
1498
|
-
statusText: "Bad Request",
|
|
1499
|
-
status: 400
|
|
1500
|
-
});
|
|
1501
|
-
}
|
|
1502
1469
|
let patches = {};
|
|
1503
1470
|
if (url.searchParams.has("paths")) {
|
|
1504
|
-
let paths = /* @__PURE__ */ new Set();
|
|
1505
1471
|
let pathParam = url.searchParams.get("paths") || "";
|
|
1506
|
-
let
|
|
1507
|
-
|
|
1472
|
+
let paths = new Set(pathParam.split(",").filter(Boolean));
|
|
1473
|
+
for (let path of paths) {
|
|
1508
1474
|
if (!path.startsWith("/")) {
|
|
1509
1475
|
path = `/${path}`;
|
|
1510
1476
|
}
|
|
1511
|
-
let segments = path.split("/").slice(1);
|
|
1512
|
-
segments.forEach((_, i) => {
|
|
1513
|
-
let partialPath = segments.slice(0, i + 1).join("/");
|
|
1514
|
-
paths.add(`/${partialPath}`);
|
|
1515
|
-
});
|
|
1516
|
-
});
|
|
1517
|
-
for (let path of paths) {
|
|
1518
1477
|
let matches = matchServerRoutes(
|
|
1519
1478
|
build.routes,
|
|
1520
1479
|
dataRoutes,
|
|
@@ -1543,7 +1502,7 @@ async function handleManifestRequest(build, dataRoutes, branches, url) {
|
|
|
1543
1502
|
async function handleSingleFetchRequest(serverMode, build, staticHandler, request, normalizedPath, loadContext, handleError) {
|
|
1544
1503
|
let handlerUrl = new URL(request.url);
|
|
1545
1504
|
handlerUrl.pathname = normalizedPath;
|
|
1546
|
-
let response =
|
|
1505
|
+
let response = _chunkHNBICOIUjs.isMutationMethod.call(void 0, request.method) ? await singleFetchAction(
|
|
1547
1506
|
build,
|
|
1548
1507
|
serverMode,
|
|
1549
1508
|
staticHandler,
|
|
@@ -1564,10 +1523,10 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
1564
1523
|
}
|
|
1565
1524
|
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
|
|
1566
1525
|
try {
|
|
1567
|
-
if (
|
|
1526
|
+
if (_chunkHNBICOIUjs.isMutationMethod.call(void 0, request.method)) {
|
|
1568
1527
|
try {
|
|
1569
1528
|
throwIfPotentialCSRFAttack(
|
|
1570
|
-
request
|
|
1529
|
+
request,
|
|
1571
1530
|
Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
|
|
1572
1531
|
);
|
|
1573
1532
|
} catch (e) {
|
|
@@ -1580,7 +1539,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1580
1539
|
generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
|
|
1581
1540
|
try {
|
|
1582
1541
|
let innerResult = await query(request);
|
|
1583
|
-
if (!
|
|
1542
|
+
if (!_chunkHNBICOIUjs.isResponse.call(void 0, innerResult)) {
|
|
1584
1543
|
innerResult = await renderHtml(innerResult, isSpaMode);
|
|
1585
1544
|
}
|
|
1586
1545
|
return innerResult;
|
|
@@ -1591,7 +1550,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1591
1550
|
} : void 0,
|
|
1592
1551
|
normalizePath: (r) => getNormalizedPath(r, build.basename, build.future)
|
|
1593
1552
|
});
|
|
1594
|
-
if (!
|
|
1553
|
+
if (!_chunkHNBICOIUjs.isResponse.call(void 0, result)) {
|
|
1595
1554
|
result = await renderHtml(result, isSpaMode);
|
|
1596
1555
|
}
|
|
1597
1556
|
return result;
|
|
@@ -1606,7 +1565,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1606
1565
|
}
|
|
1607
1566
|
if (context.errors) {
|
|
1608
1567
|
Object.values(context.errors).forEach((err) => {
|
|
1609
|
-
if (!
|
|
1568
|
+
if (!_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, err) || err.error) {
|
|
1610
1569
|
handleError(err);
|
|
1611
1570
|
}
|
|
1612
1571
|
});
|
|
@@ -1615,12 +1574,19 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1615
1574
|
let state = {
|
|
1616
1575
|
loaderData: context.loaderData,
|
|
1617
1576
|
actionData: context.actionData,
|
|
1618
|
-
errors:
|
|
1577
|
+
errors: context.errors
|
|
1619
1578
|
};
|
|
1579
|
+
let routeDiscovery = build.routeDiscovery;
|
|
1580
|
+
if (_chunkHNBICOIUjs.isFogOfWarEnabled.call(void 0, routeDiscovery, build.ssr) && _chunkHNBICOIUjs.shouldUseInitialRouteDiscovery.call(void 0,
|
|
1581
|
+
context.location.pathname,
|
|
1582
|
+
staticHandler._matchCost
|
|
1583
|
+
)) {
|
|
1584
|
+
routeDiscovery = { ...routeDiscovery, mode: "initial" };
|
|
1585
|
+
}
|
|
1620
1586
|
let baseServerHandoff = {
|
|
1621
1587
|
basename: build.basename,
|
|
1622
1588
|
future: build.future,
|
|
1623
|
-
routeDiscovery
|
|
1589
|
+
routeDiscovery,
|
|
1624
1590
|
ssr: build.ssr,
|
|
1625
1591
|
isSpaMode: isSpaMode2
|
|
1626
1592
|
};
|
|
@@ -1643,7 +1609,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1643
1609
|
renderMeta: {},
|
|
1644
1610
|
future: build.future,
|
|
1645
1611
|
ssr: build.ssr,
|
|
1646
|
-
routeDiscovery
|
|
1612
|
+
routeDiscovery,
|
|
1647
1613
|
isSpaMode: isSpaMode2,
|
|
1648
1614
|
serializeError: (err) => serializeError(err, serverMode)
|
|
1649
1615
|
};
|
|
@@ -1659,10 +1625,10 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1659
1625
|
} catch (error) {
|
|
1660
1626
|
handleError(error);
|
|
1661
1627
|
let errorForSecondRender = error;
|
|
1662
|
-
if (
|
|
1628
|
+
if (_chunkHNBICOIUjs.isResponse.call(void 0, error)) {
|
|
1663
1629
|
try {
|
|
1664
1630
|
let data2 = await unwrapResponse(error);
|
|
1665
|
-
errorForSecondRender = new (0,
|
|
1631
|
+
errorForSecondRender = new (0, _chunkHNBICOIUjs.ErrorResponseImpl)(
|
|
1666
1632
|
error.status,
|
|
1667
1633
|
error.statusText,
|
|
1668
1634
|
data2
|
|
@@ -1670,7 +1636,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1670
1636
|
} catch (e) {
|
|
1671
1637
|
}
|
|
1672
1638
|
}
|
|
1673
|
-
context =
|
|
1639
|
+
context = _chunkHNBICOIUjs.getStaticContextFromError.call(void 0,
|
|
1674
1640
|
staticHandler.dataRoutes,
|
|
1675
1641
|
context,
|
|
1676
1642
|
errorForSecondRender
|
|
@@ -1681,7 +1647,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1681
1647
|
let state2 = {
|
|
1682
1648
|
loaderData: context.loaderData,
|
|
1683
1649
|
actionData: context.actionData,
|
|
1684
|
-
errors:
|
|
1650
|
+
errors: context.errors
|
|
1685
1651
|
};
|
|
1686
1652
|
entryContext = {
|
|
1687
1653
|
...entryContext,
|
|
@@ -1730,7 +1696,7 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1730
1696
|
return handleQueryRouteError(error);
|
|
1731
1697
|
}
|
|
1732
1698
|
function handleQueryRouteResult(result) {
|
|
1733
|
-
if (
|
|
1699
|
+
if (_chunkHNBICOIUjs.isResponse.call(void 0, result)) {
|
|
1734
1700
|
return result;
|
|
1735
1701
|
}
|
|
1736
1702
|
if (typeof result === "string") {
|
|
@@ -1739,10 +1705,10 @@ async function handleResourceRequest(serverMode, build, staticHandler, routeId,
|
|
|
1739
1705
|
return Response.json(result);
|
|
1740
1706
|
}
|
|
1741
1707
|
function handleQueryRouteError(error) {
|
|
1742
|
-
if (
|
|
1708
|
+
if (_chunkHNBICOIUjs.isResponse.call(void 0, error)) {
|
|
1743
1709
|
return error;
|
|
1744
1710
|
}
|
|
1745
|
-
if (
|
|
1711
|
+
if (_chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, error)) {
|
|
1746
1712
|
handleError(error);
|
|
1747
1713
|
return errorResponseToJson(error, serverMode);
|
|
1748
1714
|
}
|
|
@@ -1836,7 +1802,7 @@ function createSessionStorage({
|
|
|
1836
1802
|
updateData,
|
|
1837
1803
|
deleteData
|
|
1838
1804
|
}) {
|
|
1839
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1805
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _15 => _15.name]) || "__session", cookieArg);
|
|
1840
1806
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1841
1807
|
return {
|
|
1842
1808
|
async getSession(cookieHeader, options) {
|
|
@@ -1846,7 +1812,7 @@ function createSessionStorage({
|
|
|
1846
1812
|
},
|
|
1847
1813
|
async commitSession(session, options) {
|
|
1848
1814
|
let { id, data: data2 } = session;
|
|
1849
|
-
let expires = _optionalChain([options, 'optionalAccess',
|
|
1815
|
+
let expires = _optionalChain([options, 'optionalAccess', _16 => _16.maxAge]) != null ? new Date(Date.now() + options.maxAge * 1e3) : _optionalChain([options, 'optionalAccess', _17 => _17.expires]) != null ? options.expires : cookie.expires;
|
|
1850
1816
|
if (id) {
|
|
1851
1817
|
await updateData(id, data2, expires);
|
|
1852
1818
|
} else {
|
|
@@ -1865,7 +1831,7 @@ function createSessionStorage({
|
|
|
1865
1831
|
};
|
|
1866
1832
|
}
|
|
1867
1833
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
1868
|
-
|
|
1834
|
+
_chunkHNBICOIUjs.warnOnce.call(void 0,
|
|
1869
1835
|
cookie.isSigned,
|
|
1870
1836
|
`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.`
|
|
1871
1837
|
);
|
|
@@ -1873,7 +1839,7 @@ function warnOnceAboutSigningSessionCookie(cookie) {
|
|
|
1873
1839
|
|
|
1874
1840
|
// lib/server-runtime/sessions/cookieStorage.ts
|
|
1875
1841
|
function createCookieSessionStorage({ cookie: cookieArg } = {}) {
|
|
1876
|
-
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess',
|
|
1842
|
+
let cookie = isCookie(cookieArg) ? cookieArg : createCookie(_optionalChain([cookieArg, 'optionalAccess', _18 => _18.name]) || "__session", cookieArg);
|
|
1877
1843
|
warnOnceAboutSigningSessionCookie(cookie);
|
|
1878
1844
|
return {
|
|
1879
1845
|
async getSession(cookieHeader, options) {
|
|
@@ -1937,7 +1903,7 @@ function href(path, ...args) {
|
|
|
1937
1903
|
// same regex as in .\router\utils.ts: compilePath().
|
|
1938
1904
|
(_, param, questionMark) => {
|
|
1939
1905
|
const isRequired = questionMark === void 0;
|
|
1940
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1906
|
+
const value = _optionalChain([params, 'optionalAccess', _19 => _19[param]]);
|
|
1941
1907
|
if (isRequired && value === void 0) {
|
|
1942
1908
|
throw new Error(
|
|
1943
1909
|
`Path '${path}' requires param '${param}' but it was not provided`
|
|
@@ -1947,7 +1913,7 @@ function href(path, ...args) {
|
|
|
1947
1913
|
}
|
|
1948
1914
|
);
|
|
1949
1915
|
if (path.endsWith("*")) {
|
|
1950
|
-
const value = _optionalChain([params, 'optionalAccess',
|
|
1916
|
+
const value = _optionalChain([params, 'optionalAccess', _20 => _20["*"]]);
|
|
1951
1917
|
if (value !== void 0) {
|
|
1952
1918
|
result += "/" + value;
|
|
1953
1919
|
}
|
|
@@ -2146,14 +2112,17 @@ async function routeRSCServerRequest({
|
|
|
2146
2112
|
const payload = await createFromReadableStream(
|
|
2147
2113
|
detectRedirectResponse.body
|
|
2148
2114
|
);
|
|
2149
|
-
if (serverResponse.status ===
|
|
2115
|
+
if (serverResponse.status === _chunkHNBICOIUjs.SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
|
|
2116
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2117
|
+
throw new Error("Invalid redirect location");
|
|
2118
|
+
}
|
|
2150
2119
|
const headers2 = new Headers(serverResponse.headers);
|
|
2151
2120
|
headers2.delete("Content-Encoding");
|
|
2152
2121
|
headers2.delete("Content-Length");
|
|
2153
2122
|
headers2.delete("Content-Type");
|
|
2154
2123
|
headers2.delete("X-Remix-Response");
|
|
2155
2124
|
headers2.set("Location", payload.location);
|
|
2156
|
-
return new Response(_optionalChain([serverResponseB, 'optionalAccess',
|
|
2125
|
+
return new Response(_optionalChain([serverResponseB, 'optionalAccess', _21 => _21.body]) || "", {
|
|
2157
2126
|
headers: headers2,
|
|
2158
2127
|
status: payload.status,
|
|
2159
2128
|
statusText: serverResponse.statusText
|
|
@@ -2165,11 +2134,11 @@ async function routeRSCServerRequest({
|
|
|
2165
2134
|
let html = await renderHTML(getPayload, {
|
|
2166
2135
|
onError(error) {
|
|
2167
2136
|
if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
|
|
2168
|
-
renderRedirect =
|
|
2137
|
+
renderRedirect = _chunkHNBICOIUjs.decodeRedirectErrorDigest.call(void 0, error.digest);
|
|
2169
2138
|
if (renderRedirect) {
|
|
2170
2139
|
return error.digest;
|
|
2171
2140
|
}
|
|
2172
|
-
let routeErrorResponse =
|
|
2141
|
+
let routeErrorResponse = _chunkHNBICOIUjs.decodeRouteErrorResponseDigest.call(void 0, error.digest);
|
|
2173
2142
|
if (routeErrorResponse) {
|
|
2174
2143
|
renderError = routeErrorResponse;
|
|
2175
2144
|
status = routeErrorResponse.status;
|
|
@@ -2190,6 +2159,9 @@ async function routeRSCServerRequest({
|
|
|
2190
2159
|
}
|
|
2191
2160
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2192
2161
|
if (renderRedirect) {
|
|
2162
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2163
|
+
throw new Error("Invalid redirect location");
|
|
2164
|
+
}
|
|
2193
2165
|
headers.set("Location", renderRedirect.location);
|
|
2194
2166
|
return new Response(html, {
|
|
2195
2167
|
status: renderRedirect.status,
|
|
@@ -2199,9 +2171,12 @@ async function routeRSCServerRequest({
|
|
|
2199
2171
|
const redirectTransform = new TransformStream({
|
|
2200
2172
|
flush(controller) {
|
|
2201
2173
|
if (renderRedirect) {
|
|
2174
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2175
|
+
return;
|
|
2176
|
+
}
|
|
2202
2177
|
controller.enqueue(
|
|
2203
2178
|
new TextEncoder().encode(
|
|
2204
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2179
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkHNBICOIUjs.escapeAttribute.call(void 0, renderRedirect.location)}"/>`
|
|
2205
2180
|
)
|
|
2206
2181
|
);
|
|
2207
2182
|
}
|
|
@@ -2214,7 +2189,7 @@ async function routeRSCServerRequest({
|
|
|
2214
2189
|
headers
|
|
2215
2190
|
});
|
|
2216
2191
|
}
|
|
2217
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2192
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _22 => _22.body])) {
|
|
2218
2193
|
throw new Error("Failed to clone server response");
|
|
2219
2194
|
}
|
|
2220
2195
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(redirectTransform);
|
|
@@ -2228,6 +2203,9 @@ async function routeRSCServerRequest({
|
|
|
2228
2203
|
return error;
|
|
2229
2204
|
}
|
|
2230
2205
|
if (renderRedirect) {
|
|
2206
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, renderRedirect.location)) {
|
|
2207
|
+
throw new Error("Invalid redirect location");
|
|
2208
|
+
}
|
|
2231
2209
|
return new Response(`Redirect: ${renderRedirect.location}`, {
|
|
2232
2210
|
status: renderRedirect.status,
|
|
2233
2211
|
headers: {
|
|
@@ -2237,7 +2215,7 @@ async function routeRSCServerRequest({
|
|
|
2237
2215
|
}
|
|
2238
2216
|
try {
|
|
2239
2217
|
let normalizedError = _nullishCoalesce(renderError, () => ( error));
|
|
2240
|
-
let [status, statusText] =
|
|
2218
|
+
let [status, statusText] = _chunkHNBICOIUjs.isRouteErrorResponse.call(void 0, normalizedError) ? [normalizedError.status, normalizedError.statusText] : [500, ""];
|
|
2241
2219
|
let retryRedirect;
|
|
2242
2220
|
let reactHeaders = new Headers();
|
|
2243
2221
|
const html = await renderHTML(
|
|
@@ -2274,11 +2252,11 @@ async function routeRSCServerRequest({
|
|
|
2274
2252
|
{
|
|
2275
2253
|
onError(error2) {
|
|
2276
2254
|
if (typeof error2 === "object" && error2 && "digest" in error2 && typeof error2.digest === "string") {
|
|
2277
|
-
retryRedirect =
|
|
2255
|
+
retryRedirect = _chunkHNBICOIUjs.decodeRedirectErrorDigest.call(void 0, error2.digest);
|
|
2278
2256
|
if (retryRedirect) {
|
|
2279
2257
|
return error2.digest;
|
|
2280
2258
|
}
|
|
2281
|
-
let routeErrorResponse =
|
|
2259
|
+
let routeErrorResponse = _chunkHNBICOIUjs.decodeRouteErrorResponseDigest.call(void 0,
|
|
2282
2260
|
error2.digest
|
|
2283
2261
|
);
|
|
2284
2262
|
if (routeErrorResponse) {
|
|
@@ -2301,6 +2279,9 @@ async function routeRSCServerRequest({
|
|
|
2301
2279
|
}
|
|
2302
2280
|
headers.set("Content-Type", "text/html; charset=utf-8");
|
|
2303
2281
|
if (retryRedirect) {
|
|
2282
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2283
|
+
throw new Error("Invalid redirect location");
|
|
2284
|
+
}
|
|
2304
2285
|
headers.set("Location", retryRedirect.location);
|
|
2305
2286
|
return new Response(html, {
|
|
2306
2287
|
status: retryRedirect.status,
|
|
@@ -2310,9 +2291,12 @@ async function routeRSCServerRequest({
|
|
|
2310
2291
|
const retryRedirectTransform = new TransformStream({
|
|
2311
2292
|
flush(controller) {
|
|
2312
2293
|
if (retryRedirect) {
|
|
2294
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, retryRedirect.location)) {
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2313
2297
|
controller.enqueue(
|
|
2314
2298
|
new TextEncoder().encode(
|
|
2315
|
-
`<meta http-equiv="refresh" content="0;url=${
|
|
2299
|
+
`<meta http-equiv="refresh" content="0;url=${_chunkHNBICOIUjs.escapeAttribute.call(void 0, retryRedirect.location)}"/>`
|
|
2316
2300
|
)
|
|
2317
2301
|
);
|
|
2318
2302
|
}
|
|
@@ -2325,7 +2309,7 @@ async function routeRSCServerRequest({
|
|
|
2325
2309
|
headers
|
|
2326
2310
|
});
|
|
2327
2311
|
}
|
|
2328
|
-
if (!_optionalChain([serverResponseB, 'optionalAccess',
|
|
2312
|
+
if (!_optionalChain([serverResponseB, 'optionalAccess', _23 => _23.body])) {
|
|
2329
2313
|
throw new Error("Failed to clone server response");
|
|
2330
2314
|
}
|
|
2331
2315
|
const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(retryRedirectTransform);
|
|
@@ -2343,6 +2327,9 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2343
2327
|
const decoded = getPayload();
|
|
2344
2328
|
const payload = useSafe(decoded);
|
|
2345
2329
|
if (payload.type === "redirect") {
|
|
2330
|
+
if (_chunkHNBICOIUjs.hasInvalidProtocol.call(void 0, payload.location)) {
|
|
2331
|
+
throw new Error("Invalid redirect location");
|
|
2332
|
+
}
|
|
2346
2333
|
throw new Response(null, {
|
|
2347
2334
|
status: payload.status,
|
|
2348
2335
|
headers: {
|
|
@@ -2353,7 +2340,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2353
2340
|
if (payload.type !== "render") return null;
|
|
2354
2341
|
let patchedLoaderData = { ...payload.loaderData };
|
|
2355
2342
|
for (const match of payload.matches) {
|
|
2356
|
-
if (
|
|
2343
|
+
if (_chunkHNBICOIUjs.shouldHydrateRouteLoader.call(void 0,
|
|
2357
2344
|
match.id,
|
|
2358
2345
|
match.clientLoader,
|
|
2359
2346
|
match.hasLoader,
|
|
@@ -2393,7 +2380,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2393
2380
|
}
|
|
2394
2381
|
}))
|
|
2395
2382
|
};
|
|
2396
|
-
const router =
|
|
2383
|
+
const router = _chunk75HN637Gjs.createStaticRouter.call(void 0,
|
|
2397
2384
|
payload.matches.reduceRight((previous, match) => {
|
|
2398
2385
|
const route = {
|
|
2399
2386
|
id: match.id,
|
|
@@ -2420,7 +2407,7 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2420
2407
|
// These flags have no runtime impact so can always be false. If we add
|
|
2421
2408
|
// flags that drive runtime behavior they'll need to be proxied through.
|
|
2422
2409
|
v8_middleware: false,
|
|
2423
|
-
|
|
2410
|
+
v8_trailingSlashAwareDataRequests: true,
|
|
2424
2411
|
// always on for RSC
|
|
2425
2412
|
v8_passThroughRequests: true
|
|
2426
2413
|
// always on for RSC
|
|
@@ -2441,10 +2428,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2441
2428
|
mode: "lazy",
|
|
2442
2429
|
manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath
|
|
2443
2430
|
},
|
|
2444
|
-
routeModules:
|
|
2431
|
+
routeModules: _chunkK3NA4NUHjs.createRSCRouteModules.call(void 0, payload)
|
|
2445
2432
|
};
|
|
2446
|
-
return /* @__PURE__ */ React3.createElement(
|
|
2447
|
-
|
|
2433
|
+
return /* @__PURE__ */ React3.createElement(_chunkHNBICOIUjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkK3NA4NUHjs.RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React3.createElement(_chunkHNBICOIUjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
2434
|
+
_chunk75HN637Gjs.StaticRouterProvider,
|
|
2448
2435
|
{
|
|
2449
2436
|
context,
|
|
2450
2437
|
router,
|
|
@@ -2460,44 +2447,6 @@ function isManifestRequest(url) {
|
|
|
2460
2447
|
return url.pathname.endsWith(".manifest");
|
|
2461
2448
|
}
|
|
2462
2449
|
|
|
2463
|
-
// lib/dom/ssr/errors.ts
|
|
2464
|
-
function deserializeErrors(errors) {
|
|
2465
|
-
if (!errors) return null;
|
|
2466
|
-
let entries = Object.entries(errors);
|
|
2467
|
-
let serialized = {};
|
|
2468
|
-
for (let [key, val] of entries) {
|
|
2469
|
-
if (val && val.__type === "RouteErrorResponse") {
|
|
2470
|
-
serialized[key] = new (0, _chunkHUBUW7R3js.ErrorResponseImpl)(
|
|
2471
|
-
val.status,
|
|
2472
|
-
val.statusText,
|
|
2473
|
-
val.data,
|
|
2474
|
-
val.internal === true
|
|
2475
|
-
);
|
|
2476
|
-
} else if (val && val.__type === "Error") {
|
|
2477
|
-
if (val.__subType) {
|
|
2478
|
-
let ErrorConstructor = window[val.__subType];
|
|
2479
|
-
if (typeof ErrorConstructor === "function") {
|
|
2480
|
-
try {
|
|
2481
|
-
let error = new ErrorConstructor(val.message);
|
|
2482
|
-
error.stack = val.stack;
|
|
2483
|
-
serialized[key] = error;
|
|
2484
|
-
} catch (e) {
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
if (serialized[key] == null) {
|
|
2489
|
-
let error = new Error(val.message);
|
|
2490
|
-
error.stack = val.stack;
|
|
2491
|
-
serialized[key] = error;
|
|
2492
|
-
}
|
|
2493
|
-
} else {
|
|
2494
|
-
serialized[key] = val;
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
return serialized;
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
2450
|
|
|
2502
2451
|
|
|
2503
2452
|
|
|
@@ -2627,4 +2576,4 @@ function deserializeErrors(errors) {
|
|
|
2627
2576
|
|
|
2628
2577
|
|
|
2629
2578
|
|
|
2630
|
-
exports.Await =
|
|
2579
|
+
exports.Await = _chunkHNBICOIUjs.Await; exports.BrowserRouter = _chunk75HN637Gjs.BrowserRouter; exports.Form = _chunk75HN637Gjs.Form; exports.HashRouter = _chunk75HN637Gjs.HashRouter; exports.IDLE_BLOCKER = _chunkHNBICOIUjs.IDLE_BLOCKER; exports.IDLE_FETCHER = _chunkHNBICOIUjs.IDLE_FETCHER; exports.IDLE_NAVIGATION = _chunkHNBICOIUjs.IDLE_NAVIGATION; exports.Link = _chunk75HN637Gjs.Link; exports.Links = _chunkHNBICOIUjs.Links; exports.MemoryRouter = _chunkHNBICOIUjs.MemoryRouter; exports.Meta = _chunkHNBICOIUjs.Meta; exports.NavLink = _chunk75HN637Gjs.NavLink; exports.Navigate = _chunkHNBICOIUjs.Navigate; exports.NavigationType = _chunkHNBICOIUjs.Action; exports.Outlet = _chunkHNBICOIUjs.Outlet; exports.PrefetchPageLinks = _chunkHNBICOIUjs.PrefetchPageLinks; exports.Route = _chunkHNBICOIUjs.Route; exports.Router = _chunkHNBICOIUjs.Router; exports.RouterContextProvider = _chunkHNBICOIUjs.RouterContextProvider; exports.RouterProvider = _chunkHNBICOIUjs.RouterProvider; exports.Routes = _chunkHNBICOIUjs.Routes; exports.Scripts = _chunkHNBICOIUjs.Scripts; exports.ScrollRestoration = _chunk75HN637Gjs.ScrollRestoration; exports.ServerRouter = ServerRouter; exports.StaticRouter = _chunk75HN637Gjs.StaticRouter; exports.StaticRouterProvider = _chunk75HN637Gjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkHNBICOIUjs.AwaitContextProvider; exports.UNSAFE_DataRouterContext = _chunkHNBICOIUjs.DataRouterContext; exports.UNSAFE_DataRouterStateContext = _chunkHNBICOIUjs.DataRouterStateContext; exports.UNSAFE_ErrorResponseImpl = _chunkHNBICOIUjs.ErrorResponseImpl; exports.UNSAFE_FetchersContext = _chunkHNBICOIUjs.FetchersContext; exports.UNSAFE_FrameworkContext = _chunkHNBICOIUjs.FrameworkContext; exports.UNSAFE_LocationContext = _chunkHNBICOIUjs.LocationContext; exports.UNSAFE_NavigationContext = _chunkHNBICOIUjs.NavigationContext; exports.UNSAFE_RSCDefaultRootErrorBoundary = _chunkK3NA4NUHjs.RSCDefaultRootErrorBoundary; exports.UNSAFE_RemixErrorBoundary = _chunkHNBICOIUjs.RemixErrorBoundary; exports.UNSAFE_RouteContext = _chunkHNBICOIUjs.RouteContext; exports.UNSAFE_ServerMode = ServerMode; exports.UNSAFE_SingleFetchRedirectSymbol = _chunkHNBICOIUjs.SingleFetchRedirectSymbol; exports.UNSAFE_ViewTransitionContext = _chunkHNBICOIUjs.ViewTransitionContext; exports.UNSAFE_WithComponentProps = _chunkHNBICOIUjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkHNBICOIUjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkHNBICOIUjs.WithHydrateFallbackProps; exports.UNSAFE_createBrowserHistory = _chunkHNBICOIUjs.createBrowserHistory; exports.UNSAFE_createClientRoutes = _chunkHNBICOIUjs.createClientRoutes; exports.UNSAFE_createClientRoutesWithHMRRevalidationOptOut = _chunkHNBICOIUjs.createClientRoutesWithHMRRevalidationOptOut; exports.UNSAFE_createHashHistory = _chunkHNBICOIUjs.createHashHistory; exports.UNSAFE_createMemoryHistory = _chunkHNBICOIUjs.createMemoryHistory; exports.UNSAFE_createRouter = _chunkHNBICOIUjs.createRouter; exports.UNSAFE_decodeViaTurboStream = _chunkHNBICOIUjs.decodeViaTurboStream; exports.UNSAFE_getHydrationData = _chunkK3NA4NUHjs.getHydrationData; exports.UNSAFE_getPatchRoutesOnNavigationFunction = _chunkHNBICOIUjs.getPatchRoutesOnNavigationFunction; exports.UNSAFE_getTurboStreamSingleFetchDataStrategy = _chunkHNBICOIUjs.getTurboStreamSingleFetchDataStrategy; exports.UNSAFE_hydrationRouteProperties = _chunkHNBICOIUjs.hydrationRouteProperties; exports.UNSAFE_invariant = _chunkHNBICOIUjs.invariant; exports.UNSAFE_mapRouteProperties = _chunkHNBICOIUjs.mapRouteProperties; exports.UNSAFE_shouldHydrateRouteLoader = _chunkHNBICOIUjs.shouldHydrateRouteLoader; exports.UNSAFE_useFogOFWarDiscovery = _chunkHNBICOIUjs.useFogOFWarDiscovery; exports.UNSAFE_useScrollRestoration = _chunk75HN637Gjs.useScrollRestoration; exports.UNSAFE_withComponentProps = _chunkHNBICOIUjs.withComponentProps; exports.UNSAFE_withErrorBoundaryProps = _chunkHNBICOIUjs.withErrorBoundaryProps; exports.UNSAFE_withHydrateFallbackProps = _chunkHNBICOIUjs.withHydrateFallbackProps; exports.createBrowserRouter = _chunk75HN637Gjs.createBrowserRouter; exports.createContext = _chunkHNBICOIUjs.createContext; exports.createCookie = createCookie; exports.createCookieSessionStorage = createCookieSessionStorage; exports.createHashRouter = _chunk75HN637Gjs.createHashRouter; exports.createMemoryRouter = _chunkHNBICOIUjs.createMemoryRouter; exports.createMemorySessionStorage = createMemorySessionStorage; exports.createPath = _chunkHNBICOIUjs.createPath; exports.createRequestHandler = createRequestHandler; exports.createRoutesFromChildren = _chunkHNBICOIUjs.createRoutesFromChildren; exports.createRoutesFromElements = _chunkHNBICOIUjs.createRoutesFromElements; exports.createRoutesStub = createRoutesStub; exports.createSearchParams = _chunk75HN637Gjs.createSearchParams; exports.createSession = createSession; exports.createSessionStorage = createSessionStorage; exports.createStaticHandler = _chunk75HN637Gjs.createStaticHandler; exports.createStaticRouter = _chunk75HN637Gjs.createStaticRouter; exports.data = _chunkHNBICOIUjs.data; exports.generatePath = _chunkHNBICOIUjs.generatePath; exports.href = href; exports.isCookie = isCookie; exports.isRouteErrorResponse = _chunkHNBICOIUjs.isRouteErrorResponse; exports.isSession = isSession; exports.matchPath = _chunkHNBICOIUjs.matchPath; exports.matchRoutes = _chunkHNBICOIUjs.matchRoutes; exports.parsePath = _chunkHNBICOIUjs.parsePath; exports.redirect = _chunkHNBICOIUjs.redirect; exports.redirectDocument = _chunkHNBICOIUjs.redirectDocument; exports.renderMatches = _chunkHNBICOIUjs.renderMatches; exports.replace = _chunkHNBICOIUjs.replace; exports.resolvePath = _chunkHNBICOIUjs.resolvePath; exports.unstable_HistoryRouter = _chunk75HN637Gjs.HistoryRouter; exports.unstable_RSCStaticRouter = RSCStaticRouter; exports.unstable_routeRSCServerRequest = routeRSCServerRequest; exports.unstable_setDevServerHooks = setDevServerHooks; exports.unstable_usePrompt = _chunk75HN637Gjs.usePrompt; exports.unstable_useRoute = _chunkHNBICOIUjs.useRoute; exports.unstable_useRouterState = _chunkHNBICOIUjs.useRouterState; exports.useActionData = _chunkHNBICOIUjs.useActionData; exports.useAsyncError = _chunkHNBICOIUjs.useAsyncError; exports.useAsyncValue = _chunkHNBICOIUjs.useAsyncValue; exports.useBeforeUnload = _chunk75HN637Gjs.useBeforeUnload; exports.useBlocker = _chunkHNBICOIUjs.useBlocker; exports.useFetcher = _chunk75HN637Gjs.useFetcher; exports.useFetchers = _chunk75HN637Gjs.useFetchers; exports.useFormAction = _chunk75HN637Gjs.useFormAction; exports.useHref = _chunkHNBICOIUjs.useHref; exports.useInRouterContext = _chunkHNBICOIUjs.useInRouterContext; exports.useLinkClickHandler = _chunk75HN637Gjs.useLinkClickHandler; exports.useLoaderData = _chunkHNBICOIUjs.useLoaderData; exports.useLocation = _chunkHNBICOIUjs.useLocation; exports.useMatch = _chunkHNBICOIUjs.useMatch; exports.useMatches = _chunkHNBICOIUjs.useMatches; exports.useNavigate = _chunkHNBICOIUjs.useNavigate; exports.useNavigation = _chunkHNBICOIUjs.useNavigation; exports.useNavigationType = _chunkHNBICOIUjs.useNavigationType; exports.useOutlet = _chunkHNBICOIUjs.useOutlet; exports.useOutletContext = _chunkHNBICOIUjs.useOutletContext; exports.useParams = _chunkHNBICOIUjs.useParams; exports.useResolvedPath = _chunkHNBICOIUjs.useResolvedPath; exports.useRevalidator = _chunkHNBICOIUjs.useRevalidator; exports.useRouteError = _chunkHNBICOIUjs.useRouteError; exports.useRouteLoaderData = _chunkHNBICOIUjs.useRouteLoaderData; exports.useRoutes = _chunkHNBICOIUjs.useRoutes; exports.useSearchParams = _chunk75HN637Gjs.useSearchParams; exports.useSubmit = _chunk75HN637Gjs.useSubmit; exports.useViewTransitionState = _chunk75HN637Gjs.useViewTransitionState;
|