react-router 0.0.0-experimental-d431f1b65 → 0.0.0-experimental-e5dac68cb
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/{browser-Dr0PjLWi.d.mts → browser-Bh26Omrk.d.mts} +8 -0
- package/dist/development/{chunk-F37344ZN.mjs → chunk-USQXBNSR.mjs} +22 -41
- package/dist/development/dom-export.d.mts +2 -1
- package/dist/development/dom-export.js +1 -1
- package/dist/development/dom-export.mjs +2 -2
- package/dist/development/index.d.mts +3 -2
- package/dist/development/index.d.ts +8 -0
- package/dist/development/index.js +22 -41
- package/dist/development/index.mjs +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/rsc-export.d.mts +14 -3
- package/dist/development/rsc-export.d.ts +14 -3
- package/dist/development/rsc-export.js +96 -46
- package/dist/development/rsc-export.mjs +94 -44
- package/dist/production/{browser-Dr0PjLWi.d.mts → browser-Bh26Omrk.d.mts} +8 -0
- package/dist/production/{chunk-LTAAPV3T.mjs → chunk-SB3D2OAU.mjs} +22 -41
- package/dist/production/dom-export.d.mts +2 -1
- package/dist/production/dom-export.js +1 -1
- package/dist/production/dom-export.mjs +2 -2
- package/dist/production/index.d.mts +3 -2
- package/dist/production/index.d.ts +8 -0
- package/dist/production/index.js +22 -41
- package/dist/production/index.mjs +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/rsc-export.d.mts +14 -3
- package/dist/production/rsc-export.d.ts +14 -3
- package/dist/production/rsc-export.js +96 -46
- package/dist/production/rsc-export.mjs +94 -44
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var cookie = require('cookie');
|
|
4
|
+
var async_hooks = require('async_hooks');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var setCookieParser = require('set-cookie-parser');
|
|
6
7
|
|
|
@@ -25,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
25
26
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* react-router v0.0.0-experimental-
|
|
29
|
+
* react-router v0.0.0-experimental-e5dac68cb
|
|
29
30
|
*
|
|
30
31
|
* Copyright (c) Remix Software Inc.
|
|
31
32
|
*
|
|
@@ -2445,6 +2446,31 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
2445
2446
|
}
|
|
2446
2447
|
|
|
2447
2448
|
// lib/rsc/server.rsc.ts
|
|
2449
|
+
var ServerStorage = global.___reactRouterServerStorage___ ?? (global.___reactRouterServerStorage___ = new async_hooks.AsyncLocalStorage());
|
|
2450
|
+
var redirect2 = (...args) => {
|
|
2451
|
+
const response = redirect(...args);
|
|
2452
|
+
const ctx = ServerStorage.getStore();
|
|
2453
|
+
if (ctx) {
|
|
2454
|
+
ctx.redirect = response;
|
|
2455
|
+
}
|
|
2456
|
+
return response;
|
|
2457
|
+
};
|
|
2458
|
+
var redirectDocument2 = (...args) => {
|
|
2459
|
+
const response = redirectDocument(...args);
|
|
2460
|
+
const ctx = ServerStorage.getStore();
|
|
2461
|
+
if (ctx) {
|
|
2462
|
+
ctx.redirect = response;
|
|
2463
|
+
}
|
|
2464
|
+
return response;
|
|
2465
|
+
};
|
|
2466
|
+
var replace2 = (...args) => {
|
|
2467
|
+
const response = replace(...args);
|
|
2468
|
+
const ctx = ServerStorage.getStore();
|
|
2469
|
+
if (ctx) {
|
|
2470
|
+
ctx.redirect = response;
|
|
2471
|
+
}
|
|
2472
|
+
return response;
|
|
2473
|
+
};
|
|
2448
2474
|
async function matchRSCServerRequest({
|
|
2449
2475
|
decodeCallServer,
|
|
2450
2476
|
decodeFormAction,
|
|
@@ -2643,62 +2669,86 @@ async function generateRenderResponse(request, routes, isDataRequest, decodeCall
|
|
|
2643
2669
|
hasErrorBoundary: r.ErrorBoundary != null
|
|
2644
2670
|
})
|
|
2645
2671
|
});
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2672
|
+
let actionResult;
|
|
2673
|
+
const ctx = {};
|
|
2674
|
+
const result = await ServerStorage.run(
|
|
2675
|
+
ctx,
|
|
2676
|
+
() => handler.query(request, {
|
|
2677
|
+
skipLoaderErrorBubbling: isDataRequest,
|
|
2678
|
+
skipRevalidation: isSubmission,
|
|
2679
|
+
...routeIdsToLoad ? { filterMatchesToLoad: (m) => routeIdsToLoad.includes(m.route.id) } : null,
|
|
2680
|
+
async unstable_stream(_, query) {
|
|
2681
|
+
let formState;
|
|
2682
|
+
if (request.method === "POST") {
|
|
2683
|
+
let result2 = await processServerAction(
|
|
2684
|
+
request,
|
|
2685
|
+
decodeCallServer,
|
|
2686
|
+
decodeFormAction,
|
|
2687
|
+
decodeFormState,
|
|
2688
|
+
onError
|
|
2689
|
+
);
|
|
2690
|
+
if (isResponse(result2)) {
|
|
2691
|
+
return generateRedirectResponse(
|
|
2692
|
+
statusCode,
|
|
2693
|
+
result2,
|
|
2694
|
+
actionResult,
|
|
2695
|
+
generateResponse
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
actionResult = result2?.actionResult;
|
|
2699
|
+
formState = result2?.formState;
|
|
2700
|
+
request = result2?.revalidationRequest ?? request;
|
|
2663
2701
|
}
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2702
|
+
if (ctx.redirect) {
|
|
2703
|
+
return generateRedirectResponse(
|
|
2704
|
+
statusCode,
|
|
2705
|
+
ctx.redirect,
|
|
2706
|
+
actionResult,
|
|
2707
|
+
generateResponse
|
|
2708
|
+
);
|
|
2709
|
+
}
|
|
2710
|
+
let staticContext = await query(request);
|
|
2711
|
+
if (isResponse(staticContext)) {
|
|
2712
|
+
return generateRedirectResponse(
|
|
2713
|
+
statusCode,
|
|
2714
|
+
staticContext,
|
|
2715
|
+
actionResult,
|
|
2716
|
+
generateResponse
|
|
2717
|
+
);
|
|
2718
|
+
}
|
|
2719
|
+
return generateStaticContextResponse(
|
|
2720
|
+
routes,
|
|
2721
|
+
generateResponse,
|
|
2671
2722
|
statusCode,
|
|
2672
|
-
|
|
2673
|
-
|
|
2723
|
+
routeIdsToLoad,
|
|
2724
|
+
isDataRequest,
|
|
2725
|
+
isSubmission,
|
|
2726
|
+
actionResult,
|
|
2727
|
+
formState,
|
|
2728
|
+
staticContext
|
|
2674
2729
|
);
|
|
2675
2730
|
}
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
generateResponse,
|
|
2679
|
-
statusCode,
|
|
2680
|
-
routeIdsToLoad,
|
|
2681
|
-
isDataRequest,
|
|
2682
|
-
isSubmission,
|
|
2683
|
-
actionResult,
|
|
2684
|
-
formState,
|
|
2685
|
-
staticContext
|
|
2686
|
-
);
|
|
2687
|
-
}
|
|
2688
|
-
});
|
|
2731
|
+
})
|
|
2732
|
+
);
|
|
2689
2733
|
if (isRedirectResponse(result)) {
|
|
2690
|
-
return generateRedirectResponse(
|
|
2734
|
+
return generateRedirectResponse(
|
|
2735
|
+
statusCode,
|
|
2736
|
+
result,
|
|
2737
|
+
actionResult,
|
|
2738
|
+
generateResponse
|
|
2739
|
+
);
|
|
2691
2740
|
}
|
|
2692
2741
|
invariant2(isResponse(result), "Expected a response from query");
|
|
2693
2742
|
return result;
|
|
2694
2743
|
}
|
|
2695
|
-
function generateRedirectResponse(statusCode, response, generateResponse) {
|
|
2744
|
+
function generateRedirectResponse(statusCode, response, actionResult, generateResponse) {
|
|
2696
2745
|
let payload = {
|
|
2697
2746
|
type: "redirect",
|
|
2698
2747
|
location: response.headers.get("Location") || "",
|
|
2699
2748
|
reload: response.headers.get("X-Remix-Reload-Document") === "true",
|
|
2700
2749
|
replace: response.headers.get("X-Remix-Replace") === "true",
|
|
2701
|
-
status: response.status
|
|
2750
|
+
status: response.status,
|
|
2751
|
+
actionResult
|
|
2702
2752
|
};
|
|
2703
2753
|
return generateResponse({
|
|
2704
2754
|
statusCode,
|
|
@@ -2977,8 +3027,8 @@ exports.data = data;
|
|
|
2977
3027
|
exports.isCookie = isCookie;
|
|
2978
3028
|
exports.isSession = isSession;
|
|
2979
3029
|
exports.matchRoutes = matchRoutes;
|
|
2980
|
-
exports.redirect =
|
|
2981
|
-
exports.redirectDocument =
|
|
2982
|
-
exports.replace =
|
|
3030
|
+
exports.redirect = redirect2;
|
|
3031
|
+
exports.redirectDocument = redirectDocument2;
|
|
3032
|
+
exports.replace = replace2;
|
|
2983
3033
|
exports.unstable_createContext = unstable_createContext;
|
|
2984
3034
|
exports.unstable_matchRSCServerRequest = matchRSCServerRequest;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { serialize, parse } from 'cookie';
|
|
2
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { splitCookiesString } from 'set-cookie-parser';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* react-router v0.0.0-experimental-
|
|
7
|
+
* react-router v0.0.0-experimental-e5dac68cb
|
|
7
8
|
*
|
|
8
9
|
* Copyright (c) Remix Software Inc.
|
|
9
10
|
*
|
|
@@ -2423,6 +2424,31 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
2423
2424
|
}
|
|
2424
2425
|
|
|
2425
2426
|
// lib/rsc/server.rsc.ts
|
|
2427
|
+
var ServerStorage = global.___reactRouterServerStorage___ ?? (global.___reactRouterServerStorage___ = new AsyncLocalStorage());
|
|
2428
|
+
var redirect2 = (...args) => {
|
|
2429
|
+
const response = redirect(...args);
|
|
2430
|
+
const ctx = ServerStorage.getStore();
|
|
2431
|
+
if (ctx) {
|
|
2432
|
+
ctx.redirect = response;
|
|
2433
|
+
}
|
|
2434
|
+
return response;
|
|
2435
|
+
};
|
|
2436
|
+
var redirectDocument2 = (...args) => {
|
|
2437
|
+
const response = redirectDocument(...args);
|
|
2438
|
+
const ctx = ServerStorage.getStore();
|
|
2439
|
+
if (ctx) {
|
|
2440
|
+
ctx.redirect = response;
|
|
2441
|
+
}
|
|
2442
|
+
return response;
|
|
2443
|
+
};
|
|
2444
|
+
var replace2 = (...args) => {
|
|
2445
|
+
const response = replace(...args);
|
|
2446
|
+
const ctx = ServerStorage.getStore();
|
|
2447
|
+
if (ctx) {
|
|
2448
|
+
ctx.redirect = response;
|
|
2449
|
+
}
|
|
2450
|
+
return response;
|
|
2451
|
+
};
|
|
2426
2452
|
async function matchRSCServerRequest({
|
|
2427
2453
|
decodeCallServer,
|
|
2428
2454
|
decodeFormAction,
|
|
@@ -2621,62 +2647,86 @@ async function generateRenderResponse(request, routes, isDataRequest, decodeCall
|
|
|
2621
2647
|
hasErrorBoundary: r.ErrorBoundary != null
|
|
2622
2648
|
})
|
|
2623
2649
|
});
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2650
|
+
let actionResult;
|
|
2651
|
+
const ctx = {};
|
|
2652
|
+
const result = await ServerStorage.run(
|
|
2653
|
+
ctx,
|
|
2654
|
+
() => handler.query(request, {
|
|
2655
|
+
skipLoaderErrorBubbling: isDataRequest,
|
|
2656
|
+
skipRevalidation: isSubmission,
|
|
2657
|
+
...routeIdsToLoad ? { filterMatchesToLoad: (m) => routeIdsToLoad.includes(m.route.id) } : null,
|
|
2658
|
+
async unstable_stream(_, query) {
|
|
2659
|
+
let formState;
|
|
2660
|
+
if (request.method === "POST") {
|
|
2661
|
+
let result2 = await processServerAction(
|
|
2662
|
+
request,
|
|
2663
|
+
decodeCallServer,
|
|
2664
|
+
decodeFormAction,
|
|
2665
|
+
decodeFormState,
|
|
2666
|
+
onError
|
|
2667
|
+
);
|
|
2668
|
+
if (isResponse(result2)) {
|
|
2669
|
+
return generateRedirectResponse(
|
|
2670
|
+
statusCode,
|
|
2671
|
+
result2,
|
|
2672
|
+
actionResult,
|
|
2673
|
+
generateResponse
|
|
2674
|
+
);
|
|
2675
|
+
}
|
|
2676
|
+
actionResult = result2?.actionResult;
|
|
2677
|
+
formState = result2?.formState;
|
|
2678
|
+
request = result2?.revalidationRequest ?? request;
|
|
2641
2679
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2680
|
+
if (ctx.redirect) {
|
|
2681
|
+
return generateRedirectResponse(
|
|
2682
|
+
statusCode,
|
|
2683
|
+
ctx.redirect,
|
|
2684
|
+
actionResult,
|
|
2685
|
+
generateResponse
|
|
2686
|
+
);
|
|
2687
|
+
}
|
|
2688
|
+
let staticContext = await query(request);
|
|
2689
|
+
if (isResponse(staticContext)) {
|
|
2690
|
+
return generateRedirectResponse(
|
|
2691
|
+
statusCode,
|
|
2692
|
+
staticContext,
|
|
2693
|
+
actionResult,
|
|
2694
|
+
generateResponse
|
|
2695
|
+
);
|
|
2696
|
+
}
|
|
2697
|
+
return generateStaticContextResponse(
|
|
2698
|
+
routes,
|
|
2699
|
+
generateResponse,
|
|
2649
2700
|
statusCode,
|
|
2650
|
-
|
|
2651
|
-
|
|
2701
|
+
routeIdsToLoad,
|
|
2702
|
+
isDataRequest,
|
|
2703
|
+
isSubmission,
|
|
2704
|
+
actionResult,
|
|
2705
|
+
formState,
|
|
2706
|
+
staticContext
|
|
2652
2707
|
);
|
|
2653
2708
|
}
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
generateResponse,
|
|
2657
|
-
statusCode,
|
|
2658
|
-
routeIdsToLoad,
|
|
2659
|
-
isDataRequest,
|
|
2660
|
-
isSubmission,
|
|
2661
|
-
actionResult,
|
|
2662
|
-
formState,
|
|
2663
|
-
staticContext
|
|
2664
|
-
);
|
|
2665
|
-
}
|
|
2666
|
-
});
|
|
2709
|
+
})
|
|
2710
|
+
);
|
|
2667
2711
|
if (isRedirectResponse(result)) {
|
|
2668
|
-
return generateRedirectResponse(
|
|
2712
|
+
return generateRedirectResponse(
|
|
2713
|
+
statusCode,
|
|
2714
|
+
result,
|
|
2715
|
+
actionResult,
|
|
2716
|
+
generateResponse
|
|
2717
|
+
);
|
|
2669
2718
|
}
|
|
2670
2719
|
invariant2(isResponse(result), "Expected a response from query");
|
|
2671
2720
|
return result;
|
|
2672
2721
|
}
|
|
2673
|
-
function generateRedirectResponse(statusCode, response, generateResponse) {
|
|
2722
|
+
function generateRedirectResponse(statusCode, response, actionResult, generateResponse) {
|
|
2674
2723
|
let payload = {
|
|
2675
2724
|
type: "redirect",
|
|
2676
2725
|
location: response.headers.get("Location") || "",
|
|
2677
2726
|
reload: response.headers.get("X-Remix-Reload-Document") === "true",
|
|
2678
2727
|
replace: response.headers.get("X-Remix-Replace") === "true",
|
|
2679
|
-
status: response.status
|
|
2728
|
+
status: response.status,
|
|
2729
|
+
actionResult
|
|
2680
2730
|
};
|
|
2681
2731
|
return generateResponse({
|
|
2682
2732
|
statusCode,
|
|
@@ -2945,4 +2995,4 @@ function canDecodeWithFormData(contentType) {
|
|
|
2945
2995
|
return contentType.match(/\bapplication\/x-www-form-urlencoded\b/) || contentType.match(/\bmultipart\/form-data\b/);
|
|
2946
2996
|
}
|
|
2947
2997
|
|
|
2948
|
-
export { createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
2998
|
+
export { createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect2 as redirect, redirectDocument2 as redirectDocument, replace2 as replace, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { aR as RouteManifest, aS as ServerRouteModule, h as MiddlewareEnabled, a9 as unstable_RouterContextProvider, i as AppLoadContext, Y as LoaderFunctionArgs, y as ActionFunctionArgs, b as RouteModules, S as StaticHandlerContext, H as HydrationState, k as DataRouteObject, l as ClientLoaderFunction, T as To, aq as NavigateOptions, s as BlockerFunction, B as Blocker, aT as SerializeFrom, r as RelativeRoutingType, L as Location, _ as ParamParseKey, m as Path, a2 as PathPattern, a0 as PathMatch, a7 as UIMatch, p as Navigation, aa as Action, $ as Params, a as Router$1, c as RouteObject, e as IndexRouteObject, X as LazyRouteFunction, N as NonIndexRouteObject, R as RouterInit, F as FutureConfig$1, I as InitialEntry, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, ar as Navigator, at as RouteMatch, W as HTMLFormMethod, U as FormEncType, aB as PageLinkDescriptor, aU as History, n as GetScrollRestorationKeyFunction, o as Fetcher, au as ClientActionFunction, g as LinksFunction, M as MetaFunction, a5 as ShouldRevalidateFunction } from './route-data-C8_wxpLo.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
3
4
|
|
|
4
5
|
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
5
6
|
interface ServerRoute extends Route$1 {
|
|
@@ -2134,6 +2135,12 @@ declare function useViewTransitionState(to: To, opts?: {
|
|
|
2134
2135
|
relative?: RelativeRoutingType;
|
|
2135
2136
|
}): boolean;
|
|
2136
2137
|
|
|
2138
|
+
type ServerContext = {
|
|
2139
|
+
redirect?: Response;
|
|
2140
|
+
};
|
|
2141
|
+
declare global {
|
|
2142
|
+
var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
|
|
2143
|
+
}
|
|
2137
2144
|
type RenderedRoute = {
|
|
2138
2145
|
clientAction?: ClientActionFunction;
|
|
2139
2146
|
clientLoader?: ClientLoaderFunction;
|
|
@@ -2185,6 +2192,7 @@ type ServerRedirectPayload = {
|
|
|
2185
2192
|
location: string;
|
|
2186
2193
|
replace: boolean;
|
|
2187
2194
|
reload: boolean;
|
|
2195
|
+
actionResult?: Promise<unknown>;
|
|
2188
2196
|
};
|
|
2189
2197
|
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
|
|
2190
2198
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-e5dac68cb
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -4845,10 +4845,6 @@ var DataRouterContext = React.createContext(null);
|
|
|
4845
4845
|
DataRouterContext.displayName = "DataRouter";
|
|
4846
4846
|
var DataRouterStateContext = React.createContext(null);
|
|
4847
4847
|
DataRouterStateContext.displayName = "DataRouterState";
|
|
4848
|
-
var RSCRouterContext = React.createContext(false);
|
|
4849
|
-
function useIsRSCRouterContext() {
|
|
4850
|
-
return React.useContext(RSCRouterContext);
|
|
4851
|
-
}
|
|
4852
4848
|
var ViewTransitionContext = React.createContext({
|
|
4853
4849
|
isTransitioning: false
|
|
4854
4850
|
});
|
|
@@ -5022,7 +5018,6 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
|
5022
5018
|
// router loaded. We can help them understand how to avoid that.
|
|
5023
5019
|
`useRoutes() may be used only in the context of a <Router> component.`
|
|
5024
5020
|
);
|
|
5025
|
-
let isRSCRouterContext = useIsRSCRouterContext();
|
|
5026
5021
|
let { navigator } = React2.useContext(NavigationContext);
|
|
5027
5022
|
let { matches: parentMatches } = React2.useContext(RouteContext);
|
|
5028
5023
|
let routeMatch = parentMatches[parentMatches.length - 1];
|
|
@@ -5088,8 +5083,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
5088
5083
|
),
|
|
5089
5084
|
parentMatches,
|
|
5090
5085
|
dataRouterState,
|
|
5091
|
-
future
|
|
5092
|
-
isRSCRouterContext
|
|
5086
|
+
future
|
|
5093
5087
|
);
|
|
5094
5088
|
if (locationArg && renderedMatches) {
|
|
5095
5089
|
return /* @__PURE__ */ React2.createElement(
|
|
@@ -5180,7 +5174,7 @@ function RenderedRoute({ routeContext, match, children }) {
|
|
|
5180
5174
|
}
|
|
5181
5175
|
return /* @__PURE__ */ React2.createElement(RouteContext.Provider, { value: routeContext }, children);
|
|
5182
5176
|
}
|
|
5183
|
-
function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null
|
|
5177
|
+
function _renderMatches(matches, parentMatches = [], dataRouterState = null, future = null) {
|
|
5184
5178
|
if (matches == null) {
|
|
5185
5179
|
if (!dataRouterState) {
|
|
5186
5180
|
return null;
|
|
@@ -5270,9 +5264,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
|
|
|
5270
5264
|
} else {
|
|
5271
5265
|
children = outlet;
|
|
5272
5266
|
}
|
|
5273
|
-
if (isRSCRouterContext) {
|
|
5274
|
-
children = /* @__PURE__ */ React2.createElement(RedirectBoundary, null, children);
|
|
5275
|
-
}
|
|
5276
5267
|
return /* @__PURE__ */ React2.createElement(
|
|
5277
5268
|
RenderedRoute,
|
|
5278
5269
|
{
|
|
@@ -5299,19 +5290,6 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
|
|
|
5299
5290
|
) : getChildren();
|
|
5300
5291
|
}, null);
|
|
5301
5292
|
}
|
|
5302
|
-
var RedirectBoundary = class extends React2.Component {
|
|
5303
|
-
// If the error is Symbol.for("react-router.redirect"), keep rendering children.
|
|
5304
|
-
// If it's anything else, re-throw to bubble it up.
|
|
5305
|
-
static getDerivedStateFromError(error) {
|
|
5306
|
-
if (error === Symbol.for("react-router.redirect")) {
|
|
5307
|
-
return null;
|
|
5308
|
-
}
|
|
5309
|
-
throw error;
|
|
5310
|
-
}
|
|
5311
|
-
render() {
|
|
5312
|
-
return this.props.children;
|
|
5313
|
-
}
|
|
5314
|
-
};
|
|
5315
5293
|
function getDataRouterConsoleError(hookName) {
|
|
5316
5294
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
5317
5295
|
}
|
|
@@ -8804,7 +8782,7 @@ function mergeRefs(...refs) {
|
|
|
8804
8782
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8805
8783
|
try {
|
|
8806
8784
|
if (isBrowser) {
|
|
8807
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8785
|
+
window.__reactRouterVersion = "0.0.0-experimental-e5dac68cb";
|
|
8808
8786
|
}
|
|
8809
8787
|
} catch (e) {
|
|
8810
8788
|
}
|
|
@@ -11646,20 +11624,10 @@ function createCallServer({
|
|
|
11646
11624
|
window.location.href = payload.location;
|
|
11647
11625
|
return;
|
|
11648
11626
|
}
|
|
11649
|
-
let reject;
|
|
11650
|
-
const promise = new Promise((resolve, rejectFn) => {
|
|
11651
|
-
reject = rejectFn;
|
|
11652
|
-
});
|
|
11653
|
-
const unsubscribe = window.__router.subscribe(({ navigation }) => {
|
|
11654
|
-
if (navigation.state === "idle") {
|
|
11655
|
-
unsubscribe();
|
|
11656
|
-
reject(Symbol.for("react-router.redirect"));
|
|
11657
|
-
}
|
|
11658
|
-
});
|
|
11659
11627
|
window.__router.navigate(payload.location, {
|
|
11660
11628
|
replace: payload.replace
|
|
11661
11629
|
});
|
|
11662
|
-
return
|
|
11630
|
+
return payload.actionResult;
|
|
11663
11631
|
}
|
|
11664
11632
|
if (payload.type !== "action") {
|
|
11665
11633
|
throw new Error("Unexpected payload type");
|
|
@@ -12000,7 +11968,7 @@ function RSCHydratedRouter({
|
|
|
12000
11968
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
12001
11969
|
routeModules: {}
|
|
12002
11970
|
};
|
|
12003
|
-
return /* @__PURE__ */ React15.createElement(
|
|
11971
|
+
return /* @__PURE__ */ React15.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React15.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React15.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync })));
|
|
12004
11972
|
}
|
|
12005
11973
|
function createRouteFromServerManifest(match, payload) {
|
|
12006
11974
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -12098,10 +12066,23 @@ var nextPaths2 = /* @__PURE__ */ new Set();
|
|
|
12098
12066
|
var discoveredPathsMaxSize2 = 1e3;
|
|
12099
12067
|
var discoveredPaths2 = /* @__PURE__ */ new Set();
|
|
12100
12068
|
var URL_LIMIT2 = 7680;
|
|
12101
|
-
|
|
12069
|
+
function getManifestUrl(paths) {
|
|
12070
|
+
if (paths.length === 0) {
|
|
12071
|
+
return null;
|
|
12072
|
+
}
|
|
12073
|
+
if (paths.length === 1) {
|
|
12074
|
+
return new URL(`${paths[0]}.manifest`, window.location.origin);
|
|
12075
|
+
}
|
|
12102
12076
|
let basename = (window.__router.basename ?? "").replace(/^\/|\/$/g, "");
|
|
12103
12077
|
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
|
12104
12078
|
paths.sort().forEach((path) => url.searchParams.append("p", path));
|
|
12079
|
+
return url;
|
|
12080
|
+
}
|
|
12081
|
+
async function fetchAndApplyManifestPatches2(paths, decode2, fetchImplementation, signal) {
|
|
12082
|
+
let url = getManifestUrl(paths);
|
|
12083
|
+
if (url == null) {
|
|
12084
|
+
return;
|
|
12085
|
+
}
|
|
12105
12086
|
if (url.toString().length > URL_LIMIT2) {
|
|
12106
12087
|
nextPaths2.clear();
|
|
12107
12088
|
return;
|
|
@@ -12363,7 +12344,7 @@ function RSCStaticRouter({
|
|
|
12363
12344
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
12364
12345
|
routeModules: {}
|
|
12365
12346
|
};
|
|
12366
|
-
return /* @__PURE__ */ React16.createElement(
|
|
12347
|
+
return /* @__PURE__ */ React16.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React16.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React16.createElement(
|
|
12367
12348
|
StaticRouterProvider,
|
|
12368
12349
|
{
|
|
12369
12350
|
context,
|
|
@@ -12371,7 +12352,7 @@ function RSCStaticRouter({
|
|
|
12371
12352
|
hydrate: false,
|
|
12372
12353
|
nonce: payload.nonce
|
|
12373
12354
|
}
|
|
12374
|
-
)))
|
|
12355
|
+
)));
|
|
12375
12356
|
}
|
|
12376
12357
|
function isReactServerRequest(url) {
|
|
12377
12358
|
return url.pathname.endsWith(".rsc");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './browser-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './browser-Bh26Omrk.mjs';
|
|
3
3
|
import { R as RouterInit } from './route-data-C8_wxpLo.mjs';
|
|
4
|
+
import 'node:async_hooks';
|
|
4
5
|
|
|
5
6
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
7
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-e5dac68cb
|
|
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-SB3D2OAU.mjs";
|
|
30
30
|
|
|
31
31
|
// lib/dom-export/dom-router-provider.tsx
|
|
32
32
|
import * as React from "react";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { a as Router, b as RouteModules, D as DataStrategyFunction, L as Location, S as StaticHandlerContext, c as RouteObject, C as CreateStaticHandlerOptions$1, d as StaticHandler, F as FutureConfig, I as InitialEntry, H as HydrationState, e as IndexRouteObject, f as LoaderFunction, A as ActionFunction, M as MetaFunction, g as LinksFunction, N as NonIndexRouteObject, u as unstable_InitialContext, h as MiddlewareEnabled, i as AppLoadContext, E as Equal, j as RouterState, P as PatchRoutesOnNavigationFunction, k as DataRouteObject, l as ClientLoaderFunction, m as Path } from './route-data-C8_wxpLo.mjs';
|
|
2
2
|
export { y as ActionFunctionArgs, B as Blocker, s as BlockerFunction, au as ClientActionFunction, av as ClientActionFunctionArgs, aw as ClientLoaderFunctionArgs, ap as DataRouteMatch, z as DataStrategyFunctionArgs, J as DataStrategyMatch, K as DataStrategyResult, Q as ErrorResponse, o as Fetcher, U as FormEncType, V as FormMethod, aE as Future, G as GetScrollPositionFunction, n as GetScrollRestorationKeyFunction, W as HTMLFormMethod, ax as HeadersArgs, ay as HeadersFunction, aC as HtmlLinkDescriptor, af as IDLE_BLOCKER, ae as IDLE_FETCHER, ad as IDLE_NAVIGATION, X as LazyRouteFunction, aD as LinkDescriptor, Y as LoaderFunctionArgs, az as MetaArgs, aA as MetaDescriptor, aq as NavigateOptions, p as Navigation, q as NavigationStates, aa as NavigationType, ar as Navigator, aB as PageLinkDescriptor, _ as ParamParseKey, $ as Params, as as PatchRoutesOnNavigationFunctionArgs, a0 as PathMatch, a1 as PathParam, a2 as PathPattern, a3 as RedirectFunction, r as RelativeRoutingType, x as RevalidationState, at as RouteMatch, w as RouterFetchOptions, R as RouterInit, v as RouterNavigateOptions, t as RouterSubscriber, a5 as ShouldRevalidateFunction, a6 as ShouldRevalidateFunctionArgs, T as To, a7 as UIMatch, aK as UNSAFE_DataRouterContext, aL as UNSAFE_DataRouterStateContext, O as UNSAFE_DataWithResponseInit, aJ as UNSAFE_ErrorResponseImpl, aM as UNSAFE_FetchersContext, aN as UNSAFE_LocationContext, aO as UNSAFE_NavigationContext, aP as UNSAFE_RouteContext, aQ as UNSAFE_ViewTransitionContext, aG as UNSAFE_createBrowserHistory, aI as UNSAFE_createRouter, aH as UNSAFE_invariant, ab as createPath, ag as data, ah as generatePath, ai as isRouteErrorResponse, aj as matchPath, ak as matchRoutes, ac as parsePath, al as redirect, am as redirectDocument, an as replace, ao as resolvePath, Z as unstable_MiddlewareFunction, a4 as unstable_RouterContext, a9 as unstable_RouterContextProvider, aF as unstable_SerializesTo, a8 as unstable_createContext } from './route-data-C8_wxpLo.mjs';
|
|
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-
|
|
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-
|
|
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-Bh26Omrk.mjs';
|
|
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-Bh26Omrk.mjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
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';
|
|
10
10
|
export { R as Register } from './register-DeIo2iHO.mjs';
|
|
11
|
+
import 'node:async_hooks';
|
|
11
12
|
|
|
12
13
|
declare const SingleFetchRedirectSymbol: unique symbol;
|
|
13
14
|
declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction;
|
|
@@ -4,6 +4,7 @@ import * as React from 'react';
|
|
|
4
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
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
7
8
|
|
|
8
9
|
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
9
10
|
interface ServerRoute extends Route$1 {
|
|
@@ -2512,6 +2513,12 @@ type ToArgs<Params extends Record<string, string | undefined>> = Equal<Params, {
|
|
|
2512
2513
|
*/
|
|
2513
2514
|
declare function href<Path extends keyof Args>(path: Path, ...args: Args[Path]): string;
|
|
2514
2515
|
|
|
2516
|
+
type ServerContext = {
|
|
2517
|
+
redirect?: Response;
|
|
2518
|
+
};
|
|
2519
|
+
declare global {
|
|
2520
|
+
var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
|
|
2521
|
+
}
|
|
2515
2522
|
type RenderedRoute = {
|
|
2516
2523
|
clientAction?: ClientActionFunction;
|
|
2517
2524
|
clientLoader?: ClientLoaderFunction;
|
|
@@ -2563,6 +2570,7 @@ type ServerRedirectPayload = {
|
|
|
2563
2570
|
location: string;
|
|
2564
2571
|
replace: boolean;
|
|
2565
2572
|
reload: boolean;
|
|
2573
|
+
actionResult?: Promise<unknown>;
|
|
2566
2574
|
};
|
|
2567
2575
|
type ServerPayload = ServerRenderPayload | ServerManifestPayload | ServerActionPayload | ServerRedirectPayload;
|
|
2568
2576
|
|