react-router 8.3.1 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/dist/development/dom-export.d.ts +2 -1
- package/dist/development/dom-export.js +1 -1
- package/dist/development/index-react-server-client.js +2 -2
- package/dist/development/index-react-server.d.ts +601 -189
- package/dist/development/index-react-server.js +100 -48
- package/dist/development/index.d.ts +10 -9
- package/dist/development/index.js +6 -5
- package/dist/development/lib/actions.js +1 -1
- package/dist/development/lib/components.js +66 -10
- package/dist/development/lib/context.d.ts +19 -6
- package/dist/development/lib/context.js +11 -3
- package/dist/development/lib/dom/dom.d.ts +3 -0
- package/dist/development/lib/dom/dom.js +1 -1
- package/dist/development/lib/dom/global.d.ts +35 -0
- package/dist/development/lib/dom/lib.d.ts +34 -9
- package/dist/development/lib/dom/lib.js +30 -37
- package/dist/development/lib/dom/server.d.ts +6 -1
- package/dist/development/lib/dom/server.js +41 -15
- package/dist/development/lib/dom/ssr/components.js +26 -31
- package/dist/development/lib/dom/ssr/data.js +1 -1
- package/dist/development/lib/dom/ssr/entry.d.ts +13 -2
- package/dist/development/lib/dom/ssr/errorBoundaries.js +1 -1
- package/dist/development/lib/dom/ssr/fallback.js +1 -1
- package/dist/development/lib/dom/ssr/fog-of-war.d.ts +3 -2
- package/dist/development/lib/dom/ssr/fog-of-war.js +46 -22
- package/dist/development/lib/dom/ssr/hydration.d.ts +3 -1
- package/dist/development/lib/dom/ssr/hydration.js +6 -4
- package/dist/development/lib/dom/ssr/invariant.js +1 -1
- package/dist/development/lib/dom/ssr/links.js +1 -1
- package/dist/development/lib/dom/ssr/markup.js +5 -2
- package/dist/development/lib/dom/ssr/route-discovery.d.ts +120 -0
- package/dist/development/lib/dom/ssr/route-discovery.js +415 -0
- package/dist/development/lib/dom/ssr/routeModules.js +1 -1
- package/dist/development/lib/dom/ssr/routes-test-stub.js +2 -2
- package/dist/development/lib/dom/ssr/routes.d.ts +2 -2
- package/dist/development/lib/dom/ssr/routes.js +8 -8
- package/dist/development/lib/dom/ssr/server.js +4 -2
- package/dist/development/lib/dom/ssr/single-fetch.d.ts +28 -2
- package/dist/development/lib/dom/ssr/single-fetch.js +80 -71
- package/dist/development/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/development/lib/dom-export/hydrated-router.d.ts +28 -0
- package/dist/development/lib/dom-export/hydrated-router.js +33 -12
- package/dist/development/lib/errors.js +1 -1
- package/dist/development/lib/hooks.d.ts +3 -3
- package/dist/development/lib/hooks.js +52 -47
- package/dist/development/lib/href.js +1 -1
- package/dist/development/lib/router/history.js +1 -1
- package/dist/development/lib/router/instrumentation.js +1 -1
- package/dist/development/lib/router/matcher-route-pattern.d.ts +2 -0
- package/dist/development/lib/router/matcher-route-pattern.js +216 -0
- package/dist/development/lib/router/matcher-route-pattern.preload.d.ts +20 -0
- package/dist/development/lib/router/matcher-route-pattern.preload.js +36 -0
- package/dist/development/lib/router/matcher.d.ts +2 -0
- package/dist/development/lib/router/matcher.js +29 -0
- package/dist/development/lib/router/navigation.js +1 -1
- package/dist/development/lib/router/router.d.ts +19 -7
- package/dist/development/lib/router/router.js +235 -128
- package/dist/development/lib/router/url.js +1 -1
- package/dist/development/lib/router/utils.d.ts +30 -5
- package/dist/development/lib/router/utils.js +8 -5
- package/dist/development/lib/rsc/browser.js +3 -2
- package/dist/development/lib/rsc/errorBoundaries.js +1 -1
- package/dist/development/lib/rsc/html-stream/browser.js +1 -1
- package/dist/development/lib/rsc/html-stream/server.js +25 -15
- package/dist/development/lib/rsc/route-modules.js +1 -1
- package/dist/development/lib/rsc/server.rsc.d.ts +10 -2
- package/dist/development/lib/rsc/server.ssr.js +25 -21
- package/dist/development/lib/server-runtime/build.d.ts +14 -0
- package/dist/development/lib/server-runtime/cookies.js +1 -1
- package/dist/development/lib/server-runtime/crypto.js +1 -1
- package/dist/development/lib/server-runtime/data.js +1 -1
- package/dist/development/lib/server-runtime/dev.js +1 -1
- package/dist/development/lib/server-runtime/entry.js +1 -1
- package/dist/development/lib/server-runtime/errors.js +1 -1
- package/dist/development/lib/server-runtime/headers.js +1 -1
- package/dist/development/lib/server-runtime/invariant.js +1 -1
- package/dist/development/lib/server-runtime/mode.js +1 -1
- package/dist/development/lib/server-runtime/routeMatching.js +3 -4
- package/dist/development/lib/server-runtime/routes.d.ts +1 -1
- package/dist/development/lib/server-runtime/routes.js +1 -1
- package/dist/development/lib/server-runtime/server.js +18 -9
- package/dist/development/lib/server-runtime/serverHandoff.d.ts +17 -0
- package/dist/development/lib/server-runtime/serverHandoff.js +1 -1
- package/dist/development/lib/server-runtime/sessions/cookieStorage.js +1 -1
- package/dist/development/lib/server-runtime/sessions/memoryStorage.js +1 -1
- package/dist/development/lib/server-runtime/sessions.js +1 -1
- package/dist/development/lib/server-runtime/single-fetch.js +1 -1
- package/dist/development/lib/server-runtime/urls.js +1 -1
- package/dist/development/lib/server-runtime/warnings.js +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/route-data.d.ts +2 -2
- package/dist/development/lib/types/route-module-annotations.d.ts +1 -1
- package/dist/development/route-pattern.d.ts +3 -0
- package/dist/development/route-pattern.js +12 -0
- package/dist/development/vendor/turbo-stream-v2/flatten.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/unflatten.js +1 -1
- package/dist/development/vendor/turbo-stream-v2/utils.js +1 -1
- package/dist/production/dom-export.d.ts +2 -1
- package/dist/production/dom-export.js +1 -1
- package/dist/production/index-react-server-client.js +2 -2
- package/dist/production/index-react-server.d.ts +601 -189
- package/dist/production/index-react-server.js +100 -48
- package/dist/production/index.d.ts +10 -9
- package/dist/production/index.js +6 -5
- package/dist/production/lib/actions.js +1 -1
- package/dist/production/lib/components.js +66 -10
- package/dist/production/lib/context.d.ts +19 -6
- package/dist/production/lib/context.js +11 -3
- package/dist/production/lib/dom/dom.d.ts +3 -0
- package/dist/production/lib/dom/dom.js +1 -1
- package/dist/production/lib/dom/global.d.ts +35 -0
- package/dist/production/lib/dom/lib.d.ts +34 -9
- package/dist/production/lib/dom/lib.js +30 -37
- package/dist/production/lib/dom/server.d.ts +6 -1
- package/dist/production/lib/dom/server.js +41 -15
- package/dist/production/lib/dom/ssr/components.js +26 -31
- package/dist/production/lib/dom/ssr/data.js +1 -1
- package/dist/production/lib/dom/ssr/entry.d.ts +13 -2
- package/dist/production/lib/dom/ssr/errorBoundaries.js +1 -1
- package/dist/production/lib/dom/ssr/fallback.js +1 -1
- package/dist/production/lib/dom/ssr/fog-of-war.d.ts +3 -2
- package/dist/production/lib/dom/ssr/fog-of-war.js +46 -22
- package/dist/production/lib/dom/ssr/hydration.d.ts +3 -1
- package/dist/production/lib/dom/ssr/hydration.js +6 -4
- package/dist/production/lib/dom/ssr/invariant.js +1 -1
- package/dist/production/lib/dom/ssr/links.js +1 -1
- package/dist/production/lib/dom/ssr/markup.js +5 -2
- package/dist/production/lib/dom/ssr/route-discovery.d.ts +120 -0
- package/dist/production/lib/dom/ssr/route-discovery.js +415 -0
- package/dist/production/lib/dom/ssr/routeModules.js +1 -1
- package/dist/production/lib/dom/ssr/routes-test-stub.js +2 -2
- package/dist/production/lib/dom/ssr/routes.d.ts +2 -2
- package/dist/production/lib/dom/ssr/routes.js +8 -8
- package/dist/production/lib/dom/ssr/server.js +4 -2
- package/dist/production/lib/dom/ssr/single-fetch.d.ts +28 -2
- package/dist/production/lib/dom/ssr/single-fetch.js +80 -71
- package/dist/production/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/production/lib/dom-export/hydrated-router.d.ts +28 -0
- package/dist/production/lib/dom-export/hydrated-router.js +33 -12
- package/dist/production/lib/errors.js +1 -1
- package/dist/production/lib/hooks.d.ts +3 -3
- package/dist/production/lib/hooks.js +51 -46
- package/dist/production/lib/href.js +1 -1
- package/dist/production/lib/router/history.js +1 -1
- package/dist/production/lib/router/instrumentation.js +1 -1
- package/dist/production/lib/router/matcher-route-pattern.d.ts +2 -0
- package/dist/production/lib/router/matcher-route-pattern.js +216 -0
- package/dist/production/lib/router/matcher-route-pattern.preload.d.ts +20 -0
- package/dist/production/lib/router/matcher-route-pattern.preload.js +36 -0
- package/dist/production/lib/router/matcher.d.ts +2 -0
- package/dist/production/lib/router/matcher.js +29 -0
- package/dist/production/lib/router/navigation.js +1 -1
- package/dist/production/lib/router/router.d.ts +19 -7
- package/dist/production/lib/router/router.js +235 -128
- package/dist/production/lib/router/url.js +1 -1
- package/dist/production/lib/router/utils.d.ts +30 -5
- package/dist/production/lib/router/utils.js +8 -5
- package/dist/production/lib/rsc/browser.js +3 -2
- package/dist/production/lib/rsc/errorBoundaries.js +1 -1
- package/dist/production/lib/rsc/html-stream/browser.js +1 -1
- package/dist/production/lib/rsc/html-stream/server.js +25 -15
- package/dist/production/lib/rsc/route-modules.js +1 -1
- package/dist/production/lib/rsc/server.rsc.d.ts +10 -2
- package/dist/production/lib/rsc/server.ssr.js +25 -21
- package/dist/production/lib/server-runtime/build.d.ts +14 -0
- package/dist/production/lib/server-runtime/cookies.js +1 -1
- package/dist/production/lib/server-runtime/crypto.js +1 -1
- package/dist/production/lib/server-runtime/data.js +1 -1
- package/dist/production/lib/server-runtime/dev.js +1 -1
- package/dist/production/lib/server-runtime/entry.js +1 -1
- package/dist/production/lib/server-runtime/errors.js +1 -1
- package/dist/production/lib/server-runtime/headers.js +1 -1
- package/dist/production/lib/server-runtime/invariant.js +1 -1
- package/dist/production/lib/server-runtime/mode.js +1 -1
- package/dist/production/lib/server-runtime/routeMatching.js +3 -4
- package/dist/production/lib/server-runtime/routes.d.ts +1 -1
- package/dist/production/lib/server-runtime/routes.js +1 -1
- package/dist/production/lib/server-runtime/server.js +18 -9
- package/dist/production/lib/server-runtime/serverHandoff.d.ts +17 -0
- package/dist/production/lib/server-runtime/serverHandoff.js +1 -1
- package/dist/production/lib/server-runtime/sessions/cookieStorage.js +1 -1
- package/dist/production/lib/server-runtime/sessions/memoryStorage.js +1 -1
- package/dist/production/lib/server-runtime/sessions.js +1 -1
- package/dist/production/lib/server-runtime/single-fetch.js +1 -1
- package/dist/production/lib/server-runtime/urls.js +1 -1
- package/dist/production/lib/server-runtime/warnings.js +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/route-data.d.ts +2 -2
- package/dist/production/lib/types/route-module-annotations.d.ts +1 -1
- package/dist/production/route-pattern.d.ts +3 -0
- package/dist/production/route-pattern.js +12 -0
- package/dist/production/vendor/turbo-stream-v2/flatten.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/unflatten.js +1 -1
- package/dist/production/vendor/turbo-stream-v2/utils.js +1 -1
- package/docs/explanation/lazy-route-discovery.md +4 -0
- package/docs/explanation/sessions-and-cookies.md +108 -4
- package/docs/how-to/custom-fetch.md +218 -0
- package/docs/how-to/data-strategy.md +23 -1
- package/docs/how-to/fetchers.md +6 -1
- package/docs/how-to/middleware.md +4 -1
- package/docs/how-to/optimize-revalidation.md +178 -5
- package/docs/how-to/pre-rendering.md +23 -1
- package/docs/how-to/react-server-components.md +26 -3
- package/docs/how-to/resource-routes.md +3 -0
- package/docs/how-to/route-discovery.md +145 -0
- package/docs/how-to/spa.md +2 -0
- package/docs/how-to/view-transitions.md +80 -13
- package/docs/start/data/actions.md +2 -1
- package/docs/start/data/route-object.md +21 -6
- package/docs/start/framework/actions.md +4 -2
- package/docs/start/framework/navigating.md +5 -9
- package/docs/start/framework/rendering.md +37 -0
- package/docs/start/framework/route-module.md +32 -5
- package/docs/upgrading/future.md +68 -0
- package/package.json +19 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v8.
|
|
2
|
+
* react-router v8.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -207,7 +207,8 @@ const unsupportedLazyRouteObjectKeys = new Set([
|
|
|
207
207
|
"path",
|
|
208
208
|
"id",
|
|
209
209
|
"index",
|
|
210
|
-
"children"
|
|
210
|
+
"children",
|
|
211
|
+
"unstable_validateParams"
|
|
211
212
|
]);
|
|
212
213
|
function isUnsupportedLazyRouteObjectKey(key) {
|
|
213
214
|
return unsupportedLazyRouteObjectKeys.has(key);
|
|
@@ -219,7 +220,8 @@ const unsupportedLazyRouteFunctionKeys = new Set([
|
|
|
219
220
|
"id",
|
|
220
221
|
"index",
|
|
221
222
|
"middleware",
|
|
222
|
-
"children"
|
|
223
|
+
"children",
|
|
224
|
+
"unstable_validateParams"
|
|
223
225
|
]);
|
|
224
226
|
function isUnsupportedLazyRouteFunctionKey(key) {
|
|
225
227
|
return unsupportedLazyRouteFunctionKeys.has(key);
|
|
@@ -547,7 +549,7 @@ function compilePath(path, caseSensitive = false, end = true) {
|
|
|
547
549
|
return "(?:/([^\\/]*))?";
|
|
548
550
|
}
|
|
549
551
|
return "/([^\\/]+)";
|
|
550
|
-
}).replace(/\/([\
|
|
552
|
+
}).replace(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g, "(?:/$1)?");
|
|
551
553
|
if (path.endsWith("*")) {
|
|
552
554
|
params.push({ paramName: "*" });
|
|
553
555
|
regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
|
|
@@ -1040,6 +1042,23 @@ function getReadonlyContext(context) {
|
|
|
1040
1042
|
return { get: (ctx) => context.get(ctx) };
|
|
1041
1043
|
}
|
|
1042
1044
|
//#endregion
|
|
1045
|
+
//#region lib/router/matcher.ts
|
|
1046
|
+
var V6RegExMatcher = class {
|
|
1047
|
+
#routes = [];
|
|
1048
|
+
#branches = [];
|
|
1049
|
+
#basename;
|
|
1050
|
+
constructor(basename) {
|
|
1051
|
+
this.#basename = basename;
|
|
1052
|
+
}
|
|
1053
|
+
update(routes) {
|
|
1054
|
+
this.#routes = routes;
|
|
1055
|
+
this.#branches = flattenAndRankRoutes(routes);
|
|
1056
|
+
}
|
|
1057
|
+
match(locationArg, allowPartial = false) {
|
|
1058
|
+
return matchRoutesImpl(this.#routes, locationArg, this.#basename, allowPartial, this.#branches);
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
//#endregion
|
|
1043
1062
|
//#region lib/router/router.ts
|
|
1044
1063
|
const validMutationMethodsArr = [
|
|
1045
1064
|
"POST",
|
|
@@ -1058,6 +1077,14 @@ const redirectStatusCodes = new Set([
|
|
|
1058
1077
|
308
|
|
1059
1078
|
]);
|
|
1060
1079
|
const ResetLoaderDataSymbol = Symbol("ResetLoaderData");
|
|
1080
|
+
function createDataRouteMatcher(future, basename) {
|
|
1081
|
+
if (future.unstable_routePatternMatching) {
|
|
1082
|
+
let RoutePatternMatcher = void 0;
|
|
1083
|
+
invariant$1(RoutePatternMatcher, "You must call unstable_preloadRoutePattern() from \"react-router/route-pattern\" before enabling future.unstable_routePatternMatching.");
|
|
1084
|
+
return new RoutePatternMatcher(basename);
|
|
1085
|
+
}
|
|
1086
|
+
return new V6RegExMatcher(basename);
|
|
1087
|
+
}
|
|
1061
1088
|
/**
|
|
1062
1089
|
* Create a static handler to perform server-side data loading
|
|
1063
1090
|
*
|
|
@@ -1094,7 +1121,7 @@ function createStaticHandler(routes, opts) {
|
|
|
1094
1121
|
let basename = (opts ? opts.basename : null) || "/";
|
|
1095
1122
|
let _mapRouteProperties = opts?.mapRouteProperties;
|
|
1096
1123
|
let mapRouteProperties = _mapRouteProperties ? _mapRouteProperties : () => ({});
|
|
1097
|
-
({ ...opts?.future });
|
|
1124
|
+
let dataRouteMatcher = createDataRouteMatcher({ ...opts?.future }, basename);
|
|
1098
1125
|
if (opts?.instrumentations) {
|
|
1099
1126
|
let instrumentations = opts.instrumentations;
|
|
1100
1127
|
mapRouteProperties = (route) => {
|
|
@@ -1105,7 +1132,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1105
1132
|
};
|
|
1106
1133
|
}
|
|
1107
1134
|
let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, void 0, manifest);
|
|
1108
|
-
|
|
1135
|
+
dataRouteMatcher.update(dataRoutes);
|
|
1136
|
+
let match = (locationArg) => dataRouteMatcher.match(locationArg);
|
|
1109
1137
|
/**
|
|
1110
1138
|
* The query() method is intended for document requests, in which we want to
|
|
1111
1139
|
* call an optional action and potentially multiple loaders for all nested
|
|
@@ -1136,7 +1164,7 @@ function createStaticHandler(routes, opts) {
|
|
|
1136
1164
|
let normalizePathImpl = normalizePath || defaultNormalizePath;
|
|
1137
1165
|
let method = request.method;
|
|
1138
1166
|
let location = createLocation("", normalizePathImpl(request), null, "default");
|
|
1139
|
-
let matches =
|
|
1167
|
+
let matches = dataRouteMatcher.match(location);
|
|
1140
1168
|
requestContext = requestContext != null ? requestContext : new RouterContextProvider();
|
|
1141
1169
|
if (!isValidMethod(method) && method !== "HEAD") {
|
|
1142
1170
|
let error = getInternalRouterError(405, { method });
|
|
@@ -1150,7 +1178,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1150
1178
|
errors: { [route.id]: error },
|
|
1151
1179
|
statusCode: error.status,
|
|
1152
1180
|
loaderHeaders: {},
|
|
1153
|
-
actionHeaders: {}
|
|
1181
|
+
actionHeaders: {},
|
|
1182
|
+
_match: match
|
|
1154
1183
|
};
|
|
1155
1184
|
return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext;
|
|
1156
1185
|
} else if (!matches) {
|
|
@@ -1165,7 +1194,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1165
1194
|
errors: { [route.id]: error },
|
|
1166
1195
|
statusCode: error.status,
|
|
1167
1196
|
loaderHeaders: {},
|
|
1168
|
-
actionHeaders: {}
|
|
1197
|
+
actionHeaders: {},
|
|
1198
|
+
_match: match
|
|
1169
1199
|
};
|
|
1170
1200
|
return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext;
|
|
1171
1201
|
}
|
|
@@ -1188,7 +1218,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1188
1218
|
renderedStaticContext = {
|
|
1189
1219
|
location,
|
|
1190
1220
|
basename,
|
|
1191
|
-
...result
|
|
1221
|
+
...result,
|
|
1222
|
+
_match: match
|
|
1192
1223
|
};
|
|
1193
1224
|
return renderedStaticContext;
|
|
1194
1225
|
});
|
|
@@ -1214,7 +1245,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1214
1245
|
errors: { [skipLoaderErrorBubbling ? routeId : findNearestBoundary(matches, matches.find((m) => m.route.id === routeId || m.route.loader)?.route.id || routeId).route.id]: error },
|
|
1215
1246
|
statusCode: isRouteErrorResponse(error) ? error.status : 500,
|
|
1216
1247
|
actionHeaders: {},
|
|
1217
|
-
loaderHeaders: {}
|
|
1248
|
+
loaderHeaders: {},
|
|
1249
|
+
_match: match
|
|
1218
1250
|
};
|
|
1219
1251
|
return generateMiddlewareResponse(() => Promise.resolve(staticContext));
|
|
1220
1252
|
}
|
|
@@ -1231,7 +1263,8 @@ function createStaticHandler(routes, opts) {
|
|
|
1231
1263
|
return {
|
|
1232
1264
|
location,
|
|
1233
1265
|
basename,
|
|
1234
|
-
...result
|
|
1266
|
+
...result,
|
|
1267
|
+
_match: match
|
|
1235
1268
|
};
|
|
1236
1269
|
}
|
|
1237
1270
|
/**
|
|
@@ -1264,7 +1297,7 @@ function createStaticHandler(routes, opts) {
|
|
|
1264
1297
|
let normalizePathImpl = normalizePath || defaultNormalizePath;
|
|
1265
1298
|
let method = request.method;
|
|
1266
1299
|
let location = createLocation("", normalizePathImpl(request), null, "default");
|
|
1267
|
-
let matches =
|
|
1300
|
+
let matches = dataRouteMatcher.match(location);
|
|
1268
1301
|
requestContext = requestContext != null ? requestContext : new RouterContextProvider();
|
|
1269
1302
|
if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") throw getInternalRouterError(405, { method });
|
|
1270
1303
|
else if (!matches) throw getInternalRouterError(404, { pathname: location.pathname });
|
|
@@ -1426,7 +1459,7 @@ function createStaticHandler(routes, opts) {
|
|
|
1426
1459
|
};
|
|
1427
1460
|
}
|
|
1428
1461
|
async function callDataStrategy(request, location, matches, isRouteRequest, requestContext, dataStrategy) {
|
|
1429
|
-
let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, request, location, matches, null, requestContext, true);
|
|
1462
|
+
let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, request, location, matches, null, "static", requestContext, true);
|
|
1430
1463
|
let dataResults = {};
|
|
1431
1464
|
await Promise.all(matches.map(async (match) => {
|
|
1432
1465
|
if (!(match.route.id in results)) return;
|
|
@@ -1445,7 +1478,7 @@ function createStaticHandler(routes, opts) {
|
|
|
1445
1478
|
}
|
|
1446
1479
|
return {
|
|
1447
1480
|
dataRoutes,
|
|
1448
|
-
|
|
1481
|
+
match,
|
|
1449
1482
|
query,
|
|
1450
1483
|
queryRoute
|
|
1451
1484
|
};
|
|
@@ -1789,7 +1822,7 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, p
|
|
|
1789
1822
|
return getDataStrategyMatch(mapRouteProperties, manifest, request, path, getRoutePattern(matches), match, lazyRoutePropertiesToSkip, scopedContext, true, shouldRevalidateArgs);
|
|
1790
1823
|
});
|
|
1791
1824
|
}
|
|
1792
|
-
async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
1825
|
+
async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fetcherKey, initiator, scopedContext, isStaticHandler, navigationType = null) {
|
|
1793
1826
|
if (matches.some((m) => m._lazyPromises?.middleware)) await Promise.all(matches.map((m) => m._lazyPromises?.middleware));
|
|
1794
1827
|
let dataStrategyArgs = {
|
|
1795
1828
|
request,
|
|
@@ -1797,7 +1830,9 @@ async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fe
|
|
|
1797
1830
|
pattern: getRoutePattern(matches),
|
|
1798
1831
|
params: matches[0].params,
|
|
1799
1832
|
context: scopedContext,
|
|
1800
|
-
matches
|
|
1833
|
+
matches,
|
|
1834
|
+
unstable_initiator: initiator,
|
|
1835
|
+
unstable_navigationType: initiator === "navigation" ? navigationType : null
|
|
1801
1836
|
};
|
|
1802
1837
|
let runClientMiddleware = isStaticHandler ? () => {
|
|
1803
1838
|
throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`");
|
|
@@ -2337,6 +2372,13 @@ const Await = (async ({ children, resolve, errorElement }) => {
|
|
|
2337
2372
|
* encoding an {@link unstable_RSCPayload} for consumption by an [RSC](https://react.dev/reference/rsc/server-components)
|
|
2338
2373
|
* enabled client router.
|
|
2339
2374
|
*
|
|
2375
|
+
* Treat every React Server Function as a public endpoint. Server Functions are
|
|
2376
|
+
* not inherently associated with a route. Any route middleware that runs is
|
|
2377
|
+
* selected from the URL used to call a Server Function, but the client controls
|
|
2378
|
+
* both the Server Function identifier and the URL. Perform all access control
|
|
2379
|
+
* checks within each Server Function, or use a route action for
|
|
2380
|
+
* middleware-driven access control.
|
|
2381
|
+
*
|
|
2340
2382
|
* @example
|
|
2341
2383
|
* import {
|
|
2342
2384
|
* createTemporaryReferenceSet,
|
|
@@ -2404,7 +2446,12 @@ const Await = (async ({ children, resolve, errorElement }) => {
|
|
|
2404
2446
|
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
|
|
2405
2447
|
* data for hydration.
|
|
2406
2448
|
*/
|
|
2407
|
-
async function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, routeDiscovery, loadServerAction, decodeAction, decodeFormState, clientVersion, onError, request, routes, generateResponse }) {
|
|
2449
|
+
async function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, routeDiscovery, loadServerAction, decodeAction, decodeFormState, clientVersion, onError, request, routes, generateResponse: encodeResponse }) {
|
|
2450
|
+
let generateResponse = (match, options) => {
|
|
2451
|
+
let response = encodeResponse(match, options);
|
|
2452
|
+
response.headers.set("Content-Type", "text/x-component");
|
|
2453
|
+
return response;
|
|
2454
|
+
};
|
|
2408
2455
|
let url = new URL(request.url);
|
|
2409
2456
|
basename = basename || "/";
|
|
2410
2457
|
let normalizedPath = url.pathname;
|
|
@@ -2424,11 +2471,12 @@ async function matchRSCServerRequest({ allowedActionOrigins, createTemporaryRefe
|
|
|
2424
2471
|
const requestUrl = new URL(request.url);
|
|
2425
2472
|
if (isManifestRequest(requestUrl)) return await generateManifestResponse(routes, basename, request, generateResponse, temporaryReferences, routeDiscovery, clientVersion);
|
|
2426
2473
|
let isDataRequest = isReactServerRequest(requestUrl);
|
|
2427
|
-
let
|
|
2474
|
+
let staticHandler = createStaticHandler(routes, { basename });
|
|
2475
|
+
let matches = staticHandler.match(url.pathname);
|
|
2428
2476
|
if (matches) await Promise.all(matches.map((m) => explodeLazyRoute(m.route)));
|
|
2429
2477
|
const leafMatch = matches?.[matches.length - 1];
|
|
2430
|
-
if (!isDataRequest && leafMatch && !leafMatch.route.Component && !leafMatch.route.ErrorBoundary) return generateResourceResponse(routerRequest,
|
|
2431
|
-
let response = await generateRenderResponse(routerRequest,
|
|
2478
|
+
if (!isDataRequest && leafMatch && !leafMatch.route.Component && !leafMatch.route.ErrorBoundary) return generateResourceResponse(routerRequest, staticHandler, leafMatch.route.id, requestContext, onError);
|
|
2479
|
+
let response = await generateRenderResponse(routerRequest, staticHandler, basename, isDataRequest, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, generateResponse, temporaryReferences, allowedActionOrigins, routeDiscovery, clientVersion);
|
|
2432
2480
|
response.headers.set("X-Remix-Response", "yes");
|
|
2433
2481
|
return response;
|
|
2434
2482
|
}
|
|
@@ -2461,9 +2509,10 @@ async function generateManifestResponse(routes, basename, request, generateRespo
|
|
|
2461
2509
|
}
|
|
2462
2510
|
let pathParam = url.searchParams.get("paths");
|
|
2463
2511
|
let pathnames = pathParam ? pathParam.split(",").filter(Boolean) : [url.pathname.replace(/\.manifest$/, "")];
|
|
2512
|
+
let staticHandler = routes.length > 0 ? createStaticHandler(routes, { basename }) : void 0;
|
|
2464
2513
|
let routeIds = /* @__PURE__ */ new Set();
|
|
2465
|
-
let matchedRoutes = pathnames.flatMap((pathname) => {
|
|
2466
|
-
let pathnameMatches =
|
|
2514
|
+
let matchedRoutes = staticHandler ? pathnames.flatMap((pathname) => {
|
|
2515
|
+
let pathnameMatches = staticHandler.match(pathname);
|
|
2467
2516
|
return pathnameMatches?.map((m, i) => ({
|
|
2468
2517
|
...m.route,
|
|
2469
2518
|
parentId: pathnameMatches[i - 1]?.route.id
|
|
@@ -2474,10 +2523,10 @@ async function generateManifestResponse(routes, basename, request, generateRespo
|
|
|
2474
2523
|
return true;
|
|
2475
2524
|
}
|
|
2476
2525
|
return false;
|
|
2477
|
-
});
|
|
2526
|
+
}) : [];
|
|
2478
2527
|
let payload = {
|
|
2479
2528
|
type: "manifest",
|
|
2480
|
-
patches: Promise.all([...matchedRoutes.map((route) => getManifestRoute(route)), getAdditionalRoutePatches(pathnames,
|
|
2529
|
+
patches: Promise.all([...matchedRoutes.map((route) => getManifestRoute(route)), staticHandler ? getAdditionalRoutePatches(pathnames, staticHandler, Array.from(routeIds)) : Promise.resolve([])]).then((r) => r.flat(1))
|
|
2481
2530
|
};
|
|
2482
2531
|
return generateResponse({
|
|
2483
2532
|
statusCode: 200,
|
|
@@ -2547,20 +2596,20 @@ async function processServerAction(request, basename, decodeReply, loadServerAct
|
|
|
2547
2596
|
}
|
|
2548
2597
|
}
|
|
2549
2598
|
}
|
|
2550
|
-
async function generateResourceResponse(request,
|
|
2599
|
+
async function generateResourceResponse(request, staticHandler, routeId, requestContext, onError) {
|
|
2551
2600
|
try {
|
|
2552
|
-
return await
|
|
2601
|
+
return tagResourceResponse(await staticHandler.queryRoute(request, {
|
|
2553
2602
|
routeId,
|
|
2554
2603
|
requestContext,
|
|
2555
2604
|
async generateMiddlewareResponse(queryRoute) {
|
|
2556
2605
|
try {
|
|
2557
|
-
return
|
|
2606
|
+
return tagResourceResponse(await queryRoute(request));
|
|
2558
2607
|
} catch (error) {
|
|
2559
2608
|
return generateErrorResponse(error);
|
|
2560
2609
|
}
|
|
2561
2610
|
},
|
|
2562
2611
|
normalizePath: (r) => getNormalizedPath(r)
|
|
2563
|
-
});
|
|
2612
|
+
}));
|
|
2564
2613
|
} catch (error) {
|
|
2565
2614
|
return generateErrorResponse(error);
|
|
2566
2615
|
}
|
|
@@ -2578,24 +2627,23 @@ async function generateResourceResponse(request, routes, basename, routeId, requ
|
|
|
2578
2627
|
onError?.(error);
|
|
2579
2628
|
response = new Response("Internal Server Error", { status: 500 });
|
|
2580
2629
|
}
|
|
2581
|
-
return
|
|
2582
|
-
}
|
|
2583
|
-
function generateResourceResponse(response) {
|
|
2584
|
-
const headers = new Headers(response.headers);
|
|
2585
|
-
headers.set("React-Router-Resource", "true");
|
|
2586
|
-
return new Response(response.body, {
|
|
2587
|
-
status: response.status,
|
|
2588
|
-
statusText: response.statusText,
|
|
2589
|
-
headers
|
|
2590
|
-
});
|
|
2630
|
+
return tagResourceResponse(response);
|
|
2591
2631
|
}
|
|
2592
2632
|
}
|
|
2593
|
-
|
|
2633
|
+
function tagResourceResponse(response) {
|
|
2634
|
+
const headers = new Headers(response.headers);
|
|
2635
|
+
headers.set("React-Router-Resource", "true");
|
|
2636
|
+
return new Response(response.body, {
|
|
2637
|
+
status: response.status,
|
|
2638
|
+
statusText: response.statusText,
|
|
2639
|
+
headers
|
|
2640
|
+
});
|
|
2641
|
+
}
|
|
2642
|
+
async function generateRenderResponse(request, staticHandler, basename, isDataRequest, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, generateResponse, temporaryReferences, allowedActionOrigins, routeDiscovery, clientVersion) {
|
|
2594
2643
|
let statusCode = 200;
|
|
2595
2644
|
let url = new URL(request.url);
|
|
2596
2645
|
let isSubmission = isMutationMethod(request.method);
|
|
2597
2646
|
let routeIdsToLoad = !isSubmission && url.searchParams.has("_routes") ? url.searchParams.get("_routes").split(",") : null;
|
|
2598
|
-
const staticHandler = createStaticHandler(routes, { basename });
|
|
2599
2647
|
let actionResult;
|
|
2600
2648
|
const ctx = {
|
|
2601
2649
|
request,
|
|
@@ -2643,11 +2691,12 @@ async function generateRenderResponse(request, routes, basename, isDataRequest,
|
|
|
2643
2691
|
staticContext.errors[staticContext.matches[0].route.id] = potentialCSRFAttackError;
|
|
2644
2692
|
staticContext.statusCode = 400;
|
|
2645
2693
|
}
|
|
2646
|
-
return generateStaticContextResponse(
|
|
2694
|
+
return generateStaticContextResponse(staticHandler, basename, generateResponse, statusCode, routeIdsToLoad, isDataRequest, isSubmission, actionResult, formState, staticContext, temporaryReferences, skipRevalidation, ctx.redirect?.headers, routeDiscovery, clientVersion);
|
|
2647
2695
|
}
|
|
2648
2696
|
}));
|
|
2649
2697
|
if (isRedirectResponse(result)) return generateRedirectResponse(result, actionResult, basename, isDataRequest, generateResponse, temporaryReferences, ctx.redirect?.headers);
|
|
2650
2698
|
invariant(isResponse(result), "Expected a response from query");
|
|
2699
|
+
if (result.headers.get("Content-Type")?.split(";")[0].trim().toLowerCase() !== "text/x-component") return tagResourceResponse(result);
|
|
2651
2700
|
return result;
|
|
2652
2701
|
}
|
|
2653
2702
|
function generateRedirectResponse(response, actionResult, basename, isDataRequest, generateResponse, temporaryReferences, sideEffectRedirectHeaders) {
|
|
@@ -2677,7 +2726,7 @@ function generateRedirectResponse(response, actionResult, basename, isDataReques
|
|
|
2677
2726
|
onError: defaultOnError
|
|
2678
2727
|
});
|
|
2679
2728
|
}
|
|
2680
|
-
async function generateStaticContextResponse(
|
|
2729
|
+
async function generateStaticContextResponse(staticHandler, basename, generateResponse, statusCode, routeIdsToLoad, isDataRequest, isSubmission, actionResult, formState, staticContext, temporaryReferences, skipRevalidation, sideEffectRedirectHeaders, routeDiscovery, clientVersion) {
|
|
2681
2730
|
statusCode = staticContext.statusCode ?? statusCode;
|
|
2682
2731
|
if (staticContext.errors) staticContext.errors = Object.fromEntries(Object.entries(staticContext.errors).map(([key, error]) => [key, isRouteErrorResponse(error) ? Object.fromEntries(Object.entries(error)) : error]));
|
|
2683
2732
|
staticContext.matches.forEach((m) => {
|
|
@@ -2698,7 +2747,7 @@ async function generateStaticContextResponse(routes, basename, generateResponse,
|
|
|
2698
2747
|
location: staticContext.location,
|
|
2699
2748
|
formState
|
|
2700
2749
|
};
|
|
2701
|
-
const renderPayloadPromise = () => getRenderPayload(baseRenderPayload,
|
|
2750
|
+
const renderPayloadPromise = () => getRenderPayload(baseRenderPayload, staticHandler, basename, routeIdsToLoad, isDataRequest, staticContext, routeDiscovery);
|
|
2702
2751
|
let payload;
|
|
2703
2752
|
if (actionResult) payload = {
|
|
2704
2753
|
type: "action",
|
|
@@ -2720,7 +2769,8 @@ async function generateStaticContextResponse(routes, basename, generateResponse,
|
|
|
2720
2769
|
onError: defaultOnError
|
|
2721
2770
|
});
|
|
2722
2771
|
}
|
|
2723
|
-
async function getRenderPayload(baseRenderPayload,
|
|
2772
|
+
async function getRenderPayload(baseRenderPayload, staticHandler, basename, routeIdsToLoad, isDataRequest, staticContext, routeDiscovery) {
|
|
2773
|
+
let routes = staticHandler.dataRoutes;
|
|
2724
2774
|
let deepestRenderedRouteIdx = staticContext.matches.length - 1;
|
|
2725
2775
|
let parentIds = {};
|
|
2726
2776
|
staticContext.matches.forEach((m, i) => {
|
|
@@ -2738,7 +2788,9 @@ async function getRenderPayload(baseRenderPayload, routes, basename, routeIdsToL
|
|
|
2738
2788
|
parentId
|
|
2739
2789
|
});
|
|
2740
2790
|
}));
|
|
2741
|
-
let patches
|
|
2791
|
+
let patches;
|
|
2792
|
+
if (routeDiscovery?.mode === "initial" && !isDataRequest) patches = getAllRoutePatches(routes, basename).then((patches) => patches.filter((patch) => !staticContext.matches.some((m) => m.route.id === patch.id)));
|
|
2793
|
+
else patches = getAdditionalRoutePatches(getPathsWithAncestors([staticContext.location.pathname]), staticHandler, staticContext.matches.map((m) => m.route.id));
|
|
2742
2794
|
return {
|
|
2743
2795
|
...baseRenderPayload,
|
|
2744
2796
|
matches: await matchesPromise,
|
|
@@ -2842,13 +2894,13 @@ async function getAllRoutePatches(routes, basename) {
|
|
|
2842
2894
|
for (let route of routes) await traverse(route, void 0);
|
|
2843
2895
|
return patches.filter((p) => !!p.parentId);
|
|
2844
2896
|
}
|
|
2845
|
-
async function getAdditionalRoutePatches(pathnames,
|
|
2897
|
+
async function getAdditionalRoutePatches(pathnames, staticHandler, matchedRouteIds) {
|
|
2846
2898
|
let patchRouteMatches = /* @__PURE__ */ new Map();
|
|
2847
2899
|
let matchedPaths = /* @__PURE__ */ new Set();
|
|
2848
2900
|
for (const pathname of pathnames) {
|
|
2849
2901
|
if (matchedPaths.has(pathname)) continue;
|
|
2850
2902
|
matchedPaths.add(pathname);
|
|
2851
|
-
let matches =
|
|
2903
|
+
let matches = staticHandler.match(pathname) || [];
|
|
2852
2904
|
matches.forEach((m, i) => {
|
|
2853
2905
|
if (patchRouteMatches.get(m.route.id)) return;
|
|
2854
2906
|
patchRouteMatches.set(m.route.id, {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import { Action, InitialEntry, Location, Path, To, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, invariant, parsePath } from "./lib/router/history.js";
|
|
3
|
-
import { ActionFunction, ActionFunctionArgs, BaseRouteObject, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, DataWithResponseInit, ErrorResponse, ErrorResponseImpl, FormEncType, FormMethod, HTMLFormMethod, IndexRouteObject, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, MiddlewareFunction, NonIndexRouteObject, ParamParseKey, Params, PatchRoutesOnNavigationFunction, PatchRoutesOnNavigationFunctionArgs, PathMatch, PathParam, PathPattern, RedirectFunction, RouteMatch, RouteObject, RouterContext, RouterContextProvider, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, UIMatch, createContext, data, defaultMapRouteProperties, generatePath, isRouteErrorResponse, matchPath, matchRoutes, redirect, redirectDocument, replace, resolvePath } from "./lib/router/utils.js";
|
|
3
|
+
import { ActionFunction, ActionFunctionArgs, BaseRouteObject, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyInitiator, DataStrategyMatch, DataStrategyResult, DataWithResponseInit, ErrorResponse, ErrorResponseImpl, FormEncType, FormMethod, HTMLFormMethod, IndexRouteObject, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, MiddlewareFunction, NonIndexRouteObject, ParamParseKey, Params, PatchRoutesOnNavigationFunction, PatchRoutesOnNavigationFunctionArgs, PathMatch, PathParam, PathPattern, RedirectFunction, RouteMatch, RouteObject, RouterContext, RouterContextProvider, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, UIMatch, createContext, data, defaultMapRouteProperties, generatePath, isRouteErrorResponse, matchPath, matchRoutes, redirect, redirectDocument, replace, resolvePath } from "./lib/router/utils.js";
|
|
4
4
|
import { Blocker, BlockerFunction, Fetcher, GetScrollPositionFunction, GetScrollRestorationKeyFunction, HydrationState, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Navigation, NavigationStates, RelativeRoutingType, RevalidationState, Router, RouterFetchOptions, RouterInit, RouterNavigateOptions, RouterState, RouterSubscriber, StaticHandler, StaticHandlerContext, createRouter, createStaticHandler } from "./lib/router/router.js";
|
|
5
|
-
import { HtmlLinkDescriptor, LinkDescriptor, PageLinkDescriptor } from "./lib/router/links.js";
|
|
6
5
|
import { Await, AwaitProps, ClientOnErrorFunction, IndexRouteProps, LayoutRouteProps, MemoryRouter, MemoryRouterOpts, MemoryRouterProps, Navigate, NavigateProps, Outlet, OutletProps, PathRouteProps, Route, RouteProps, Router as Router$1, RouterProps, RouterProvider, RouterProviderProps, Routes, RoutesProps, WithComponentProps, WithErrorBoundaryProps, WithHydrateFallbackProps, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, hydrationRouteProperties, renderMatches, withComponentProps, withErrorBoundaryProps, withHydrateFallbackProps } from "./lib/components.js";
|
|
7
|
-
import { AwaitContextProvider, DataRouterContext, DataRouterStateContext, FetchersContext, LocationContext, NavigateOptions, NavigationContext, Navigator, RouteContext, ViewTransitionContext } from "./lib/context.js";
|
|
6
|
+
import { AwaitContextProvider, DataRouterContext, DataRouterDataContext, DataRouterNavigationContext, DataRouterStateContext, FetchersContext, LocationContext, NavigateOptions, NavigationContext, Navigator, RouteContext, ViewTransitionContext } from "./lib/context.js";
|
|
7
|
+
import { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, shouldHydrateRouteLoader } from "./lib/dom/ssr/routes.js";
|
|
8
|
+
import { HtmlLinkDescriptor, LinkDescriptor, PageLinkDescriptor } from "./lib/router/links.js";
|
|
9
|
+
import { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, HeadersArgs, HeadersFunction, LinksFunction, MetaArgs, MetaDescriptor, MetaFunction, RouteModules } from "./lib/dom/ssr/routeModules.js";
|
|
10
|
+
import { SingleFetchRedirectSymbol, decodeViaTurboStream, getTurboStreamSingleFetchDataStrategy } from "./lib/dom/ssr/single-fetch.js";
|
|
11
|
+
import { ServerMode } from "./lib/server-runtime/mode.js";
|
|
12
|
+
import { unstable_SerializesTo } from "./lib/types/serializes-to.js";
|
|
8
13
|
import { Register } from "./lib/types/register.js";
|
|
9
14
|
import { NavigateFunction, unstable_RouterState, unstable_RouterStateActiveVariant, unstable_RouterStatePendingVariant, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRoute, useRouteError, useRouteLoaderData, useRouterState, useRoutes } from "./lib/hooks.js";
|
|
10
15
|
import { FetcherSubmitOptions, ParamKeyValuePair, SubmitOptions, SubmitTarget, URLSearchParamsInit, createSearchParams } from "./lib/dom/dom.js";
|
|
@@ -19,7 +24,6 @@ import { createCookieSessionStorage } from "./lib/server-runtime/sessions/cookie
|
|
|
19
24
|
import { createMemorySessionStorage } from "./lib/server-runtime/sessions/memoryStorage.js";
|
|
20
25
|
import { setDevServerHooks } from "./lib/server-runtime/dev.js";
|
|
21
26
|
import { Future } from "./lib/types/future.js";
|
|
22
|
-
import { unstable_SerializesTo } from "./lib/types/serializes-to.js";
|
|
23
27
|
import { href } from "./lib/href.js";
|
|
24
28
|
import { DecodeActionFunction, DecodeFormStateFunction, DecodeReplyFunction, LoadServerActionFunction, RSCManifestPayload, RSCMatch, RSCPayload, RSCRenderPayload, RSCRouteConfig, RSCRouteConfigEntry, RSCRouteManifest, RSCRouteMatch, getRequest, matchRSCServerRequest } from "./lib/rsc/server.rsc.js";
|
|
25
29
|
import { BrowserCreateFromReadableStreamFunction, EncodeReplyFunction, RSCHydratedRouterProps } from "./lib/rsc/browser.js";
|
|
@@ -28,10 +32,7 @@ import { RSCDefaultRootErrorBoundary } from "./lib/rsc/errorBoundaries.js";
|
|
|
28
32
|
import { RemixErrorBoundary } from "./lib/dom/ssr/errorBoundaries.js";
|
|
29
33
|
import { getPatchRoutesOnNavigationFunction, useFogOFWarDiscovery } from "./lib/dom/ssr/fog-of-war.js";
|
|
30
34
|
import { getHydrationData } from "./lib/dom/ssr/hydration.js";
|
|
31
|
-
import {
|
|
32
|
-
import { ServerMode } from "./lib/server-runtime/mode.js";
|
|
33
|
-
import { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, HeadersArgs, HeadersFunction, LinksFunction, MetaArgs, MetaDescriptor, MetaFunction, RouteModules } from "./lib/dom/ssr/routeModules.js";
|
|
34
|
-
import { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, shouldHydrateRouteLoader } from "./lib/dom/ssr/routes.js";
|
|
35
|
+
import { DiscoveryResult, ManifestMismatchEvent, RouteDiscoveryOptions, RouteDiscoveryRuntime, getCustomPatchRoutesOnNavigationFunction, useCustomRouteDiscovery, useRouteDiscovery } from "./lib/dom/ssr/route-discovery.js";
|
|
35
36
|
import { AssetsManifest, EntryContext } from "./lib/dom/ssr/entry.js";
|
|
36
37
|
import { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule } from "./lib/server-runtime/build.js";
|
|
37
38
|
import { CreateRequestHandlerFunction, RequestHandler, createRequestHandler } from "./lib/server-runtime/server.js";
|
|
@@ -41,4 +42,4 @@ import { ClientInstrumentation, InstrumentRequestHandlerFunction, InstrumentRout
|
|
|
41
42
|
declare const unstable_getRequest: typeof getRequest;
|
|
42
43
|
declare const unstable_matchRSCServerRequest: typeof matchRSCServerRequest;
|
|
43
44
|
//#endregion
|
|
44
|
-
export { type ActionFunction, type ActionFunctionArgs, Await, type AwaitProps, type BaseRouteObject, type Blocker, type BlockerFunction, BrowserRouter, type BrowserRouterProps, type ClientActionFunction, type ClientActionFunctionArgs, type ClientInstrumentation, type ClientLoaderFunction, type ClientLoaderFunctionArgs, type ClientOnErrorFunction, type Cookie, type CookieOptions, type CookieParseOptions, type CookieSerializeOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, type DataRouteMatch, type DataRouteObject, type Router as DataRouter, type DataStrategyFunction, type DataStrategyFunctionArgs, type DataStrategyMatch, type DataStrategyResult, type DiscoverBehavior, type EntryContext, type ErrorResponse, type Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, type FormEncType, type FormMethod, type FormProps, type Future, type GetScrollPositionFunction, type GetScrollRestorationKeyFunction, type HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HeadersArgs, type HeadersFunction, type HistoryRouterProps, type HtmlLinkDescriptor, type HydrationState, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, type IndexRouteObject, type IndexRouteProps, type InitialEntry, type InstrumentRequestHandlerFunction, type InstrumentRouteFunction, type InstrumentRouterFunction, type InstrumentationClientRouterResult, type InstrumentationHandlerResult, type InstrumentationServerHandlerResult, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, type LazyRouteFunction, Link, type LinkDescriptor, type LinkProps, Links, type LinksFunction, type LinksProps, type LoaderFunction, type LoaderFunctionArgs, type Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, type MetaArgs, type MetaDescriptor, type MetaFunction, type MiddlewareFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, type NavigateOptions, type NavigateProps, type Navigation, type NavigationStates, Action as NavigationType, type Navigator, type NonIndexRouteObject, Outlet, type OutletProps, type PageLinkDescriptor, type ParamKeyValuePair, type ParamParseKey, type Params, type PatchRoutesOnNavigationFunction, type PatchRoutesOnNavigationFunctionArgs, type Path, type PathMatch, type PathParam, type PathPattern, type PathRouteProps, type PrefetchBehavior, PrefetchPageLinks, type RedirectFunction, type Register, type RelativeRoutingType, type RequestHandler, type RevalidationState, Route, type RouteMatch, type RouteObject, type RouteProps, Router$1 as Router, type RouterContext, RouterContextProvider, type RouterFetchOptions, type RouterInit, type RouterNavigateOptions, type RouterProps, RouterProvider, type RouterProviderProps, type RouterState, type RouterSubscriber, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, type ServerInstrumentation, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, type ShouldRevalidateFunction, type ShouldRevalidateFunctionArgs, type StaticHandler, type StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, type To, type UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, AwaitContextProvider as UNSAFE_AwaitContextProvider, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, type DataWithResponseInit as UNSAFE_DataWithResponseInit, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, FetchersContext as UNSAFE_FetchersContext, FrameworkContext as UNSAFE_FrameworkContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, type RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createHashHistory as UNSAFE_createHashHistory, createMemoryHistory as UNSAFE_createMemoryHistory, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, defaultMapRouteProperties as UNSAFE_defaultMapRouteProperties, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, invariant as UNSAFE_invariant, 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, createContext, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, href, isCookie, isRouteErrorResponse, isSession, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, type BrowserCreateFromReadableStreamFunction as unstable_BrowserCreateFromReadableStreamFunction, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type EncodeReplyFunction as unstable_EncodeReplyFunction, HistoryRouter as unstable_HistoryRouter, type LoadServerActionFunction as unstable_LoadServerActionFunction, type RSCHydratedRouterProps as unstable_RSCHydratedRouterProps, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, RSCStaticRouter as unstable_RSCStaticRouter, type RSCStaticRouterProps as unstable_RSCStaticRouterProps, type unstable_RouterState, type unstable_RouterStateActiveVariant, type unstable_RouterStatePendingVariant, type SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction, type unstable_SerializesTo, unstable_getRequest, unstable_matchRSCServerRequest, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useRoute as unstable_useRoute, useRouterState as unstable_useRouterState, 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 };
|
|
45
|
+
export { type ActionFunction, type ActionFunctionArgs, Await, type AwaitProps, type BaseRouteObject, type Blocker, type BlockerFunction, BrowserRouter, type BrowserRouterProps, type ClientActionFunction, type ClientActionFunctionArgs, type ClientInstrumentation, type ClientLoaderFunction, type ClientLoaderFunctionArgs, type ClientOnErrorFunction, type Cookie, type CookieOptions, type CookieParseOptions, type CookieSerializeOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, type DOMRouterOpts, type DataRouteMatch, type DataRouteObject, type Router as DataRouter, type DataStrategyFunction, type DataStrategyFunctionArgs, type DataStrategyMatch, type DataStrategyResult, type DiscoverBehavior, type EntryContext, type ErrorResponse, type Fetcher, type FetcherFormProps, type FetcherSubmitFunction, type FetcherSubmitOptions, type FetcherWithComponents, type FlashSessionData, Form, type FormEncType, type FormMethod, type FormProps, type Future, type GetScrollPositionFunction, type GetScrollRestorationKeyFunction, type HTMLFormMethod, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HashRouter, type HashRouterProps, type HeadersArgs, type HeadersFunction, type HistoryRouterProps, type HtmlLinkDescriptor, type HydrationState, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, type IndexRouteObject, type IndexRouteProps, type InitialEntry, type InstrumentRequestHandlerFunction, type InstrumentRouteFunction, type InstrumentRouterFunction, type InstrumentationClientRouterResult, type InstrumentationHandlerResult, type InstrumentationServerHandlerResult, type IsCookieFunction, type IsSessionFunction, type LayoutRouteProps, type LazyRouteFunction, Link, type LinkDescriptor, type LinkProps, Links, type LinksFunction, type LinksProps, type LoaderFunction, type LoaderFunctionArgs, type Location, MemoryRouter, type MemoryRouterOpts, type MemoryRouterProps, Meta, type MetaArgs, type MetaDescriptor, type MetaFunction, type MiddlewareFunction, NavLink, type NavLinkProps, type NavLinkRenderProps, Navigate, type NavigateFunction, type NavigateOptions, type NavigateProps, type Navigation, type NavigationStates, Action as NavigationType, type Navigator, type NonIndexRouteObject, Outlet, type OutletProps, type PageLinkDescriptor, type ParamKeyValuePair, type ParamParseKey, type Params, type PatchRoutesOnNavigationFunction, type PatchRoutesOnNavigationFunctionArgs, type Path, type PathMatch, type PathParam, type PathPattern, type PathRouteProps, type PrefetchBehavior, PrefetchPageLinks, type RedirectFunction, type Register, type RelativeRoutingType, type RequestHandler, type RevalidationState, Route, type RouteMatch, type RouteObject, type RouteProps, Router$1 as Router, type RouterContext, RouterContextProvider, type RouterFetchOptions, type RouterInit, type RouterNavigateOptions, type RouterProps, RouterProvider, type RouterProviderProps, type RouterState, type RouterSubscriber, Routes, type RoutesProps, type RoutesTestStubProps, Scripts, type ScriptsProps, ScrollRestoration, type ScrollRestorationProps, type ServerBuild, type ServerEntryModule, type ServerInstrumentation, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, type SetURLSearchParams, type ShouldRevalidateFunction, type ShouldRevalidateFunctionArgs, type StaticHandler, type StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, type SubmitFunction, type SubmitOptions, type SubmitTarget, type To, type UIMatch, type AssetsManifest as UNSAFE_AssetsManifest, AwaitContextProvider as UNSAFE_AwaitContextProvider, DataRouterContext as UNSAFE_DataRouterContext, DataRouterDataContext as UNSAFE_DataRouterDataContext, DataRouterNavigationContext as UNSAFE_DataRouterNavigationContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, type DataWithResponseInit as UNSAFE_DataWithResponseInit, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, FetchersContext as UNSAFE_FetchersContext, FrameworkContext as UNSAFE_FrameworkContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, RouteDiscoveryRuntime as UNSAFE_RouteDiscoveryRuntime, type RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createHashHistory as UNSAFE_createHashHistory, createMemoryHistory as UNSAFE_createMemoryHistory, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, defaultMapRouteProperties as UNSAFE_defaultMapRouteProperties, getCustomPatchRoutesOnNavigationFunction as UNSAFE_getCustomPatchRoutesOnNavigationFunction, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, invariant as UNSAFE_invariant, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useCustomRouteDiscovery as UNSAFE_useCustomRouteDiscovery, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, withComponentProps as UNSAFE_withComponentProps, withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps, withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps, type URLSearchParamsInit, createBrowserRouter, createContext, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, href, isCookie, isRouteErrorResponse, isSession, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, type BrowserCreateFromReadableStreamFunction as unstable_BrowserCreateFromReadableStreamFunction, type DataStrategyInitiator as unstable_DataStrategyInitiator, type DecodeActionFunction as unstable_DecodeActionFunction, type DecodeFormStateFunction as unstable_DecodeFormStateFunction, type DecodeReplyFunction as unstable_DecodeReplyFunction, type DiscoveryResult as unstable_DiscoveryResult, type EncodeReplyFunction as unstable_EncodeReplyFunction, HistoryRouter as unstable_HistoryRouter, type LoadServerActionFunction as unstable_LoadServerActionFunction, type ManifestMismatchEvent as unstable_ManifestMismatchEvent, type RSCHydratedRouterProps as unstable_RSCHydratedRouterProps, type RSCManifestPayload as unstable_RSCManifestPayload, type RSCMatch as unstable_RSCMatch, type RSCPayload as unstable_RSCPayload, type RSCRenderPayload as unstable_RSCRenderPayload, type RSCRouteConfig as unstable_RSCRouteConfig, type RSCRouteConfigEntry as unstable_RSCRouteConfigEntry, type RSCRouteManifest as unstable_RSCRouteManifest, type RSCRouteMatch as unstable_RSCRouteMatch, RSCStaticRouter as unstable_RSCStaticRouter, type RSCStaticRouterProps as unstable_RSCStaticRouterProps, type RouteDiscoveryOptions as unstable_RouteDiscoveryOptions, type unstable_RouterState, type unstable_RouterStateActiveVariant, type unstable_RouterStatePendingVariant, type SSRCreateFromReadableStreamFunction as unstable_SSRCreateFromReadableStreamFunction, type unstable_SerializesTo, unstable_getRequest, unstable_matchRSCServerRequest, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useRoute as unstable_useRoute, useRouteDiscovery as unstable_useRouteDiscovery, useRouterState as unstable_useRouterState, 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 v8.
|
|
2
|
+
* react-router v8.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
import { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, invariant, parsePath } from "./lib/router/history.js";
|
|
13
13
|
import { ErrorResponseImpl, RouterContextProvider, createContext, data, defaultMapRouteProperties, generatePath, isRouteErrorResponse, matchPath, matchRoutes, redirect, redirectDocument, replace, resolvePath } from "./lib/router/utils.js";
|
|
14
14
|
import { IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, createRouter, createStaticHandler } from "./lib/router/router.js";
|
|
15
|
-
import { AwaitContextProvider, DataRouterContext, DataRouterStateContext, FetchersContext, LocationContext, NavigationContext, RouteContext, ViewTransitionContext } from "./lib/context.js";
|
|
15
|
+
import { AwaitContextProvider, DataRouterContext, DataRouterDataContext, DataRouterNavigationContext, DataRouterStateContext, FetchersContext, LocationContext, NavigationContext, RouteContext, ViewTransitionContext } from "./lib/context.js";
|
|
16
16
|
import { useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRoute, useRouteError, useRouteLoaderData, useRouterState, useRoutes } from "./lib/hooks.js";
|
|
17
|
-
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, WithComponentProps, WithErrorBoundaryProps, WithHydrateFallbackProps, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, hydrationRouteProperties, renderMatches, withComponentProps, withErrorBoundaryProps, withHydrateFallbackProps } from "./lib/components.js";
|
|
18
|
-
import { createSearchParams } from "./lib/dom/dom.js";
|
|
19
17
|
import { SingleFetchRedirectSymbol, decodeViaTurboStream, getTurboStreamSingleFetchDataStrategy } from "./lib/dom/ssr/single-fetch.js";
|
|
20
18
|
import { RemixErrorBoundary } from "./lib/dom/ssr/errorBoundaries.js";
|
|
21
19
|
import { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, shouldHydrateRouteLoader } from "./lib/dom/ssr/routes.js";
|
|
22
20
|
import { getPatchRoutesOnNavigationFunction, useFogOFWarDiscovery } from "./lib/dom/ssr/fog-of-war.js";
|
|
23
21
|
import { FrameworkContext, Links, Meta, PrefetchPageLinks, Scripts } from "./lib/dom/ssr/components.js";
|
|
22
|
+
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, WithComponentProps, WithErrorBoundaryProps, WithHydrateFallbackProps, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, hydrationRouteProperties, renderMatches, withComponentProps, withErrorBoundaryProps, withHydrateFallbackProps } from "./lib/components.js";
|
|
23
|
+
import { createSearchParams } from "./lib/dom/dom.js";
|
|
24
24
|
import { BrowserRouter, Form, HashRouter, HistoryRouter, Link, NavLink, ScrollRestoration, createBrowserRouter, createHashRouter, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, usePrompt, useScrollRestoration, useSearchParams, useSubmit, useViewTransitionState } from "./lib/dom/lib.js";
|
|
25
25
|
import { StaticRouter, StaticRouterProvider, createStaticRouter } from "./lib/dom/server.js";
|
|
26
26
|
import { ServerRouter } from "./lib/dom/ssr/server.js";
|
|
@@ -36,10 +36,11 @@ import { href } from "./lib/href.js";
|
|
|
36
36
|
import { RSCDefaultRootErrorBoundary } from "./lib/rsc/errorBoundaries.js";
|
|
37
37
|
import { RSCStaticRouter, routeRSCServerRequest } from "./lib/rsc/server.ssr.js";
|
|
38
38
|
import { getHydrationData } from "./lib/dom/ssr/hydration.js";
|
|
39
|
+
import { RouteDiscoveryRuntime, getCustomPatchRoutesOnNavigationFunction, useCustomRouteDiscovery, useRouteDiscovery } from "./lib/dom/ssr/route-discovery.js";
|
|
39
40
|
//#region index.ts
|
|
40
41
|
/**
|
|
41
42
|
* @module index
|
|
42
43
|
* @mergeModuleWith react-router
|
|
43
44
|
*/
|
|
44
45
|
//#endregion
|
|
45
|
-
export { Await, BrowserRouter, Form, HashRouter, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Link, Links, MemoryRouter, Meta, NavLink, Navigate, Action as NavigationType, Outlet, PrefetchPageLinks, Route, Router, RouterContextProvider, RouterProvider, Routes, Scripts, ScrollRestoration, ServerRouter, StaticRouter, StaticRouterProvider, AwaitContextProvider as UNSAFE_AwaitContextProvider, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, FetchersContext as UNSAFE_FetchersContext, FrameworkContext as UNSAFE_FrameworkContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createHashHistory as UNSAFE_createHashHistory, createMemoryHistory as UNSAFE_createMemoryHistory, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, defaultMapRouteProperties as UNSAFE_defaultMapRouteProperties, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, invariant as UNSAFE_invariant, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, withComponentProps as UNSAFE_withComponentProps, withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps, withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps, createBrowserRouter, createContext, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, href, isCookie, isRouteErrorResponse, isSession, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, HistoryRouter as unstable_HistoryRouter, RSCStaticRouter as unstable_RSCStaticRouter, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useRoute as unstable_useRoute, useRouterState as unstable_useRouterState, 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 };
|
|
46
|
+
export { Await, BrowserRouter, Form, HashRouter, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Link, Links, MemoryRouter, Meta, NavLink, Navigate, Action as NavigationType, Outlet, PrefetchPageLinks, Route, Router, RouterContextProvider, RouterProvider, Routes, Scripts, ScrollRestoration, ServerRouter, StaticRouter, StaticRouterProvider, AwaitContextProvider as UNSAFE_AwaitContextProvider, DataRouterContext as UNSAFE_DataRouterContext, DataRouterDataContext as UNSAFE_DataRouterDataContext, DataRouterNavigationContext as UNSAFE_DataRouterNavigationContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, FetchersContext as UNSAFE_FetchersContext, FrameworkContext as UNSAFE_FrameworkContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteContext as UNSAFE_RouteContext, RouteDiscoveryRuntime as UNSAFE_RouteDiscoveryRuntime, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, ViewTransitionContext as UNSAFE_ViewTransitionContext, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps, createBrowserHistory as UNSAFE_createBrowserHistory, createClientRoutes as UNSAFE_createClientRoutes, createClientRoutesWithHMRRevalidationOptOut as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, createHashHistory as UNSAFE_createHashHistory, createMemoryHistory as UNSAFE_createMemoryHistory, createRouter as UNSAFE_createRouter, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, defaultMapRouteProperties as UNSAFE_defaultMapRouteProperties, getCustomPatchRoutesOnNavigationFunction as UNSAFE_getCustomPatchRoutesOnNavigationFunction, getHydrationData as UNSAFE_getHydrationData, getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction, getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy, hydrationRouteProperties as UNSAFE_hydrationRouteProperties, invariant as UNSAFE_invariant, shouldHydrateRouteLoader as UNSAFE_shouldHydrateRouteLoader, useCustomRouteDiscovery as UNSAFE_useCustomRouteDiscovery, useFogOFWarDiscovery as UNSAFE_useFogOFWarDiscovery, useScrollRestoration as UNSAFE_useScrollRestoration, withComponentProps as UNSAFE_withComponentProps, withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps, withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps, createBrowserRouter, createContext, createCookie, createCookieSessionStorage, createHashRouter, createMemoryRouter, createMemorySessionStorage, createPath, createRequestHandler, createRoutesFromChildren, createRoutesFromElements, createRoutesStub, createSearchParams, createSession, createSessionStorage, createStaticHandler, createStaticRouter, data, generatePath, href, isCookie, isRouteErrorResponse, isSession, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, HistoryRouter as unstable_HistoryRouter, RSCStaticRouter as unstable_RSCStaticRouter, routeRSCServerRequest as unstable_routeRSCServerRequest, setDevServerHooks as unstable_setDevServerHooks, usePrompt as unstable_usePrompt, useRoute as unstable_useRoute, useRouteDiscovery as unstable_useRouteDiscovery, useRouterState as unstable_useRouterState, 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 };
|