|
|
|
|
@@ -1,5 +1,36 @@
|
|
|
|
|
diff --git a/dist/development/lib/dom-export/hydrated-router.js b/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
index df767ab6665e9a90344275d717bc31de81ff7228..5140b826243bcc00794aad943290bf49b6f30a66 100644
|
|
|
|
|
--- a/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
+++ b/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
@@ -149,7 +149,8 @@ function HydratedRouter(props) {
|
|
|
|
|
let discoveryState;
|
|
|
|
|
if (discoveryRuntime) discoveryState = UNSAFE_useCustomRouteDiscovery(discoveryRuntime, props.onError);
|
|
|
|
|
else UNSAFE_useFogOFWarDiscovery(router, ssrInfo.manifest, ssrInfo.routeModules, ssr, ssrInfo.context.routeDiscovery, ssrInfo.context.isSpaMode, fetchImplementation, ssrInfo.context.unstable_apiServerOrigin, ssrInfo.context.unstable_apiOnly === true);
|
|
|
|
|
- return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: {
|
|
|
|
|
+ // patched: a stable value so every <Link> doesn't re-render whenever the location changes
|
|
|
|
|
+ let frameworkContext = React$1.useMemo(() => ({
|
|
|
|
|
routeDiscoveryRuntime: discoveryRuntime,
|
|
|
|
|
routeDiscoveryState: discoveryState,
|
|
|
|
|
manifest: ssrInfo.manifest,
|
|
|
|
|
@@ -161,7 +162,15 @@ function HydratedRouter(props) {
|
|
|
|
|
unstable_apiOnly: ssrInfo.context.unstable_apiOnly,
|
|
|
|
|
routeDiscovery: ssrInfo.context.routeDiscovery,
|
|
|
|
|
unstable_apiServerOrigin: ssrInfo.context.unstable_apiServerOrigin
|
|
|
|
|
- } }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
+ }), [
|
|
|
|
|
+ discoveryRuntime,
|
|
|
|
|
+ discoveryState,
|
|
|
|
|
+ ssrInfo.manifest,
|
|
|
|
|
+ ssrInfo.routeModules,
|
|
|
|
|
+ ssrInfo.context,
|
|
|
|
|
+ criticalCss
|
|
|
|
|
+ ]);
|
|
|
|
|
+ return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
router,
|
|
|
|
|
useTransitions: props.useTransitions,
|
|
|
|
|
onError: props.onError
|
|
|
|
|
diff --git a/dist/development/lib/dom/lib.js b/dist/development/lib/dom/lib.js
|
|
|
|
|
index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187f3a5fc5a 100644
|
|
|
|
|
index c64372fc278f3f0e154ce1b47c01a5fbaa2b2e04..f74c78434022bc03d703561379a565fbb8131d6f 100644
|
|
|
|
|
--- a/dist/development/lib/dom/lib.js
|
|
|
|
|
+++ b/dist/development/lib/dom/lib.js
|
|
|
|
|
@@ -12,7 +12,7 @@ import { ABSOLUTE_URL_REGEX } from "../router/url.js";
|
|
|
|
|
@@ -9,8 +40,8 @@ index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187
|
|
|
|
|
-import { DataRouterNavigationContext, NavigationContext, RouteContext, ViewTransitionContext } from "../context.js";
|
|
|
|
|
+import { DataRouterContext, DataRouterNavigationContext, NavigationContext, RouteContext, ViewTransitionContext } from "../context.js";
|
|
|
|
|
import { useBlocker, useCurrentRouteId, useDataRouterContext, useDataRouterFetchers, useDataRouterState, useHref, useLocation, useMatches, useNavigate, useNavigation, useResolvedPath } from "../hooks.js";
|
|
|
|
|
import { Router, hydrationRouteProperties } from "../components.js";
|
|
|
|
|
import { createSearchParams, getFormSubmissionInfo, getSearchParamsForLocation, shouldProcessLinkClick } from "./dom.js";
|
|
|
|
|
import { escapeHtml } from "./ssr/markup.js";
|
|
|
|
|
import { FrameworkContext, PrefetchPageLinks, mergeRefs, usePrefetchBehavior } from "./ssr/components.js";
|
|
|
|
|
@@ -284,7 +284,7 @@ HistoryRouter.displayName = "unstable_HistoryRouter";
|
|
|
|
|
* @param {LinkProps.defaultShouldRevalidate} props.defaultShouldRevalidate n/a
|
|
|
|
|
* @param {LinkProps.mask} props.mask [modes: framework, data] n/a
|
|
|
|
|
@@ -87,7 +118,7 @@ index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187
|
|
|
|
|
"aria-current": ariaCurrent,
|
|
|
|
|
className,
|
|
|
|
|
diff --git a/dist/development/lib/dom/ssr/server.js b/dist/development/lib/dom/ssr/server.js
|
|
|
|
|
index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456324bf160 100644
|
|
|
|
|
index 414c796010e78f585f53180c83add0931e766d2b..82815e4a273f401da85315a1f2b8390d9b1c77a0 100644
|
|
|
|
|
--- a/dist/development/lib/dom/ssr/server.js
|
|
|
|
|
+++ b/dist/development/lib/dom/ssr/server.js
|
|
|
|
|
@@ -32,7 +32,7 @@ import * as React$1 from "react";
|
|
|
|
|
@@ -99,7 +130,7 @@ index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456
|
|
|
|
|
context.staticHandlerContext.loaderData = { ...context.staticHandlerContext.loaderData };
|
|
|
|
|
for (let match of context.staticHandlerContext.matches) {
|
|
|
|
|
let routeId = match.route.id;
|
|
|
|
|
@@ -65,5 +65,14 @@ function ServerRouter({ context, url, nonce }) {
|
|
|
|
|
@@ -67,5 +67,14 @@ function ServerRouter({ context, url, nonce }) {
|
|
|
|
|
nonce
|
|
|
|
|
})) : null);
|
|
|
|
|
}
|
|
|
|
|
@@ -115,7 +146,7 @@ index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456
|
|
|
|
|
//#endregion
|
|
|
|
|
export { ServerRouter };
|
|
|
|
|
diff --git a/dist/development/lib/dom/ssr/single-fetch.js b/dist/development/lib/dom/ssr/single-fetch.js
|
|
|
|
|
index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd832839dc7acd1 100644
|
|
|
|
|
index 49b10047d7f77a8c91a5eb70226b113b6c2b2ed2..2aeb742475ce678ceed83ba80f4ea1f0729555e0 100644
|
|
|
|
|
--- a/dist/development/lib/dom/ssr/single-fetch.js
|
|
|
|
|
+++ b/dist/development/lib/dom/ssr/single-fetch.js
|
|
|
|
|
@@ -12,11 +12,11 @@ import { ErrorResponseImpl, SUPPORTED_ERROR_TYPES, data, isRouteErrorResponse, r
|
|
|
|
|
@@ -131,9 +162,9 @@ index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd83283
|
|
|
|
|
var SingleFetchNoResultError = class extends Error {};
|
|
|
|
|
const NO_BODY_STATUS_CODES = new Set([
|
|
|
|
|
100,
|
|
|
|
|
@@ -272,24 +272,31 @@ async function fetchAndDecodeViaTurboStream(args, targetRoutes) {
|
|
|
|
|
throw new Error("Unable to decode turbo-stream response", { cause });
|
|
|
|
|
}
|
|
|
|
|
@@ -290,24 +290,31 @@ function fetchAndDecodeViaTurboStream(fetchImplementation, serverOrigin) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
-function decodeViaTurboStream(body, global) {
|
|
|
|
|
- return decode(body, { plugins: [(type, ...rest) => {
|
|
|
|
|
@@ -176,43 +207,14 @@ index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd83283
|
|
|
|
|
}
|
|
|
|
|
function unwrapSingleFetchResult(result, routeId) {
|
|
|
|
|
if ("redirect" in result) {
|
|
|
|
|
@@ -333,4 +340,4 @@ function createDeferred() {
|
|
|
|
|
@@ -351,4 +358,4 @@ function createDeferred() {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
-export { NO_BODY_STATUS_CODES, SingleFetchRedirectSymbol, StreamTransfer, decodeViaTurboStream, getSingleFetchDataStrategyImpl, getTurboStreamSingleFetchDataStrategy, singleFetchUrl, stripIndexParam };
|
|
|
|
|
+export { JSON_TYPE_KEY, NO_BODY_STATUS_CODES, SingleFetchRedirectSymbol, StreamTransfer, decodeViaTurboStream, getSingleFetchDataStrategyImpl, getTurboStreamSingleFetchDataStrategy, singleFetchUrl, stripIndexParam };
|
|
|
|
|
diff --git a/dist/development/lib/dom-export/hydrated-router.js b/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
index 4d0817136a6b1398fd80a0ea1cb864a01796f203..0e91eece494e1ac17a344670fd08404a89d63f1c 100644
|
|
|
|
|
--- a/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
+++ b/dist/development/lib/dom-export/hydrated-router.js
|
|
|
|
|
@@ -133,7 +133,8 @@ function HydratedRouter(props) {
|
|
|
|
|
}, [location]);
|
|
|
|
|
UNSAFE_invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
|
|
|
|
UNSAFE_useFogOFWarDiscovery(router, ssrInfo.manifest, ssrInfo.routeModules, ssrInfo.context.ssr, ssrInfo.context.routeDiscovery, ssrInfo.context.isSpaMode);
|
|
|
|
|
- return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: {
|
|
|
|
|
+ // patched: a stable value so every <Link> doesn't re-render whenever the location changes
|
|
|
|
|
+ let frameworkContext = React$1.useMemo(() => ({
|
|
|
|
|
manifest: ssrInfo.manifest,
|
|
|
|
|
routeModules: ssrInfo.routeModules,
|
|
|
|
|
future: ssrInfo.context.future,
|
|
|
|
|
@@ -141,7 +142,13 @@ function HydratedRouter(props) {
|
|
|
|
|
ssr: ssrInfo.context.ssr,
|
|
|
|
|
isSpaMode: ssrInfo.context.isSpaMode,
|
|
|
|
|
routeDiscovery: ssrInfo.context.routeDiscovery
|
|
|
|
|
- } }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
+ }), [
|
|
|
|
|
+ ssrInfo.manifest,
|
|
|
|
|
+ ssrInfo.routeModules,
|
|
|
|
|
+ ssrInfo.context,
|
|
|
|
|
+ criticalCss
|
|
|
|
|
+ ]);
|
|
|
|
|
+ return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
router,
|
|
|
|
|
useTransitions: props.useTransitions,
|
|
|
|
|
onError: props.onError
|
|
|
|
|
diff --git a/dist/development/lib/hooks.js b/dist/development/lib/hooks.js
|
|
|
|
|
index 18c69d42e36059faae18922046ea3cd7e9817722..f2c806583352aa61c38ec113c159f0b4a84cac8e 100644
|
|
|
|
|
index 3a9d1d0abe4dcb90b1e8162db28fff27db78898c..5fa998f1568c944932b7db80b5b156823a5c0a77 100644
|
|
|
|
|
--- a/dist/development/lib/hooks.js
|
|
|
|
|
+++ b/dist/development/lib/hooks.js
|
|
|
|
|
@@ -527,10 +527,11 @@ function useParams() {
|
|
|
|
|
@@ -252,7 +254,7 @@ index 18c69d42e36059faae18922046ea3cd7e9817722..f2c806583352aa61c38ec113c159f0b4
|
|
|
|
|
function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
|
|
|
|
|
let dataRouterState = dataRouterOpts?.state;
|
|
|
|
|
diff --git a/dist/development/lib/router/matcher.js b/dist/development/lib/router/matcher.js
|
|
|
|
|
index 135d8da979b2a7c88c43f2f85c43de0ac6a49ad0..5eb2b3edfda349e5de531559c3313e4d0f4ac8e3 100644
|
|
|
|
|
index 865fabf95800603edec9f8ef546886fb049e7a57..bdbaee27652607050a25f4546780b1a4f0cf2bc9 100644
|
|
|
|
|
--- a/dist/development/lib/router/matcher.js
|
|
|
|
|
+++ b/dist/development/lib/router/matcher.js
|
|
|
|
|
@@ -8,11 +8,14 @@
|
|
|
|
|
@@ -305,10 +307,10 @@ index 135d8da979b2a7c88c43f2f85c43de0ac6a49ad0..5eb2b3edfda349e5de531559c3313e4d
|
|
|
|
|
//#endregion
|
|
|
|
|
export { V6RegExMatcher };
|
|
|
|
|
diff --git a/dist/development/lib/router/router.js b/dist/development/lib/router/router.js
|
|
|
|
|
index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b98182647e 100644
|
|
|
|
|
index 96a9def58aa7936a638cb8b2bbc8befbb1022866..a13a417e876dcd042356474445b495f79e650d0e 100644
|
|
|
|
|
--- a/dist/development/lib/router/router.js
|
|
|
|
|
+++ b/dist/development/lib/router/router.js
|
|
|
|
|
@@ -2725,7 +2725,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
|
|
@@ -2817,7 +2817,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
|
|
}
|
|
|
|
|
function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k, v]) => {
|
|
|
|
|
@@ -317,7 +319,7 @@ index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b9
|
|
|
|
|
return merged;
|
|
|
|
|
}, {});
|
|
|
|
|
let preservedCount = 0;
|
|
|
|
|
@@ -2739,6 +2739,30 @@ function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
@@ -2831,6 +2831,30 @@ function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
}
|
|
|
|
|
return Object.keys(newLoaderData).length === 0 && preservedCount === Object.keys(loaderData).length ? loaderData : mergedLoaderData;
|
|
|
|
|
}
|
|
|
|
|
@@ -349,7 +351,7 @@ index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b9
|
|
|
|
|
if (!pendingActionResult) return {};
|
|
|
|
|
return isErrorResult(pendingActionResult[1]) ? { actionData: {} } : { actionData: { [pendingActionResult[0]]: pendingActionResult[1].data } };
|
|
|
|
|
diff --git a/dist/development/lib/server-runtime/crypto.js b/dist/development/lib/server-runtime/crypto.js
|
|
|
|
|
index a4f6c3f43084bfccf5d9ebe4908868502ce70b58..c0619093ba8a2763d523d5a868896626636123f4 100644
|
|
|
|
|
index ba03b7e99e0d126a06b41c3fa50273418a3d073e..9b64f19f9c2cf2e06dc65a4b20bfcd0e5d8b3c7c 100644
|
|
|
|
|
--- a/dist/development/lib/server-runtime/crypto.js
|
|
|
|
|
+++ b/dist/development/lib/server-runtime/crypto.js
|
|
|
|
|
@@ -10,7 +10,10 @@
|
|
|
|
|
@@ -378,7 +380,7 @@ index a4f6c3f43084bfccf5d9ebe4908868502ce70b58..c0619093ba8a2763d523d5a868896626
|
|
|
|
|
let key = await createKey(secret, ["verify"]);
|
|
|
|
|
try {
|
|
|
|
|
diff --git a/dist/development/lib/server-runtime/entry.js b/dist/development/lib/server-runtime/entry.js
|
|
|
|
|
index e863c7243768adc4b6a73da7e485895249358bab..26aec6dfce410872389037706052ccaa8f71d570 100644
|
|
|
|
|
index 979f27086e6ce619702a137887e6eae85a07b059..ff2ef6b207f4ac24a74c29962d4b709d3ab4d434 100644
|
|
|
|
|
--- a/dist/development/lib/server-runtime/entry.js
|
|
|
|
|
+++ b/dist/development/lib/server-runtime/entry.js
|
|
|
|
|
@@ -9,7 +9,14 @@
|
|
|
|
|
@@ -397,7 +399,7 @@ index e863c7243768adc4b6a73da7e485895249358bab..26aec6dfce410872389037706052ccaa
|
|
|
|
|
let route = manifest[routeId];
|
|
|
|
|
if (route) memo[routeId] = route.module;
|
|
|
|
|
diff --git a/dist/development/lib/server-runtime/single-fetch.js b/dist/development/lib/server-runtime/single-fetch.js
|
|
|
|
|
index 89ccb3ff59f3a7953cca2637e1075ff7246a8c69..fbfc45b088a5b00de35daeb3985290fa844ebe66 100644
|
|
|
|
|
index 87bf19e2b18307702e293369c5d0a86a39b1f0e0..2ea2c5b59809c87a1a3b97a0b22cc3e43a1c3abd 100644
|
|
|
|
|
--- a/dist/development/lib/server-runtime/single-fetch.js
|
|
|
|
|
+++ b/dist/development/lib/server-runtime/single-fetch.js
|
|
|
|
|
@@ -10,8 +10,7 @@
|
|
|
|
|
@@ -523,15 +525,11 @@ index 89ccb3ff59f3a7953cca2637e1075ff7246a8c69..fbfc45b088a5b00de35daeb3985290fa
|
|
|
|
|
//#endregion
|
|
|
|
|
export { SERVER_NO_BODY_STATUS_CODES, encodeViaTurboStream, generateSingleFetchRedirectResponse, singleFetchAction, singleFetchLoaders };
|
|
|
|
|
diff --git a/dist/development/lib/types/route-data.d.ts b/dist/development/lib/types/route-data.d.ts
|
|
|
|
|
index d03b28e2b0cbc5a260450d874dea4a69c17e53b7..a542dda42aaf60835d69299fcb98837325771d7e 100644
|
|
|
|
|
index aa9953fd326fcddd44c071ad627113f5d4c4590e..6a0b542087104a3618f2f0cfec9de5fb63cff7da 100644
|
|
|
|
|
--- a/dist/development/lib/types/route-data.d.ts
|
|
|
|
|
+++ b/dist/development/lib/types/route-data.d.ts
|
|
|
|
|
@@ -3,11 +3,11 @@ import { DataWithResponseInit, RouterContextProvider } from "../router/utils.js"
|
|
|
|
|
import { Equal, Func, IsAny } from "./utils.js";
|
|
|
|
|
import { RouteModule } from "./route-module.js";
|
|
|
|
|
@@ -7,7 +7,8 @@ import { RouteModule } from "./route-module.js";
|
|
|
|
|
import { unstable_SerializesTo } from "./serializes-to.js";
|
|
|
|
|
-import { Serializable } from "../server-runtime/single-fetch.js";
|
|
|
|
|
import { ClientActionFunctionArgs, ClientLoaderFunctionArgs } from "../dom/ssr/routeModules.js";
|
|
|
|
|
|
|
|
|
|
//#region lib/types/route-data.d.ts
|
|
|
|
|
-type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends ((...args: any[]) => unknown) ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? { [K in keyof T]: Serialize<T[K]> } : undefined;
|
|
|
|
|
@@ -541,7 +539,7 @@ index d03b28e2b0cbc5a260450d874dea4a69c17e53b7..a542dda42aaf60835d69299fcb988373
|
|
|
|
|
type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Func ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
|
|
|
|
|
type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? U : T;
|
|
|
|
|
diff --git a/dist/development/vendor/turbo-stream-v2/flatten.js b/dist/development/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
index 61b8dbf73570da26728aada21ecdd5f3ed4a75cd..f27872d6b326e691eb00f9a5ecd3eb9bbf83d675 100644
|
|
|
|
|
index 3466186decd73dac3b1705b213594bb63548293d..56b8c9bdb147cc277e3363af93ca159cf5dd4088 100644
|
|
|
|
|
--- a/dist/development/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
+++ b/dist/development/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
@@ -46,15 +46,16 @@ async function stringify(stack) {
|
|
|
|
|
@@ -564,8 +562,39 @@ index 61b8dbf73570da26728aada21ecdd5f3ed4a75cd..f27872d6b326e691eb00f9a5ecd3eb9b
|
|
|
|
|
let error = null;
|
|
|
|
|
switch (typeof input) {
|
|
|
|
|
case "boolean":
|
|
|
|
|
diff --git a/dist/production/lib/dom-export/hydrated-router.js b/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
index df767ab6665e9a90344275d717bc31de81ff7228..5140b826243bcc00794aad943290bf49b6f30a66 100644
|
|
|
|
|
--- a/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
+++ b/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
@@ -149,7 +149,8 @@ function HydratedRouter(props) {
|
|
|
|
|
let discoveryState;
|
|
|
|
|
if (discoveryRuntime) discoveryState = UNSAFE_useCustomRouteDiscovery(discoveryRuntime, props.onError);
|
|
|
|
|
else UNSAFE_useFogOFWarDiscovery(router, ssrInfo.manifest, ssrInfo.routeModules, ssr, ssrInfo.context.routeDiscovery, ssrInfo.context.isSpaMode, fetchImplementation, ssrInfo.context.unstable_apiServerOrigin, ssrInfo.context.unstable_apiOnly === true);
|
|
|
|
|
- return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: {
|
|
|
|
|
+ // patched: a stable value so every <Link> doesn't re-render whenever the location changes
|
|
|
|
|
+ let frameworkContext = React$1.useMemo(() => ({
|
|
|
|
|
routeDiscoveryRuntime: discoveryRuntime,
|
|
|
|
|
routeDiscoveryState: discoveryState,
|
|
|
|
|
manifest: ssrInfo.manifest,
|
|
|
|
|
@@ -161,7 +162,15 @@ function HydratedRouter(props) {
|
|
|
|
|
unstable_apiOnly: ssrInfo.context.unstable_apiOnly,
|
|
|
|
|
routeDiscovery: ssrInfo.context.routeDiscovery,
|
|
|
|
|
unstable_apiServerOrigin: ssrInfo.context.unstable_apiServerOrigin
|
|
|
|
|
- } }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
+ }), [
|
|
|
|
|
+ discoveryRuntime,
|
|
|
|
|
+ discoveryState,
|
|
|
|
|
+ ssrInfo.manifest,
|
|
|
|
|
+ ssrInfo.routeModules,
|
|
|
|
|
+ ssrInfo.context,
|
|
|
|
|
+ criticalCss
|
|
|
|
|
+ ]);
|
|
|
|
|
+ return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
router,
|
|
|
|
|
useTransitions: props.useTransitions,
|
|
|
|
|
onError: props.onError
|
|
|
|
|
diff --git a/dist/production/lib/dom/lib.js b/dist/production/lib/dom/lib.js
|
|
|
|
|
index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187f3a5fc5a 100644
|
|
|
|
|
index c64372fc278f3f0e154ce1b47c01a5fbaa2b2e04..f74c78434022bc03d703561379a565fbb8131d6f 100644
|
|
|
|
|
--- a/dist/production/lib/dom/lib.js
|
|
|
|
|
+++ b/dist/production/lib/dom/lib.js
|
|
|
|
|
@@ -12,7 +12,7 @@ import { ABSOLUTE_URL_REGEX } from "../router/url.js";
|
|
|
|
|
@@ -575,8 +604,8 @@ index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187
|
|
|
|
|
-import { DataRouterNavigationContext, NavigationContext, RouteContext, ViewTransitionContext } from "../context.js";
|
|
|
|
|
+import { DataRouterContext, DataRouterNavigationContext, NavigationContext, RouteContext, ViewTransitionContext } from "../context.js";
|
|
|
|
|
import { useBlocker, useCurrentRouteId, useDataRouterContext, useDataRouterFetchers, useDataRouterState, useHref, useLocation, useMatches, useNavigate, useNavigation, useResolvedPath } from "../hooks.js";
|
|
|
|
|
import { Router, hydrationRouteProperties } from "../components.js";
|
|
|
|
|
import { createSearchParams, getFormSubmissionInfo, getSearchParamsForLocation, shouldProcessLinkClick } from "./dom.js";
|
|
|
|
|
import { escapeHtml } from "./ssr/markup.js";
|
|
|
|
|
import { FrameworkContext, PrefetchPageLinks, mergeRefs, usePrefetchBehavior } from "./ssr/components.js";
|
|
|
|
|
@@ -284,7 +284,7 @@ HistoryRouter.displayName = "unstable_HistoryRouter";
|
|
|
|
|
* @param {LinkProps.defaultShouldRevalidate} props.defaultShouldRevalidate n/a
|
|
|
|
|
* @param {LinkProps.mask} props.mask [modes: framework, data] n/a
|
|
|
|
|
@@ -653,7 +682,7 @@ index 91f53f64ac6d7f49aa6cca772fe436845f147b87..6eedb577ec84396d4b5565b4b8fb9187
|
|
|
|
|
"aria-current": ariaCurrent,
|
|
|
|
|
className,
|
|
|
|
|
diff --git a/dist/production/lib/dom/ssr/server.js b/dist/production/lib/dom/ssr/server.js
|
|
|
|
|
index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456324bf160 100644
|
|
|
|
|
index 414c796010e78f585f53180c83add0931e766d2b..82815e4a273f401da85315a1f2b8390d9b1c77a0 100644
|
|
|
|
|
--- a/dist/production/lib/dom/ssr/server.js
|
|
|
|
|
+++ b/dist/production/lib/dom/ssr/server.js
|
|
|
|
|
@@ -32,7 +32,7 @@ import * as React$1 from "react";
|
|
|
|
|
@@ -665,7 +694,7 @@ index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456
|
|
|
|
|
context.staticHandlerContext.loaderData = { ...context.staticHandlerContext.loaderData };
|
|
|
|
|
for (let match of context.staticHandlerContext.matches) {
|
|
|
|
|
let routeId = match.route.id;
|
|
|
|
|
@@ -65,5 +65,14 @@ function ServerRouter({ context, url, nonce }) {
|
|
|
|
|
@@ -67,5 +67,14 @@ function ServerRouter({ context, url, nonce }) {
|
|
|
|
|
nonce
|
|
|
|
|
})) : null);
|
|
|
|
|
}
|
|
|
|
|
@@ -681,7 +710,7 @@ index a2b1aca6bfc6cb9a663596780167b58102beb361..2b29018c3bd23ba9bbb307debcf5b456
|
|
|
|
|
//#endregion
|
|
|
|
|
export { ServerRouter };
|
|
|
|
|
diff --git a/dist/production/lib/dom/ssr/single-fetch.js b/dist/production/lib/dom/ssr/single-fetch.js
|
|
|
|
|
index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd832839dc7acd1 100644
|
|
|
|
|
index 49b10047d7f77a8c91a5eb70226b113b6c2b2ed2..2aeb742475ce678ceed83ba80f4ea1f0729555e0 100644
|
|
|
|
|
--- a/dist/production/lib/dom/ssr/single-fetch.js
|
|
|
|
|
+++ b/dist/production/lib/dom/ssr/single-fetch.js
|
|
|
|
|
@@ -12,11 +12,11 @@ import { ErrorResponseImpl, SUPPORTED_ERROR_TYPES, data, isRouteErrorResponse, r
|
|
|
|
|
@@ -697,9 +726,9 @@ index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd83283
|
|
|
|
|
var SingleFetchNoResultError = class extends Error {};
|
|
|
|
|
const NO_BODY_STATUS_CODES = new Set([
|
|
|
|
|
100,
|
|
|
|
|
@@ -272,24 +272,31 @@ async function fetchAndDecodeViaTurboStream(args, targetRoutes) {
|
|
|
|
|
throw new Error("Unable to decode turbo-stream response", { cause });
|
|
|
|
|
}
|
|
|
|
|
@@ -290,24 +290,31 @@ function fetchAndDecodeViaTurboStream(fetchImplementation, serverOrigin) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
-function decodeViaTurboStream(body, global) {
|
|
|
|
|
- return decode(body, { plugins: [(type, ...rest) => {
|
|
|
|
|
@@ -742,43 +771,14 @@ index dcf5bf78575b794b504279f74e88c31512246186..5c9f9227cd5b61a96bcdcdf0efd83283
|
|
|
|
|
}
|
|
|
|
|
function unwrapSingleFetchResult(result, routeId) {
|
|
|
|
|
if ("redirect" in result) {
|
|
|
|
|
@@ -333,4 +340,4 @@ function createDeferred() {
|
|
|
|
|
@@ -351,4 +358,4 @@ function createDeferred() {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
-export { NO_BODY_STATUS_CODES, SingleFetchRedirectSymbol, StreamTransfer, decodeViaTurboStream, getSingleFetchDataStrategyImpl, getTurboStreamSingleFetchDataStrategy, singleFetchUrl, stripIndexParam };
|
|
|
|
|
+export { JSON_TYPE_KEY, NO_BODY_STATUS_CODES, SingleFetchRedirectSymbol, StreamTransfer, decodeViaTurboStream, getSingleFetchDataStrategyImpl, getTurboStreamSingleFetchDataStrategy, singleFetchUrl, stripIndexParam };
|
|
|
|
|
diff --git a/dist/production/lib/dom-export/hydrated-router.js b/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
index 4d0817136a6b1398fd80a0ea1cb864a01796f203..0e91eece494e1ac17a344670fd08404a89d63f1c 100644
|
|
|
|
|
--- a/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
+++ b/dist/production/lib/dom-export/hydrated-router.js
|
|
|
|
|
@@ -133,7 +133,8 @@ function HydratedRouter(props) {
|
|
|
|
|
}, [location]);
|
|
|
|
|
UNSAFE_invariant(ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
|
|
|
|
UNSAFE_useFogOFWarDiscovery(router, ssrInfo.manifest, ssrInfo.routeModules, ssrInfo.context.ssr, ssrInfo.context.routeDiscovery, ssrInfo.context.isSpaMode);
|
|
|
|
|
- return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: {
|
|
|
|
|
+ // patched: a stable value so every <Link> doesn't re-render whenever the location changes
|
|
|
|
|
+ let frameworkContext = React$1.useMemo(() => ({
|
|
|
|
|
manifest: ssrInfo.manifest,
|
|
|
|
|
routeModules: ssrInfo.routeModules,
|
|
|
|
|
future: ssrInfo.context.future,
|
|
|
|
|
@@ -141,7 +142,13 @@ function HydratedRouter(props) {
|
|
|
|
|
ssr: ssrInfo.context.ssr,
|
|
|
|
|
isSpaMode: ssrInfo.context.isSpaMode,
|
|
|
|
|
routeDiscovery: ssrInfo.context.routeDiscovery
|
|
|
|
|
- } }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
+ }), [
|
|
|
|
|
+ ssrInfo.manifest,
|
|
|
|
|
+ ssrInfo.routeModules,
|
|
|
|
|
+ ssrInfo.context,
|
|
|
|
|
+ criticalCss
|
|
|
|
|
+ ]);
|
|
|
|
|
+ return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(UNSAFE_FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React$1.createElement(UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React$1.createElement(RouterProvider$1, {
|
|
|
|
|
router,
|
|
|
|
|
useTransitions: props.useTransitions,
|
|
|
|
|
onError: props.onError
|
|
|
|
|
diff --git a/dist/production/lib/hooks.js b/dist/production/lib/hooks.js
|
|
|
|
|
index d83812a300d04b1301221b9f2650dc8197257cbb..4ebb1dd7321b19ab2aa1cd4f1784cb1b60be723e 100644
|
|
|
|
|
index 53530d4909ce7df1529dbf52b65eeac5179e19d4..354c1933c06276edb0d453b9845db1304e354413 100644
|
|
|
|
|
--- a/dist/production/lib/hooks.js
|
|
|
|
|
+++ b/dist/production/lib/hooks.js
|
|
|
|
|
@@ -527,10 +527,11 @@ function useParams() {
|
|
|
|
|
@@ -818,7 +818,7 @@ index d83812a300d04b1301221b9f2650dc8197257cbb..4ebb1dd7321b19ab2aa1cd4f1784cb1b
|
|
|
|
|
function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
|
|
|
|
|
let dataRouterState = dataRouterOpts?.state;
|
|
|
|
|
diff --git a/dist/production/lib/router/matcher.js b/dist/production/lib/router/matcher.js
|
|
|
|
|
index 135d8da979b2a7c88c43f2f85c43de0ac6a49ad0..5eb2b3edfda349e5de531559c3313e4d0f4ac8e3 100644
|
|
|
|
|
index 865fabf95800603edec9f8ef546886fb049e7a57..bdbaee27652607050a25f4546780b1a4f0cf2bc9 100644
|
|
|
|
|
--- a/dist/production/lib/router/matcher.js
|
|
|
|
|
+++ b/dist/production/lib/router/matcher.js
|
|
|
|
|
@@ -8,11 +8,14 @@
|
|
|
|
|
@@ -871,10 +871,10 @@ index 135d8da979b2a7c88c43f2f85c43de0ac6a49ad0..5eb2b3edfda349e5de531559c3313e4d
|
|
|
|
|
//#endregion
|
|
|
|
|
export { V6RegExMatcher };
|
|
|
|
|
diff --git a/dist/production/lib/router/router.js b/dist/production/lib/router/router.js
|
|
|
|
|
index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b98182647e 100644
|
|
|
|
|
index 96a9def58aa7936a638cb8b2bbc8befbb1022866..a13a417e876dcd042356474445b495f79e650d0e 100644
|
|
|
|
|
--- a/dist/production/lib/router/router.js
|
|
|
|
|
+++ b/dist/production/lib/router/router.js
|
|
|
|
|
@@ -2725,7 +2725,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
|
|
@@ -2817,7 +2817,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
|
|
}
|
|
|
|
|
function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k, v]) => {
|
|
|
|
|
@@ -883,7 +883,7 @@ index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b9
|
|
|
|
|
return merged;
|
|
|
|
|
}, {});
|
|
|
|
|
let preservedCount = 0;
|
|
|
|
|
@@ -2739,6 +2739,30 @@ function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
@@ -2831,6 +2831,30 @@ function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
|
|
|
|
|
}
|
|
|
|
|
return Object.keys(newLoaderData).length === 0 && preservedCount === Object.keys(loaderData).length ? loaderData : mergedLoaderData;
|
|
|
|
|
}
|
|
|
|
|
@@ -915,7 +915,7 @@ index b6faa6059480c74780c475ebdcf2f1061056328c..c4c2e41142500ffd6f6378daffdea7b9
|
|
|
|
|
if (!pendingActionResult) return {};
|
|
|
|
|
return isErrorResult(pendingActionResult[1]) ? { actionData: {} } : { actionData: { [pendingActionResult[0]]: pendingActionResult[1].data } };
|
|
|
|
|
diff --git a/dist/production/lib/server-runtime/crypto.js b/dist/production/lib/server-runtime/crypto.js
|
|
|
|
|
index a4f6c3f43084bfccf5d9ebe4908868502ce70b58..c0619093ba8a2763d523d5a868896626636123f4 100644
|
|
|
|
|
index ba03b7e99e0d126a06b41c3fa50273418a3d073e..9b64f19f9c2cf2e06dc65a4b20bfcd0e5d8b3c7c 100644
|
|
|
|
|
--- a/dist/production/lib/server-runtime/crypto.js
|
|
|
|
|
+++ b/dist/production/lib/server-runtime/crypto.js
|
|
|
|
|
@@ -10,7 +10,10 @@
|
|
|
|
|
@@ -944,7 +944,7 @@ index a4f6c3f43084bfccf5d9ebe4908868502ce70b58..c0619093ba8a2763d523d5a868896626
|
|
|
|
|
let key = await createKey(secret, ["verify"]);
|
|
|
|
|
try {
|
|
|
|
|
diff --git a/dist/production/lib/server-runtime/entry.js b/dist/production/lib/server-runtime/entry.js
|
|
|
|
|
index e863c7243768adc4b6a73da7e485895249358bab..26aec6dfce410872389037706052ccaa8f71d570 100644
|
|
|
|
|
index 979f27086e6ce619702a137887e6eae85a07b059..ff2ef6b207f4ac24a74c29962d4b709d3ab4d434 100644
|
|
|
|
|
--- a/dist/production/lib/server-runtime/entry.js
|
|
|
|
|
+++ b/dist/production/lib/server-runtime/entry.js
|
|
|
|
|
@@ -9,7 +9,14 @@
|
|
|
|
|
@@ -963,7 +963,7 @@ index e863c7243768adc4b6a73da7e485895249358bab..26aec6dfce410872389037706052ccaa
|
|
|
|
|
let route = manifest[routeId];
|
|
|
|
|
if (route) memo[routeId] = route.module;
|
|
|
|
|
diff --git a/dist/production/lib/server-runtime/single-fetch.js b/dist/production/lib/server-runtime/single-fetch.js
|
|
|
|
|
index 89ccb3ff59f3a7953cca2637e1075ff7246a8c69..fbfc45b088a5b00de35daeb3985290fa844ebe66 100644
|
|
|
|
|
index 87bf19e2b18307702e293369c5d0a86a39b1f0e0..2ea2c5b59809c87a1a3b97a0b22cc3e43a1c3abd 100644
|
|
|
|
|
--- a/dist/production/lib/server-runtime/single-fetch.js
|
|
|
|
|
+++ b/dist/production/lib/server-runtime/single-fetch.js
|
|
|
|
|
@@ -10,8 +10,7 @@
|
|
|
|
|
@@ -1089,15 +1089,11 @@ index 89ccb3ff59f3a7953cca2637e1075ff7246a8c69..fbfc45b088a5b00de35daeb3985290fa
|
|
|
|
|
//#endregion
|
|
|
|
|
export { SERVER_NO_BODY_STATUS_CODES, encodeViaTurboStream, generateSingleFetchRedirectResponse, singleFetchAction, singleFetchLoaders };
|
|
|
|
|
diff --git a/dist/production/lib/types/route-data.d.ts b/dist/production/lib/types/route-data.d.ts
|
|
|
|
|
index d03b28e2b0cbc5a260450d874dea4a69c17e53b7..a542dda42aaf60835d69299fcb98837325771d7e 100644
|
|
|
|
|
index aa9953fd326fcddd44c071ad627113f5d4c4590e..6a0b542087104a3618f2f0cfec9de5fb63cff7da 100644
|
|
|
|
|
--- a/dist/production/lib/types/route-data.d.ts
|
|
|
|
|
+++ b/dist/production/lib/types/route-data.d.ts
|
|
|
|
|
@@ -3,11 +3,11 @@ import { DataWithResponseInit, RouterContextProvider } from "../router/utils.js"
|
|
|
|
|
import { Equal, Func, IsAny } from "./utils.js";
|
|
|
|
|
import { RouteModule } from "./route-module.js";
|
|
|
|
|
@@ -7,7 +7,8 @@ import { RouteModule } from "./route-module.js";
|
|
|
|
|
import { unstable_SerializesTo } from "./serializes-to.js";
|
|
|
|
|
-import { Serializable } from "../server-runtime/single-fetch.js";
|
|
|
|
|
import { ClientActionFunctionArgs, ClientLoaderFunctionArgs } from "../dom/ssr/routeModules.js";
|
|
|
|
|
|
|
|
|
|
//#region lib/types/route-data.d.ts
|
|
|
|
|
-type Serialize<T> = T extends unstable_SerializesTo<infer To> ? To : T extends Serializable ? T : T extends ((...args: any[]) => unknown) ? undefined : T extends Promise<infer U> ? Promise<Serialize<U>> : T extends Map<infer K, infer V> ? Map<Serialize<K>, Serialize<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Serialize<K>, Serialize<V>> : T extends Set<infer U> ? Set<Serialize<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<Serialize<U>> : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [Serialize<F>, ...Serialize<R>] : T extends Array<infer U> ? Array<Serialize<U>> : T extends readonly unknown[] ? readonly Serialize<T[number]>[] : T extends Record<any, any> ? { [K in keyof T]: Serialize<T[K]> } : undefined;
|
|
|
|
|
@@ -1107,7 +1103,7 @@ index d03b28e2b0cbc5a260450d874dea4a69c17e53b7..a542dda42aaf60835d69299fcb988373
|
|
|
|
|
type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Func ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
|
|
|
|
|
type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? U : T;
|
|
|
|
|
diff --git a/dist/production/vendor/turbo-stream-v2/flatten.js b/dist/production/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
index 61b8dbf73570da26728aada21ecdd5f3ed4a75cd..f27872d6b326e691eb00f9a5ecd3eb9bbf83d675 100644
|
|
|
|
|
index 3466186decd73dac3b1705b213594bb63548293d..56b8c9bdb147cc277e3363af93ca159cf5dd4088 100644
|
|
|
|
|
--- a/dist/production/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
+++ b/dist/production/vendor/turbo-stream-v2/flatten.js
|
|
|
|
|
@@ -46,15 +46,16 @@ async function stringify(stack) {
|