react-router 0.0.0-experimental-451e72371 → 0.0.0-experimental-4303fcb98
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/dist/development/{chunk-ULMQDNJI.mjs → chunk-3HEPIEBR.mjs} +135 -15
- package/dist/development/dom-export.js +1 -1
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.d.mts +6 -11
- package/dist/development/index.d.ts +6 -11
- package/dist/development/index.js +136 -17
- package/dist/development/index.mjs +4 -6
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/rsc-export.js +1 -1
- package/dist/development/rsc-export.mjs +1 -1
- package/dist/production/{chunk-KTTKZOUB.mjs → chunk-EOWVQJO2.mjs} +135 -15
- package/dist/production/dom-export.js +1 -1
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.d.mts +6 -11
- package/dist/production/index.d.ts +6 -11
- package/dist/production/index.js +136 -17
- package/dist/production/index.mjs +4 -6
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/rsc-export.js +1 -1
- package/dist/production/rsc-export.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-4303fcb98
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -8804,7 +8804,7 @@ function mergeRefs(...refs) {
|
|
|
8804
8804
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8805
8805
|
try {
|
|
8806
8806
|
if (isBrowser) {
|
|
8807
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8807
|
+
window.__reactRouterVersion = "0.0.0-experimental-4303fcb98";
|
|
8808
8808
|
}
|
|
8809
8809
|
} catch (e) {
|
|
8810
8810
|
}
|
|
@@ -11479,7 +11479,7 @@ function href(path, ...args) {
|
|
|
11479
11479
|
}
|
|
11480
11480
|
|
|
11481
11481
|
// lib/rsc/browser.tsx
|
|
11482
|
-
import * as
|
|
11482
|
+
import * as React15 from "react";
|
|
11483
11483
|
import * as ReactDOM from "react-dom";
|
|
11484
11484
|
|
|
11485
11485
|
// lib/dom/ssr/hydration.tsx
|
|
@@ -11508,6 +11508,116 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
|
|
|
11508
11508
|
return hydrationData;
|
|
11509
11509
|
}
|
|
11510
11510
|
|
|
11511
|
+
// lib/rsc/errorBoundaries.tsx
|
|
11512
|
+
import React14 from "react";
|
|
11513
|
+
var RSCRouterGlobalErrorBoundary = class extends React14.Component {
|
|
11514
|
+
constructor(props) {
|
|
11515
|
+
super(props);
|
|
11516
|
+
this.state = { error: null, location: props.location };
|
|
11517
|
+
}
|
|
11518
|
+
static getDerivedStateFromError(error) {
|
|
11519
|
+
return { error };
|
|
11520
|
+
}
|
|
11521
|
+
static getDerivedStateFromProps(props, state) {
|
|
11522
|
+
if (state.location !== props.location) {
|
|
11523
|
+
return { error: null, location: props.location };
|
|
11524
|
+
}
|
|
11525
|
+
return { error: state.error, location: state.location };
|
|
11526
|
+
}
|
|
11527
|
+
render() {
|
|
11528
|
+
if (this.state.error) {
|
|
11529
|
+
return /* @__PURE__ */ React14.createElement(
|
|
11530
|
+
RSCDefaultRootErrorBoundaryImpl,
|
|
11531
|
+
{
|
|
11532
|
+
error: this.state.error,
|
|
11533
|
+
renderAppShell: true
|
|
11534
|
+
}
|
|
11535
|
+
);
|
|
11536
|
+
} else {
|
|
11537
|
+
return this.props.children;
|
|
11538
|
+
}
|
|
11539
|
+
}
|
|
11540
|
+
};
|
|
11541
|
+
function ErrorWrapper({
|
|
11542
|
+
renderAppShell,
|
|
11543
|
+
title,
|
|
11544
|
+
children
|
|
11545
|
+
}) {
|
|
11546
|
+
if (!renderAppShell) {
|
|
11547
|
+
return children;
|
|
11548
|
+
}
|
|
11549
|
+
return /* @__PURE__ */ React14.createElement("html", { lang: "en" }, /* @__PURE__ */ React14.createElement("head", null, /* @__PURE__ */ React14.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React14.createElement(
|
|
11550
|
+
"meta",
|
|
11551
|
+
{
|
|
11552
|
+
name: "viewport",
|
|
11553
|
+
content: "width=device-width,initial-scale=1,viewport-fit=cover"
|
|
11554
|
+
}
|
|
11555
|
+
), /* @__PURE__ */ React14.createElement("title", null, title)), /* @__PURE__ */ React14.createElement("body", null, /* @__PURE__ */ React14.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children)));
|
|
11556
|
+
}
|
|
11557
|
+
function RSCDefaultRootErrorBoundaryImpl({
|
|
11558
|
+
error,
|
|
11559
|
+
renderAppShell
|
|
11560
|
+
}) {
|
|
11561
|
+
console.error(error);
|
|
11562
|
+
let heyDeveloper = /* @__PURE__ */ React14.createElement(
|
|
11563
|
+
"script",
|
|
11564
|
+
{
|
|
11565
|
+
dangerouslySetInnerHTML: {
|
|
11566
|
+
__html: `
|
|
11567
|
+
console.log(
|
|
11568
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
11569
|
+
);
|
|
11570
|
+
`
|
|
11571
|
+
}
|
|
11572
|
+
}
|
|
11573
|
+
);
|
|
11574
|
+
if (isRouteErrorResponse(error)) {
|
|
11575
|
+
return /* @__PURE__ */ React14.createElement(
|
|
11576
|
+
ErrorWrapper,
|
|
11577
|
+
{
|
|
11578
|
+
renderAppShell,
|
|
11579
|
+
title: "Unhandled Thrown Response!"
|
|
11580
|
+
},
|
|
11581
|
+
/* @__PURE__ */ React14.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
11582
|
+
ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
11583
|
+
);
|
|
11584
|
+
}
|
|
11585
|
+
let errorInstance;
|
|
11586
|
+
if (error instanceof Error) {
|
|
11587
|
+
errorInstance = error;
|
|
11588
|
+
} else {
|
|
11589
|
+
let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
|
|
11590
|
+
errorInstance = new Error(errorString);
|
|
11591
|
+
}
|
|
11592
|
+
return /* @__PURE__ */ React14.createElement(ErrorWrapper, { renderAppShell, title: "Application Error!" }, /* @__PURE__ */ React14.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"), /* @__PURE__ */ React14.createElement(
|
|
11593
|
+
"pre",
|
|
11594
|
+
{
|
|
11595
|
+
style: {
|
|
11596
|
+
padding: "2rem",
|
|
11597
|
+
background: "hsla(10, 50%, 50%, 0.1)",
|
|
11598
|
+
color: "red",
|
|
11599
|
+
overflow: "auto"
|
|
11600
|
+
}
|
|
11601
|
+
},
|
|
11602
|
+
errorInstance.stack
|
|
11603
|
+
), heyDeveloper);
|
|
11604
|
+
}
|
|
11605
|
+
function RSCDefaultRootErrorBoundary({
|
|
11606
|
+
hasRootLayout
|
|
11607
|
+
}) {
|
|
11608
|
+
let error = useRouteError();
|
|
11609
|
+
if (hasRootLayout === void 0) {
|
|
11610
|
+
throw new Error("Missing 'hasRootLayout' prop");
|
|
11611
|
+
}
|
|
11612
|
+
return /* @__PURE__ */ React14.createElement(
|
|
11613
|
+
RSCDefaultRootErrorBoundaryImpl,
|
|
11614
|
+
{
|
|
11615
|
+
renderAppShell: !hasRootLayout,
|
|
11616
|
+
error
|
|
11617
|
+
}
|
|
11618
|
+
);
|
|
11619
|
+
}
|
|
11620
|
+
|
|
11511
11621
|
// lib/rsc/browser.tsx
|
|
11512
11622
|
function createCallServer({
|
|
11513
11623
|
decode: decode2,
|
|
@@ -11577,7 +11687,7 @@ function createCallServer({
|
|
|
11577
11687
|
lastMatch = match;
|
|
11578
11688
|
}
|
|
11579
11689
|
window.__router._internalSetStateDoNotUseOrYouWillBreakYourApp({});
|
|
11580
|
-
|
|
11690
|
+
React15.startTransition(() => {
|
|
11581
11691
|
window.__router._internalSetStateDoNotUseOrYouWillBreakYourApp({
|
|
11582
11692
|
loaderData: Object.assign(
|
|
11583
11693
|
{},
|
|
@@ -11789,18 +11899,27 @@ function RSCHydratedRouter({
|
|
|
11789
11899
|
routeDiscovery = "eager"
|
|
11790
11900
|
}) {
|
|
11791
11901
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
11792
|
-
let router =
|
|
11902
|
+
let router = React15.useMemo(
|
|
11793
11903
|
() => createRouterFromPayload({ decode: decode2, payload }),
|
|
11794
11904
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11795
11905
|
[]
|
|
11796
11906
|
);
|
|
11797
|
-
|
|
11907
|
+
React15.useLayoutEffect(() => {
|
|
11798
11908
|
if (!window.__routerInitialized) {
|
|
11799
11909
|
window.__routerInitialized = true;
|
|
11800
11910
|
window.__router.initialize();
|
|
11801
11911
|
}
|
|
11802
11912
|
}, []);
|
|
11803
|
-
|
|
11913
|
+
let [location2, setLocation] = React15.useState(router.state.location);
|
|
11914
|
+
React15.useLayoutEffect(
|
|
11915
|
+
() => router.subscribe((newState) => {
|
|
11916
|
+
if (newState.location !== location2) {
|
|
11917
|
+
setLocation(newState.location);
|
|
11918
|
+
}
|
|
11919
|
+
}),
|
|
11920
|
+
[router, location2]
|
|
11921
|
+
);
|
|
11922
|
+
React15.useEffect(() => {
|
|
11804
11923
|
if (routeDiscovery === "lazy" || // @ts-expect-error - TS doesn't know about this yet
|
|
11805
11924
|
window.navigator?.connection?.saveData === true) {
|
|
11806
11925
|
return;
|
|
@@ -11865,7 +11984,7 @@ function RSCHydratedRouter({
|
|
|
11865
11984
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
11866
11985
|
routeModules: {}
|
|
11867
11986
|
};
|
|
11868
|
-
return /* @__PURE__ */
|
|
11987
|
+
return /* @__PURE__ */ React15.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
11869
11988
|
}
|
|
11870
11989
|
function createRouteFromServerManifest(match, payload) {
|
|
11871
11990
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -11924,7 +12043,9 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
11924
12043
|
);
|
|
11925
12044
|
return await callSingleFetch(singleFetch);
|
|
11926
12045
|
}
|
|
11927
|
-
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) :
|
|
12046
|
+
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
12047
|
+
throw noActionDefinedError("action", match.id);
|
|
12048
|
+
},
|
|
11928
12049
|
path: match.path,
|
|
11929
12050
|
shouldRevalidate: match.shouldRevalidate,
|
|
11930
12051
|
// We always have a "loader" in this RSC world since even if we don't
|
|
@@ -12000,7 +12121,7 @@ function debounce2(callback, wait) {
|
|
|
12000
12121
|
}
|
|
12001
12122
|
|
|
12002
12123
|
// lib/rsc/server.ssr.tsx
|
|
12003
|
-
import * as
|
|
12124
|
+
import * as React16 from "react";
|
|
12004
12125
|
|
|
12005
12126
|
// lib/rsc/html-stream/server.ts
|
|
12006
12127
|
var encoder2 = new TextEncoder();
|
|
@@ -12147,7 +12268,7 @@ async function routeRSCServerRequest({
|
|
|
12147
12268
|
function RSCStaticRouter({
|
|
12148
12269
|
getPayload
|
|
12149
12270
|
}) {
|
|
12150
|
-
const payload =
|
|
12271
|
+
const payload = React16.use(getPayload());
|
|
12151
12272
|
if (payload.type === "redirect") {
|
|
12152
12273
|
throw new Response(null, {
|
|
12153
12274
|
status: payload.status,
|
|
@@ -12226,7 +12347,7 @@ function RSCStaticRouter({
|
|
|
12226
12347
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
12227
12348
|
routeModules: {}
|
|
12228
12349
|
};
|
|
12229
|
-
return /* @__PURE__ */
|
|
12350
|
+
return /* @__PURE__ */ React16.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
|
|
12230
12351
|
StaticRouterProvider,
|
|
12231
12352
|
{
|
|
12232
12353
|
context,
|
|
@@ -12234,7 +12355,7 @@ function RSCStaticRouter({
|
|
|
12234
12355
|
hydrate: false,
|
|
12235
12356
|
nonce: payload.nonce
|
|
12236
12357
|
}
|
|
12237
|
-
)));
|
|
12358
|
+
))));
|
|
12238
12359
|
}
|
|
12239
12360
|
function isReactServerRequest(url) {
|
|
12240
12361
|
return url.pathname.endsWith(".rsc");
|
|
@@ -12387,8 +12508,6 @@ export {
|
|
|
12387
12508
|
getTurboStreamSingleFetchDataStrategy,
|
|
12388
12509
|
decodeViaTurboStream,
|
|
12389
12510
|
RemixErrorBoundary,
|
|
12390
|
-
RemixRootDefaultErrorBoundary,
|
|
12391
|
-
RemixRootDefaultHydrateFallback,
|
|
12392
12511
|
createClientRoutesWithHMRRevalidationOptOut,
|
|
12393
12512
|
createClientRoutes,
|
|
12394
12513
|
shouldHydrateRouteLoader,
|
|
@@ -12436,6 +12555,7 @@ export {
|
|
|
12436
12555
|
createMemorySessionStorage,
|
|
12437
12556
|
href,
|
|
12438
12557
|
getHydrationData,
|
|
12558
|
+
RSCDefaultRootErrorBoundary,
|
|
12439
12559
|
createCallServer,
|
|
12440
12560
|
RSCHydratedRouter,
|
|
12441
12561
|
routeRSCServerRequest,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-4303fcb98
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
invariant,
|
|
27
27
|
mapRouteProperties,
|
|
28
28
|
useFogOFWarDiscovery
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3HEPIEBR.mjs";
|
|
30
30
|
|
|
31
31
|
// lib/dom-export/dom-router-provider.tsx
|
|
32
32
|
import * as React from "react";
|
|
@@ -3,7 +3,7 @@ export { y as ActionFunctionArgs, B as Blocker, s as BlockerFunction, au as Clie
|
|
|
3
3
|
import { A as AssetsManifest, E as EntryContext, F as FutureConfig$1, a as RouteComponentType, H as HydrateFallbackType, b as ErrorBoundaryType, S as ServerBuild, c as ServerPayload } from './browser-DQVA_cmy.mjs';
|
|
4
4
|
export { i as Await, d as AwaitProps, ag as BrowserRouter, a0 as BrowserRouterProps, a1 as DOMRouterOpts, a7 as FetcherFormProps, ac as FetcherSubmitFunction, aw as FetcherSubmitOptions, ad as FetcherWithComponents, al as Form, a8 as FormProps, aH as HandleDataRequestFunction, aI as HandleDocumentRequestFunction, aJ as HandleErrorFunction, ah as HashRouter, a2 as HashRouterProps, a3 as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, ai as Link, a4 as LinkProps, aD as Links, j as MemoryRouter, M as MemoryRouterOpts, e as MemoryRouterProps, aC as Meta, ak as NavLink, a5 as NavLinkProps, a6 as NavLinkRenderProps, k as Navigate, u as NavigateFunction, N as NavigateProps, l as Outlet, O as OutletProps, ax as ParamKeyValuePair, P as PathRouteProps, aF as PrefetchPageLinks, m as Route, f as RouteProps, n as Router, g as RouterProps, o as RouterProvider, R as RouterProviderProps, p as Routes, h as RoutesProps, aE as Scripts, aG as ScriptsProps, am as ScrollRestoration, a9 as ScrollRestorationProps, aK as ServerEntryModule, aa as SetURLSearchParams, ab as SubmitFunction, ay as SubmitOptions, aA as SubmitTarget, aV as UNSAFE_FrameworkContext, aW as UNSAFE_createClientRoutes, aX as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, aQ as UNSAFE_hydrationRouteProperties, aR as UNSAFE_mapRouteProperties, aY as UNSAFE_shouldHydrateRouteLoader, aZ as UNSAFE_useScrollRestoration, aS as UNSAFE_withComponentProps, aU as UNSAFE_withErrorBoundaryProps, aT as UNSAFE_withHydrateFallbackProps, az as URLSearchParamsInit, ae as createBrowserRouter, af as createHashRouter, q as createMemoryRouter, r as createRoutesFromChildren, s as createRoutesFromElements, aB as createSearchParams, t as renderMatches, aL as unstable_DecodeServerResponseFunction, aM as unstable_EncodeActionFunction, aj as unstable_HistoryRouter, aO as unstable_RSCHydratedRouter, aN as unstable_createCallServer, aP as unstable_getServerStream, au as unstable_usePrompt, w as useActionData, x as useAsyncError, y as useAsyncValue, at as useBeforeUnload, v as useBlocker, ar as useFetcher, as as useFetchers, aq as useFormAction, z as useHref, B as useInRouterContext, an as useLinkClickHandler, C as useLoaderData, D as useLocation, G as useMatch, J as useMatches, K as useNavigate, Q as useNavigation, T as useNavigationType, U as useOutlet, V as useOutletContext, W as useParams, X as useResolvedPath, Y as useRevalidator, Z as useRouteError, _ as useRouteLoaderData, $ as useRoutes, ao as useSearchParams, ap as useSubmit, av as useViewTransitionState } from './browser-DQVA_cmy.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { ReactElement } from 'react';
|
|
6
|
+
import React__default, { ReactElement } from 'react';
|
|
7
7
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
8
8
|
export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
|
|
9
9
|
import { P as Pages } from './register-DeIo2iHO.mjs';
|
|
@@ -394,6 +394,10 @@ declare function RSCStaticRouter({ getPayload, }: {
|
|
|
394
394
|
getPayload: () => Promise<ServerPayload>;
|
|
395
395
|
}): React.JSX.Element | null;
|
|
396
396
|
|
|
397
|
+
declare function RSCDefaultRootErrorBoundary({ hasRootLayout, }: {
|
|
398
|
+
hasRootLayout: boolean;
|
|
399
|
+
}): React__default.JSX.Element;
|
|
400
|
+
|
|
397
401
|
declare function deserializeErrors(errors: RouterState["errors"]): RouterState["errors"];
|
|
398
402
|
|
|
399
403
|
type RemixErrorBoundaryProps = React.PropsWithChildren<{
|
|
@@ -416,15 +420,6 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
416
420
|
};
|
|
417
421
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
418
422
|
}
|
|
419
|
-
/**
|
|
420
|
-
* When app's don't provide a root level ErrorBoundary, we default to this.
|
|
421
|
-
*/
|
|
422
|
-
declare function RemixRootDefaultErrorBoundary({ error, isOutsideRemixApp, }: {
|
|
423
|
-
error: unknown;
|
|
424
|
-
isOutsideRemixApp?: boolean;
|
|
425
|
-
}): React.JSX.Element;
|
|
426
|
-
|
|
427
|
-
declare function RemixRootDefaultHydrateFallback(): React.JSX.Element;
|
|
428
423
|
|
|
429
424
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
430
425
|
declare function useFogOFWarDiscovery(router: Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean): void;
|
|
@@ -439,4 +434,4 @@ declare function getHydrationData(state: {
|
|
|
439
434
|
hasHydrateFallback: boolean;
|
|
440
435
|
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
441
436
|
|
|
442
|
-
export { ActionFunction, AppLoadContext, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, Location, MetaFunction, NonIndexRouteObject, PatchRoutesOnNavigationFunction, Path, type RequestHandler, RouteObject, RouterState, type RoutesTestStubProps, ServerBuild, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled,
|
|
437
|
+
export { ActionFunction, AppLoadContext, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, DataRouteObject, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, Location, MetaFunction, NonIndexRouteObject, PatchRoutesOnNavigationFunction, Path, type RequestHandler, RouteObject, RouterState, type RoutesTestStubProps, ServerBuild, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, AssetsManifest as UNSAFE_AssetsManifest, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, unstable_InitialContext, RSCStaticRouter as unstable_RSCStaticRouter, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, A as AppLoadContext, L as LoaderFunctionArgs, a as ActionFunctionArgs, b as RouteModules, c as StaticHandlerContext, H as HydrationState, D as DataRouteObject, C as ClientLoaderFunction, d as Router$1, e as DataStrategyFunction, T as To, N as NavigateOptions, B as BlockerFunction, f as Blocker, g as SerializeFrom, h as RelativeRoutingType, i as Location, P as ParamParseKey, j as Path, k as PathPattern, l as PathMatch, U as UIMatch, m as Navigation, n as Action, o as Params, p as RouteObject, I as IndexRouteObject, q as LazyRouteFunction, r as NonIndexRouteObject, s as RouterInit, F as FutureConfig$1, t as InitialEntry, v as PatchRoutesOnNavigationFunction, w as Navigator, x as RouteMatch, y as HTMLFormMethod, z as FormEncType, E as PageLinkDescriptor, G as History, J as GetScrollRestorationKeyFunction, K as Fetcher, O as CreateStaticHandlerOptions$1, Q as StaticHandler, V as LoaderFunction, W as ActionFunction, X as MetaFunction, Y as LinksFunction, Z as unstable_InitialContext, _ as Pages, $ as Equal, a0 as ClientActionFunction, a1 as ShouldRevalidateFunction, a2 as RouterState } from './register-BEmY26MO.js';
|
|
2
2
|
export { aB as ClientActionFunctionArgs, aC as ClientLoaderFunctionArgs, az as DataRouteMatch, a9 as DataStrategyFunctionArgs, aa as DataStrategyMatch, ab as DataStrategyResult, ad as ErrorResponse, ae as FormMethod, aJ as Future, a3 as GetScrollPositionFunction, aD as HeadersArgs, aE as HeadersFunction, aH as HtmlLinkDescriptor, ap as IDLE_BLOCKER, ao as IDLE_FETCHER, an as IDLE_NAVIGATION, aI as LinkDescriptor, aF as MetaArgs, aG as MetaDescriptor, a4 as NavigationStates, aA as PatchRoutesOnNavigationFunctionArgs, ag as PathParam, ah as RedirectFunction, aL as Register, a8 as RevalidationState, a7 as RouterFetchOptions, a6 as RouterNavigateOptions, a5 as RouterSubscriber, aj as ShouldRevalidateFunctionArgs, aQ as UNSAFE_DataRouterContext, aR as UNSAFE_DataRouterStateContext, ac as UNSAFE_DataWithResponseInit, aP as UNSAFE_ErrorResponseImpl, aS as UNSAFE_FetchersContext, aT as UNSAFE_LocationContext, aU as UNSAFE_NavigationContext, aV as UNSAFE_RouteContext, aW as UNSAFE_ViewTransitionContext, aM as UNSAFE_createBrowserHistory, aO as UNSAFE_createRouter, aN as UNSAFE_invariant, al as createPath, aq as data, ar as generatePath, as as isRouteErrorResponse, at as matchPath, au as matchRoutes, am as parsePath, av as redirect, aw as redirectDocument, ax as replace, ay as resolvePath, af as unstable_MiddlewareFunction, ai as unstable_RouterContext, aK as unstable_SerializesTo, ak as unstable_createContext } from './register-BEmY26MO.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { ReactElement } from 'react';
|
|
4
|
+
import React__default, { ReactElement } from 'react';
|
|
5
5
|
import { ParseOptions, SerializeOptions } from 'cookie';
|
|
6
6
|
export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie';
|
|
7
7
|
|
|
@@ -2602,6 +2602,10 @@ declare global {
|
|
|
2602
2602
|
}
|
|
2603
2603
|
declare function getServerStream(): ReadableStream<any>;
|
|
2604
2604
|
|
|
2605
|
+
declare function RSCDefaultRootErrorBoundary({ hasRootLayout, }: {
|
|
2606
|
+
hasRootLayout: boolean;
|
|
2607
|
+
}): React__default.JSX.Element;
|
|
2608
|
+
|
|
2605
2609
|
declare function deserializeErrors(errors: RouterState["errors"]): RouterState["errors"];
|
|
2606
2610
|
|
|
2607
2611
|
type RemixErrorBoundaryProps = React.PropsWithChildren<{
|
|
@@ -2624,15 +2628,6 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
|
|
|
2624
2628
|
};
|
|
2625
2629
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
2626
2630
|
}
|
|
2627
|
-
/**
|
|
2628
|
-
* When app's don't provide a root level ErrorBoundary, we default to this.
|
|
2629
|
-
*/
|
|
2630
|
-
declare function RemixRootDefaultErrorBoundary({ error, isOutsideRemixApp, }: {
|
|
2631
|
-
error: unknown;
|
|
2632
|
-
isOutsideRemixApp?: boolean;
|
|
2633
|
-
}): React.JSX.Element;
|
|
2634
|
-
|
|
2635
|
-
declare function RemixRootDefaultHydrateFallback(): React.JSX.Element;
|
|
2636
2631
|
|
|
2637
2632
|
declare function getPatchRoutesOnNavigationFunction(manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean, basename: string | undefined): PatchRoutesOnNavigationFunction | undefined;
|
|
2638
2633
|
declare function useFogOFWarDiscovery(router: Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, routeDiscovery: ServerBuild["routeDiscovery"], isSpaMode: boolean): void;
|
|
@@ -2647,4 +2642,4 @@ declare function getHydrationData(state: {
|
|
|
2647
2642
|
hasHydrateFallback: boolean;
|
|
2648
2643
|
}, location: Path, basename: string | undefined, isSpaMode: boolean): HydrationState;
|
|
2649
2644
|
|
|
2650
|
-
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Await, type AwaitProps, Blocker, BlockerFunction, BrowserRouter, type BrowserRouterProps, ClientActionFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, DataRouteObject, Router$1 as DataRouter, DataStrategyFunction, type EntryContext, Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, FormEncType, type FormProps, GetScrollRestorationKeyFunction, HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HistoryRouterProps, HydrationState, IndexRouteObject, type IndexRouteProps, InitialEntry, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, LazyRouteFunction, Link, type LinkProps, Links, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, MetaFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, NavigateOptions, type NavigateProps, Navigation, Action as NavigationType, Navigator, NonIndexRouteObject, Outlet, type OutletProps, PageLinkDescriptor, type ParamKeyValuePair, ParamParseKey, Params, PatchRoutesOnNavigationFunction, Path, PathMatch, PathPattern, type PathRouteProps, PrefetchPageLinks, RelativeRoutingType, type RequestHandler, Route, RouteMatch, RouteObject, type RouteProps, Router, RouterInit, type RouterProps, RouterProvider, type RouterProviderProps, RouterState, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, ShouldRevalidateFunction, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, To, UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, FrameworkContext as UNSAFE_FrameworkContext, MiddlewareEnabled as UNSAFE_MiddlewareEnabled,
|
|
2645
|
+
export { ActionFunction, ActionFunctionArgs, AppLoadContext, Await, type AwaitProps, Blocker, BlockerFunction, BrowserRouter, type BrowserRouterProps, ClientActionFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, DataRouteObject, Router$1 as DataRouter, DataStrategyFunction, type EntryContext, Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, FormEncType, type FormProps, GetScrollRestorationKeyFunction, HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HistoryRouterProps, HydrationState, IndexRouteObject, type IndexRouteProps, InitialEntry, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, LazyRouteFunction, Link, type LinkProps, Links, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, MetaFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, NavigateOptions, type NavigateProps, Navigation, Action as NavigationType, Navigator, NonIndexRouteObject, Outlet, type OutletProps, PageLinkDescriptor, type ParamKeyValuePair, ParamParseKey, Params, PatchRoutesOnNavigationFunction, Path, PathMatch, PathPattern, type PathRouteProps, PrefetchPageLinks, RelativeRoutingType, type RequestHandler, Route, RouteMatch, RouteObject, type RouteProps, Router, RouterInit, type RouterProps, RouterProvider, type RouterProviderProps, RouterState, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, ShouldRevalidateFunction, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, To, UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, FrameworkContext as UNSAFE_FrameworkContext, MiddlewareEnabled as UNSAFE_MiddlewareEnabled, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, mapRouteProperties as UNSAFE_mapRouteProperties, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, withComponentProps as UNSAFE_withComponentProps, withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps, withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps, type URLSearchParamsInit, createBrowserRouter, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, href, isCookie, isSession, renderMatches, type DecodeServerResponseFunction as unstable_DecodeServerResponseFunction, type EncodeActionFunction as unstable_EncodeActionFunction, HistoryRouter as unstable_HistoryRouter, unstable_InitialContext, RSCHydratedRouter as unstable_RSCHydratedRouter, RSCStaticRouter as unstable_RSCStaticRouter, unstable_RouterContextProvider, createCallServer as unstable_createCallServer, getServerStream as unstable_getServerStream, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useBlocker, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit, useViewTransitionState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-4303fcb98
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -79,9 +79,8 @@ __export(index_exports, {
|
|
|
79
79
|
UNSAFE_FrameworkContext: () => FrameworkContext,
|
|
80
80
|
UNSAFE_LocationContext: () => LocationContext,
|
|
81
81
|
UNSAFE_NavigationContext: () => NavigationContext,
|
|
82
|
+
UNSAFE_RSCDefaultRootErrorBoundary: () => RSCDefaultRootErrorBoundary,
|
|
82
83
|
UNSAFE_RemixErrorBoundary: () => RemixErrorBoundary,
|
|
83
|
-
UNSAFE_RootDefaultErrorBoundary: () => RemixRootDefaultErrorBoundary,
|
|
84
|
-
UNSAFE_RootDefaultHydrateFallback: () => RemixRootDefaultHydrateFallback,
|
|
85
84
|
UNSAFE_RouteContext: () => RouteContext,
|
|
86
85
|
UNSAFE_ServerMode: () => ServerMode,
|
|
87
86
|
UNSAFE_SingleFetchRedirectSymbol: () => SingleFetchRedirectSymbol,
|
|
@@ -8965,7 +8964,7 @@ function mergeRefs(...refs) {
|
|
|
8965
8964
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8966
8965
|
try {
|
|
8967
8966
|
if (isBrowser) {
|
|
8968
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8967
|
+
window.__reactRouterVersion = "0.0.0-experimental-4303fcb98";
|
|
8969
8968
|
}
|
|
8970
8969
|
} catch (e) {
|
|
8971
8970
|
}
|
|
@@ -11640,7 +11639,7 @@ function href(path, ...args) {
|
|
|
11640
11639
|
}
|
|
11641
11640
|
|
|
11642
11641
|
// lib/rsc/browser.tsx
|
|
11643
|
-
var
|
|
11642
|
+
var React15 = __toESM(require("react"));
|
|
11644
11643
|
var ReactDOM = __toESM(require("react-dom"));
|
|
11645
11644
|
|
|
11646
11645
|
// lib/dom/ssr/hydration.tsx
|
|
@@ -11669,6 +11668,116 @@ function getHydrationData(state, routes, getRouteInfo, location2, basename, isSp
|
|
|
11669
11668
|
return hydrationData;
|
|
11670
11669
|
}
|
|
11671
11670
|
|
|
11671
|
+
// lib/rsc/errorBoundaries.tsx
|
|
11672
|
+
var import_react = __toESM(require("react"));
|
|
11673
|
+
var RSCRouterGlobalErrorBoundary = class extends import_react.default.Component {
|
|
11674
|
+
constructor(props) {
|
|
11675
|
+
super(props);
|
|
11676
|
+
this.state = { error: null, location: props.location };
|
|
11677
|
+
}
|
|
11678
|
+
static getDerivedStateFromError(error) {
|
|
11679
|
+
return { error };
|
|
11680
|
+
}
|
|
11681
|
+
static getDerivedStateFromProps(props, state) {
|
|
11682
|
+
if (state.location !== props.location) {
|
|
11683
|
+
return { error: null, location: props.location };
|
|
11684
|
+
}
|
|
11685
|
+
return { error: state.error, location: state.location };
|
|
11686
|
+
}
|
|
11687
|
+
render() {
|
|
11688
|
+
if (this.state.error) {
|
|
11689
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
11690
|
+
RSCDefaultRootErrorBoundaryImpl,
|
|
11691
|
+
{
|
|
11692
|
+
error: this.state.error,
|
|
11693
|
+
renderAppShell: true
|
|
11694
|
+
}
|
|
11695
|
+
);
|
|
11696
|
+
} else {
|
|
11697
|
+
return this.props.children;
|
|
11698
|
+
}
|
|
11699
|
+
}
|
|
11700
|
+
};
|
|
11701
|
+
function ErrorWrapper({
|
|
11702
|
+
renderAppShell,
|
|
11703
|
+
title,
|
|
11704
|
+
children
|
|
11705
|
+
}) {
|
|
11706
|
+
if (!renderAppShell) {
|
|
11707
|
+
return children;
|
|
11708
|
+
}
|
|
11709
|
+
return /* @__PURE__ */ import_react.default.createElement("html", { lang: "en" }, /* @__PURE__ */ import_react.default.createElement("head", null, /* @__PURE__ */ import_react.default.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ import_react.default.createElement(
|
|
11710
|
+
"meta",
|
|
11711
|
+
{
|
|
11712
|
+
name: "viewport",
|
|
11713
|
+
content: "width=device-width,initial-scale=1,viewport-fit=cover"
|
|
11714
|
+
}
|
|
11715
|
+
), /* @__PURE__ */ import_react.default.createElement("title", null, title)), /* @__PURE__ */ import_react.default.createElement("body", null, /* @__PURE__ */ import_react.default.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children)));
|
|
11716
|
+
}
|
|
11717
|
+
function RSCDefaultRootErrorBoundaryImpl({
|
|
11718
|
+
error,
|
|
11719
|
+
renderAppShell
|
|
11720
|
+
}) {
|
|
11721
|
+
console.error(error);
|
|
11722
|
+
let heyDeveloper = /* @__PURE__ */ import_react.default.createElement(
|
|
11723
|
+
"script",
|
|
11724
|
+
{
|
|
11725
|
+
dangerouslySetInnerHTML: {
|
|
11726
|
+
__html: `
|
|
11727
|
+
console.log(
|
|
11728
|
+
"\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
11729
|
+
);
|
|
11730
|
+
`
|
|
11731
|
+
}
|
|
11732
|
+
}
|
|
11733
|
+
);
|
|
11734
|
+
if (isRouteErrorResponse(error)) {
|
|
11735
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
11736
|
+
ErrorWrapper,
|
|
11737
|
+
{
|
|
11738
|
+
renderAppShell,
|
|
11739
|
+
title: "Unhandled Thrown Response!"
|
|
11740
|
+
},
|
|
11741
|
+
/* @__PURE__ */ import_react.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
11742
|
+
ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
11743
|
+
);
|
|
11744
|
+
}
|
|
11745
|
+
let errorInstance;
|
|
11746
|
+
if (error instanceof Error) {
|
|
11747
|
+
errorInstance = error;
|
|
11748
|
+
} else {
|
|
11749
|
+
let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
|
|
11750
|
+
errorInstance = new Error(errorString);
|
|
11751
|
+
}
|
|
11752
|
+
return /* @__PURE__ */ import_react.default.createElement(ErrorWrapper, { renderAppShell, title: "Application Error!" }, /* @__PURE__ */ import_react.default.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"), /* @__PURE__ */ import_react.default.createElement(
|
|
11753
|
+
"pre",
|
|
11754
|
+
{
|
|
11755
|
+
style: {
|
|
11756
|
+
padding: "2rem",
|
|
11757
|
+
background: "hsla(10, 50%, 50%, 0.1)",
|
|
11758
|
+
color: "red",
|
|
11759
|
+
overflow: "auto"
|
|
11760
|
+
}
|
|
11761
|
+
},
|
|
11762
|
+
errorInstance.stack
|
|
11763
|
+
), heyDeveloper);
|
|
11764
|
+
}
|
|
11765
|
+
function RSCDefaultRootErrorBoundary({
|
|
11766
|
+
hasRootLayout
|
|
11767
|
+
}) {
|
|
11768
|
+
let error = useRouteError();
|
|
11769
|
+
if (hasRootLayout === void 0) {
|
|
11770
|
+
throw new Error("Missing 'hasRootLayout' prop");
|
|
11771
|
+
}
|
|
11772
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
11773
|
+
RSCDefaultRootErrorBoundaryImpl,
|
|
11774
|
+
{
|
|
11775
|
+
renderAppShell: !hasRootLayout,
|
|
11776
|
+
error
|
|
11777
|
+
}
|
|
11778
|
+
);
|
|
11779
|
+
}
|
|
11780
|
+
|
|
11672
11781
|
// lib/rsc/browser.tsx
|
|
11673
11782
|
function createCallServer({
|
|
11674
11783
|
decode: decode2,
|
|
@@ -11738,7 +11847,7 @@ function createCallServer({
|
|
|
11738
11847
|
lastMatch = match;
|
|
11739
11848
|
}
|
|
11740
11849
|
window.__router._internalSetStateDoNotUseOrYouWillBreakYourApp({});
|
|
11741
|
-
|
|
11850
|
+
React15.startTransition(() => {
|
|
11742
11851
|
window.__router._internalSetStateDoNotUseOrYouWillBreakYourApp({
|
|
11743
11852
|
loaderData: Object.assign(
|
|
11744
11853
|
{},
|
|
@@ -11950,18 +12059,27 @@ function RSCHydratedRouter({
|
|
|
11950
12059
|
routeDiscovery = "eager"
|
|
11951
12060
|
}) {
|
|
11952
12061
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
11953
|
-
let router =
|
|
12062
|
+
let router = React15.useMemo(
|
|
11954
12063
|
() => createRouterFromPayload({ decode: decode2, payload }),
|
|
11955
12064
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11956
12065
|
[]
|
|
11957
12066
|
);
|
|
11958
|
-
|
|
12067
|
+
React15.useLayoutEffect(() => {
|
|
11959
12068
|
if (!window.__routerInitialized) {
|
|
11960
12069
|
window.__routerInitialized = true;
|
|
11961
12070
|
window.__router.initialize();
|
|
11962
12071
|
}
|
|
11963
12072
|
}, []);
|
|
11964
|
-
|
|
12073
|
+
let [location2, setLocation] = React15.useState(router.state.location);
|
|
12074
|
+
React15.useLayoutEffect(
|
|
12075
|
+
() => router.subscribe((newState) => {
|
|
12076
|
+
if (newState.location !== location2) {
|
|
12077
|
+
setLocation(newState.location);
|
|
12078
|
+
}
|
|
12079
|
+
}),
|
|
12080
|
+
[router, location2]
|
|
12081
|
+
);
|
|
12082
|
+
React15.useEffect(() => {
|
|
11965
12083
|
if (routeDiscovery === "lazy" || // @ts-expect-error - TS doesn't know about this yet
|
|
11966
12084
|
window.navigator?.connection?.saveData === true) {
|
|
11967
12085
|
return;
|
|
@@ -12026,7 +12144,7 @@ function RSCHydratedRouter({
|
|
|
12026
12144
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
12027
12145
|
routeModules: {}
|
|
12028
12146
|
};
|
|
12029
|
-
return /* @__PURE__ */
|
|
12147
|
+
return /* @__PURE__ */ React15.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
12030
12148
|
}
|
|
12031
12149
|
function createRouteFromServerManifest(match, payload) {
|
|
12032
12150
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -12085,7 +12203,9 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
12085
12203
|
);
|
|
12086
12204
|
return await callSingleFetch(singleFetch);
|
|
12087
12205
|
}
|
|
12088
|
-
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) :
|
|
12206
|
+
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
12207
|
+
throw noActionDefinedError("action", match.id);
|
|
12208
|
+
},
|
|
12089
12209
|
path: match.path,
|
|
12090
12210
|
shouldRevalidate: match.shouldRevalidate,
|
|
12091
12211
|
// We always have a "loader" in this RSC world since even if we don't
|
|
@@ -12161,7 +12281,7 @@ function debounce2(callback, wait) {
|
|
|
12161
12281
|
}
|
|
12162
12282
|
|
|
12163
12283
|
// lib/rsc/server.ssr.tsx
|
|
12164
|
-
var
|
|
12284
|
+
var React16 = __toESM(require("react"));
|
|
12165
12285
|
|
|
12166
12286
|
// lib/rsc/html-stream/server.ts
|
|
12167
12287
|
var encoder2 = new TextEncoder();
|
|
@@ -12308,7 +12428,7 @@ async function routeRSCServerRequest({
|
|
|
12308
12428
|
function RSCStaticRouter({
|
|
12309
12429
|
getPayload
|
|
12310
12430
|
}) {
|
|
12311
|
-
const payload =
|
|
12431
|
+
const payload = React16.use(getPayload());
|
|
12312
12432
|
if (payload.type === "redirect") {
|
|
12313
12433
|
throw new Response(null, {
|
|
12314
12434
|
status: payload.status,
|
|
@@ -12387,7 +12507,7 @@ function RSCStaticRouter({
|
|
|
12387
12507
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
12388
12508
|
routeModules: {}
|
|
12389
12509
|
};
|
|
12390
|
-
return /* @__PURE__ */
|
|
12510
|
+
return /* @__PURE__ */ React16.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
|
|
12391
12511
|
StaticRouterProvider,
|
|
12392
12512
|
{
|
|
12393
12513
|
context,
|
|
@@ -12395,7 +12515,7 @@ function RSCStaticRouter({
|
|
|
12395
12515
|
hydrate: false,
|
|
12396
12516
|
nonce: payload.nonce
|
|
12397
12517
|
}
|
|
12398
|
-
)));
|
|
12518
|
+
))));
|
|
12399
12519
|
}
|
|
12400
12520
|
function isReactServerRequest(url) {
|
|
12401
12521
|
return url.pathname.endsWith(".rsc");
|
|
@@ -12509,9 +12629,8 @@ function deserializeErrors2(errors) {
|
|
|
12509
12629
|
UNSAFE_FrameworkContext,
|
|
12510
12630
|
UNSAFE_LocationContext,
|
|
12511
12631
|
UNSAFE_NavigationContext,
|
|
12632
|
+
UNSAFE_RSCDefaultRootErrorBoundary,
|
|
12512
12633
|
UNSAFE_RemixErrorBoundary,
|
|
12513
|
-
UNSAFE_RootDefaultErrorBoundary,
|
|
12514
|
-
UNSAFE_RootDefaultHydrateFallback,
|
|
12515
12634
|
UNSAFE_RouteContext,
|
|
12516
12635
|
UNSAFE_ServerMode,
|
|
12517
12636
|
UNSAFE_SingleFetchRedirectSymbol,
|