react-router 8.0.1 → 8.2.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 +24 -0
- package/dist/development/dom-export.js +1 -1
- package/dist/development/index-react-server-client.js +1 -1
- package/dist/development/index-react-server.d.ts +35 -9
- package/dist/development/index-react-server.js +190 -157
- package/dist/development/index.d.ts +2 -2
- package/dist/development/index.js +1 -1
- package/dist/development/lib/actions.js +1 -1
- package/dist/development/lib/components.js +1 -1
- package/dist/development/lib/context.js +1 -1
- package/dist/development/lib/dom/dom.js +1 -1
- package/dist/development/lib/dom/lib.js +2 -2
- package/dist/development/lib/dom/server.js +1 -1
- package/dist/development/lib/dom/ssr/components.js +1 -1
- package/dist/development/lib/dom/ssr/data.js +1 -1
- 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.js +1 -1
- package/dist/development/lib/dom/ssr/hydration.js +1 -1
- 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 +1 -1
- package/dist/development/lib/dom/ssr/routeModules.js +1 -1
- package/dist/development/lib/dom/ssr/routes-test-stub.js +1 -1
- package/dist/development/lib/dom/ssr/routes.js +1 -1
- package/dist/development/lib/dom/ssr/server.js +1 -1
- package/dist/development/lib/dom/ssr/single-fetch.js +1 -1
- package/dist/development/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/development/lib/dom-export/hydrated-router.js +1 -1
- package/dist/development/lib/errors.js +1 -1
- package/dist/development/lib/hooks.d.ts +33 -6
- package/dist/development/lib/hooks.js +34 -7
- package/dist/development/lib/href.js +6 -3
- package/dist/development/lib/router/history.js +1 -1
- package/dist/development/lib/router/instrumentation.d.ts +33 -8
- package/dist/development/lib/router/instrumentation.js +176 -99
- package/dist/development/lib/router/router.js +20 -20
- package/dist/development/lib/router/url.js +1 -1
- package/dist/development/lib/router/utils.js +21 -4
- package/dist/development/lib/rsc/browser.js +1 -1
- 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 +1 -1
- package/dist/development/lib/rsc/route-modules.js +1 -1
- package/dist/development/lib/rsc/server.rsc.d.ts +3 -2
- package/dist/development/lib/rsc/server.ssr.js +1 -1
- 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 +1 -1
- package/dist/development/lib/server-runtime/routes.js +1 -1
- package/dist/development/lib/server-runtime/server.js +12 -5
- 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/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.js +1 -1
- package/dist/production/index-react-server-client.js +1 -1
- package/dist/production/index-react-server.d.ts +35 -9
- package/dist/production/index-react-server.js +190 -157
- package/dist/production/index.d.ts +2 -2
- package/dist/production/index.js +1 -1
- package/dist/production/lib/actions.js +1 -1
- package/dist/production/lib/components.js +1 -1
- package/dist/production/lib/context.js +1 -1
- package/dist/production/lib/dom/dom.js +1 -1
- package/dist/production/lib/dom/lib.js +2 -2
- package/dist/production/lib/dom/server.js +1 -1
- package/dist/production/lib/dom/ssr/components.js +1 -1
- package/dist/production/lib/dom/ssr/data.js +1 -1
- 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.js +1 -1
- package/dist/production/lib/dom/ssr/hydration.js +1 -1
- 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 +1 -1
- package/dist/production/lib/dom/ssr/routeModules.js +1 -1
- package/dist/production/lib/dom/ssr/routes-test-stub.js +1 -1
- package/dist/production/lib/dom/ssr/routes.js +1 -1
- package/dist/production/lib/dom/ssr/server.js +1 -1
- package/dist/production/lib/dom/ssr/single-fetch.js +1 -1
- package/dist/production/lib/dom-export/dom-router-provider.js +1 -1
- package/dist/production/lib/dom-export/hydrated-router.js +1 -1
- package/dist/production/lib/errors.js +1 -1
- package/dist/production/lib/hooks.d.ts +33 -6
- package/dist/production/lib/hooks.js +34 -7
- package/dist/production/lib/href.js +6 -3
- package/dist/production/lib/router/history.js +1 -1
- package/dist/production/lib/router/instrumentation.d.ts +33 -8
- package/dist/production/lib/router/instrumentation.js +176 -99
- package/dist/production/lib/router/router.js +20 -20
- package/dist/production/lib/router/url.js +1 -1
- package/dist/production/lib/router/utils.js +21 -4
- package/dist/production/lib/rsc/browser.js +1 -1
- 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 +1 -1
- package/dist/production/lib/rsc/route-modules.js +1 -1
- package/dist/production/lib/rsc/server.rsc.d.ts +3 -2
- package/dist/production/lib/rsc/server.ssr.js +1 -1
- 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 +1 -1
- package/dist/production/lib/server-runtime/routes.js +1 -1
- package/dist/production/lib/server-runtime/server.js +12 -5
- 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/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/hot-module-replacement.md +1 -1
- package/docs/how-to/data-strategy.md +1 -1
- package/docs/how-to/instrumentation.md +131 -26
- package/docs/start/framework/deploying.md +4 -0
- package/docs/upgrading/component-routes.md +2 -2
- package/docs/upgrading/future.md +33 -0
- package/docs/upgrading/router-provider.md +6 -6
- package/docs/upgrading/v7.md +39 -22
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v8.0
|
|
2
|
+
* react-router v8.2.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -77,142 +77,6 @@ function parsePath(path) {
|
|
|
77
77
|
return parsedPath;
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region lib/router/instrumentation.ts
|
|
81
|
-
const UninstrumentedSymbol = Symbol("Uninstrumented");
|
|
82
|
-
function getRouteInstrumentationUpdates(fns, route) {
|
|
83
|
-
let aggregated = {
|
|
84
|
-
lazy: [],
|
|
85
|
-
"lazy.loader": [],
|
|
86
|
-
"lazy.action": [],
|
|
87
|
-
"lazy.middleware": [],
|
|
88
|
-
middleware: [],
|
|
89
|
-
loader: [],
|
|
90
|
-
action: []
|
|
91
|
-
};
|
|
92
|
-
fns.forEach((fn) => fn({
|
|
93
|
-
id: route.id,
|
|
94
|
-
index: route.index,
|
|
95
|
-
path: route.path,
|
|
96
|
-
instrument(i) {
|
|
97
|
-
let keys = Object.keys(aggregated);
|
|
98
|
-
for (let key of keys) if (i[key]) aggregated[key].push(i[key]);
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
101
|
-
let updates = {};
|
|
102
|
-
if (typeof route.lazy === "function" && aggregated.lazy.length > 0) {
|
|
103
|
-
let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0);
|
|
104
|
-
if (instrumented) updates.lazy = instrumented;
|
|
105
|
-
}
|
|
106
|
-
if (typeof route.lazy === "object") {
|
|
107
|
-
let lazyObject = route.lazy;
|
|
108
|
-
[
|
|
109
|
-
"middleware",
|
|
110
|
-
"loader",
|
|
111
|
-
"action"
|
|
112
|
-
].forEach((key) => {
|
|
113
|
-
let lazyFn = lazyObject[key];
|
|
114
|
-
let instrumentations = aggregated[`lazy.${key}`];
|
|
115
|
-
if (typeof lazyFn === "function" && instrumentations.length > 0) {
|
|
116
|
-
let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0);
|
|
117
|
-
if (instrumented) updates.lazy = Object.assign(updates.lazy || {}, { [key]: instrumented });
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
["loader", "action"].forEach((key) => {
|
|
122
|
-
let handler = route[key];
|
|
123
|
-
if (typeof handler === "function" && aggregated[key].length > 0) {
|
|
124
|
-
let original = handler[UninstrumentedSymbol] ?? handler;
|
|
125
|
-
let instrumented = wrapImpl(aggregated[key], original, (...args) => getHandlerInfo(args[0]));
|
|
126
|
-
if (instrumented) {
|
|
127
|
-
if (key === "loader" && original.hydrate === true) instrumented.hydrate = true;
|
|
128
|
-
instrumented[UninstrumentedSymbol] = original;
|
|
129
|
-
updates[key] = instrumented;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) updates.middleware = route.middleware.map((middleware) => {
|
|
134
|
-
let original = middleware[UninstrumentedSymbol] ?? middleware;
|
|
135
|
-
let instrumented = wrapImpl(aggregated.middleware, original, (...args) => getHandlerInfo(args[0]));
|
|
136
|
-
if (instrumented) {
|
|
137
|
-
instrumented[UninstrumentedSymbol] = original;
|
|
138
|
-
return instrumented;
|
|
139
|
-
}
|
|
140
|
-
return middleware;
|
|
141
|
-
});
|
|
142
|
-
return updates;
|
|
143
|
-
}
|
|
144
|
-
function wrapImpl(impls, handler, getInfo) {
|
|
145
|
-
if (impls.length === 0) return null;
|
|
146
|
-
return async (...args) => {
|
|
147
|
-
let result = await recurseRight(impls, getInfo(...args), () => handler(...args), impls.length - 1);
|
|
148
|
-
if (result.type === "error") throw result.value;
|
|
149
|
-
return result.value;
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
async function recurseRight(impls, info, handler, index) {
|
|
153
|
-
let impl = impls[index];
|
|
154
|
-
let result;
|
|
155
|
-
if (!impl) try {
|
|
156
|
-
result = {
|
|
157
|
-
type: "success",
|
|
158
|
-
value: await handler()
|
|
159
|
-
};
|
|
160
|
-
} catch (e) {
|
|
161
|
-
result = {
|
|
162
|
-
type: "error",
|
|
163
|
-
value: e
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
let handlerPromise = void 0;
|
|
168
|
-
let callHandler = async () => {
|
|
169
|
-
if (handlerPromise) console.error("You cannot call instrumented handlers more than once");
|
|
170
|
-
else handlerPromise = recurseRight(impls, info, handler, index - 1);
|
|
171
|
-
result = await handlerPromise;
|
|
172
|
-
invariant$1(result, "Expected a result");
|
|
173
|
-
if (result.type === "error" && result.value instanceof Error) return {
|
|
174
|
-
status: "error",
|
|
175
|
-
error: result.value
|
|
176
|
-
};
|
|
177
|
-
return {
|
|
178
|
-
status: "success",
|
|
179
|
-
error: void 0
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
try {
|
|
183
|
-
await impl(callHandler, info);
|
|
184
|
-
} catch (e) {
|
|
185
|
-
console.error("An instrumentation function threw an error:", e);
|
|
186
|
-
}
|
|
187
|
-
if (!handlerPromise) await callHandler();
|
|
188
|
-
await handlerPromise;
|
|
189
|
-
}
|
|
190
|
-
if (result) return result;
|
|
191
|
-
return {
|
|
192
|
-
type: "error",
|
|
193
|
-
value: /* @__PURE__ */ new Error("No result assigned in instrumentation chain.")
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function getHandlerInfo(args) {
|
|
197
|
-
let { request, context, params, pattern } = args;
|
|
198
|
-
return {
|
|
199
|
-
request: getReadonlyRequest(request),
|
|
200
|
-
params: { ...params },
|
|
201
|
-
pattern,
|
|
202
|
-
context: getReadonlyContext(context)
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
function getReadonlyRequest(request) {
|
|
206
|
-
return {
|
|
207
|
-
method: request.method,
|
|
208
|
-
url: request.url,
|
|
209
|
-
headers: { get: (...args) => request.headers.get(...args) }
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function getReadonlyContext(context) {
|
|
213
|
-
return { get: (ctx) => context.get(ctx) };
|
|
214
|
-
}
|
|
215
|
-
//#endregion
|
|
216
80
|
//#region lib/router/utils.ts
|
|
217
81
|
/**
|
|
218
82
|
* Creates a type-safe {@link RouterContext} object that can be used to
|
|
@@ -516,6 +380,8 @@ function rankRouteBranches(branches) {
|
|
|
516
380
|
branches.sort((a, b) => a.score !== b.score ? b.score - a.score : compareIndexes(a.routesMeta.map((meta) => meta.childrenIndex), b.routesMeta.map((meta) => meta.childrenIndex)));
|
|
517
381
|
}
|
|
518
382
|
const paramRe = /^:[\w-]+$/;
|
|
383
|
+
const partialParamRe = /^:[\w-]+/;
|
|
384
|
+
const partialDynamicSegmentValue = 3.5;
|
|
519
385
|
const dynamicSegmentValue = 3;
|
|
520
386
|
const indexRouteValue = 2;
|
|
521
387
|
const emptySegmentValue = 1;
|
|
@@ -527,7 +393,7 @@ function computeScore(path, index) {
|
|
|
527
393
|
let initialScore = segments.length;
|
|
528
394
|
if (segments.some(isSplat)) initialScore += splatPenalty;
|
|
529
395
|
if (index) initialScore += indexRouteValue;
|
|
530
|
-
return segments.filter((s) => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
|
|
396
|
+
return segments.filter((s) => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : partialParamRe.test(segment) ? partialDynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
|
|
531
397
|
}
|
|
532
398
|
function compareIndexes(a, b) {
|
|
533
399
|
return a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]) ? a[a.length - 1] - b[b.length - 1] : 0;
|
|
@@ -624,7 +490,7 @@ function compilePath(path, caseSensitive = false, end = true) {
|
|
|
624
490
|
return "(?:/([^\\/]*))?";
|
|
625
491
|
}
|
|
626
492
|
return "/([^\\/]+)";
|
|
627
|
-
}).replace(/\/([\w-]+)\?(
|
|
493
|
+
}).replace(/\/([\w-]+)\?(?=\/|$|\()/g, "(?:/$1)?");
|
|
628
494
|
if (path.endsWith("*")) {
|
|
629
495
|
params.push({ paramName: "*" });
|
|
630
496
|
regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
|
|
@@ -932,8 +798,187 @@ function isRouteErrorResponse(error) {
|
|
|
932
798
|
function getRoutePattern(matches) {
|
|
933
799
|
return joinPaths(matches.map((m) => m.route.path).filter(Boolean)) || "/";
|
|
934
800
|
}
|
|
801
|
+
function createDataFunctionUrl(request, path) {
|
|
802
|
+
let url = new URL(typeof request === "string" || request instanceof URL ? request : request.url);
|
|
803
|
+
let parsed = typeof path === "string" ? parsePath(path) : path;
|
|
804
|
+
url.pathname = parsed.pathname || "/";
|
|
805
|
+
if (parsed.search) {
|
|
806
|
+
let searchParams = new URLSearchParams(parsed.search);
|
|
807
|
+
let indexValues = searchParams.getAll("index");
|
|
808
|
+
searchParams.delete("index");
|
|
809
|
+
for (let value of indexValues.filter(Boolean)) searchParams.append("index", value);
|
|
810
|
+
let search = searchParams.toString();
|
|
811
|
+
url.search = search ? `?${search}` : "";
|
|
812
|
+
} else url.search = "";
|
|
813
|
+
url.hash = parsed.hash || "";
|
|
814
|
+
return url;
|
|
815
|
+
}
|
|
935
816
|
typeof window !== "undefined" && typeof window.document !== "undefined" && window.document.createElement;
|
|
936
817
|
//#endregion
|
|
818
|
+
//#region lib/router/instrumentation.ts
|
|
819
|
+
const UninstrumentedSymbol = Symbol("Uninstrumented");
|
|
820
|
+
function getRouteInstrumentationUpdates(fns, route) {
|
|
821
|
+
let aggregated = {
|
|
822
|
+
lazy: [],
|
|
823
|
+
"lazy.loader": [],
|
|
824
|
+
"lazy.action": [],
|
|
825
|
+
"lazy.middleware": [],
|
|
826
|
+
middleware: [],
|
|
827
|
+
loader: [],
|
|
828
|
+
action: []
|
|
829
|
+
};
|
|
830
|
+
fns.forEach((fn) => fn({
|
|
831
|
+
id: route.id,
|
|
832
|
+
index: route.index,
|
|
833
|
+
path: route.path,
|
|
834
|
+
instrument(i) {
|
|
835
|
+
if (i.lazy != null) aggregated.lazy.push(i.lazy);
|
|
836
|
+
if (i["lazy.loader"] != null) aggregated["lazy.loader"].push(i["lazy.loader"]);
|
|
837
|
+
if (i["lazy.action"] != null) aggregated["lazy.action"].push(i["lazy.action"]);
|
|
838
|
+
if (i["lazy.middleware"] != null) aggregated["lazy.middleware"].push(i["lazy.middleware"]);
|
|
839
|
+
if (i.middleware != null) aggregated.middleware.push(i.middleware);
|
|
840
|
+
if (i.loader != null) aggregated.loader.push(i.loader);
|
|
841
|
+
if (i.action != null) aggregated.action.push(i.action);
|
|
842
|
+
}
|
|
843
|
+
}));
|
|
844
|
+
let updates = {};
|
|
845
|
+
if (typeof route.lazy === "function" && aggregated.lazy.length > 0) {
|
|
846
|
+
let lazy = route.lazy;
|
|
847
|
+
updates.lazy = async (...args) => {
|
|
848
|
+
return throwOrReturnResult(await recurseRight(aggregated.lazy, void 0, () => lazy(...args), getInstrumentationInnerResult));
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
if (typeof route.lazy === "object") {
|
|
852
|
+
let lazyObject = route.lazy;
|
|
853
|
+
if (typeof lazyObject.middleware === "function" && aggregated["lazy.middleware"].length > 0) {
|
|
854
|
+
let middleware = lazyObject.middleware;
|
|
855
|
+
updates.lazy = Object.assign(updates.lazy || {}, { middleware: async (...args) => {
|
|
856
|
+
return throwOrReturnResult(await recurseRight(aggregated["lazy.middleware"], void 0, () => middleware(...args), getInstrumentationInnerResult));
|
|
857
|
+
} });
|
|
858
|
+
}
|
|
859
|
+
if (typeof lazyObject.loader === "function" && aggregated["lazy.loader"].length > 0) {
|
|
860
|
+
let loader = lazyObject.loader;
|
|
861
|
+
updates.lazy = Object.assign(updates.lazy || {}, { loader: async (...args) => {
|
|
862
|
+
return throwOrReturnResult(await recurseRight(aggregated["lazy.loader"], void 0, () => loader(...args), getInstrumentationInnerResult));
|
|
863
|
+
} });
|
|
864
|
+
}
|
|
865
|
+
if (typeof lazyObject.action === "function" && aggregated["lazy.action"].length > 0) {
|
|
866
|
+
let action = lazyObject.action;
|
|
867
|
+
updates.lazy = Object.assign(updates.lazy || {}, { action: async (...args) => {
|
|
868
|
+
return throwOrReturnResult(await recurseRight(aggregated["lazy.action"], void 0, () => action(...args), getInstrumentationInnerResult));
|
|
869
|
+
} });
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (typeof route.loader === "function" && aggregated.loader.length > 0) {
|
|
873
|
+
let original = getUninstrumentedHandler(route.loader);
|
|
874
|
+
let instrumented = async (...args) => {
|
|
875
|
+
return throwOrReturnResult(await recurseRight(aggregated.loader, getHandlerInfo(args[0]), () => original(...args), getInstrumentationInnerResult));
|
|
876
|
+
};
|
|
877
|
+
if (original.hydrate === true) instrumented.hydrate = true;
|
|
878
|
+
setUninstrumentedHandler(instrumented, original);
|
|
879
|
+
updates.loader = instrumented;
|
|
880
|
+
}
|
|
881
|
+
if (typeof route.action === "function" && aggregated.action.length > 0) {
|
|
882
|
+
let original = getUninstrumentedHandler(route.action);
|
|
883
|
+
let instrumented = async (...args) => {
|
|
884
|
+
return throwOrReturnResult(await recurseRight(aggregated.action, getHandlerInfo(args[0]), () => original(...args), getInstrumentationInnerResult));
|
|
885
|
+
};
|
|
886
|
+
setUninstrumentedHandler(instrumented, original);
|
|
887
|
+
updates.action = instrumented;
|
|
888
|
+
}
|
|
889
|
+
if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) updates.middleware = route.middleware.map((middleware) => {
|
|
890
|
+
let original = getUninstrumentedHandler(middleware);
|
|
891
|
+
let instrumented = async (...args) => {
|
|
892
|
+
return throwOrReturnResult(await recurseRight(aggregated.middleware, getHandlerInfo(args[0]), () => original(...args), getInstrumentationInnerResult));
|
|
893
|
+
};
|
|
894
|
+
setUninstrumentedHandler(instrumented, original);
|
|
895
|
+
return instrumented;
|
|
896
|
+
});
|
|
897
|
+
return updates;
|
|
898
|
+
}
|
|
899
|
+
function getUninstrumentedHandler(handler) {
|
|
900
|
+
return handler[UninstrumentedSymbol] ?? handler;
|
|
901
|
+
}
|
|
902
|
+
function setUninstrumentedHandler(handler, uninstrumentedHandler) {
|
|
903
|
+
handler[UninstrumentedSymbol] = uninstrumentedHandler;
|
|
904
|
+
}
|
|
905
|
+
function throwOrReturnResult(result) {
|
|
906
|
+
if (result.type === "error") throw result.value;
|
|
907
|
+
return result.value;
|
|
908
|
+
}
|
|
909
|
+
async function recurseRight(impls, info, handler, getInnerResult, state = {
|
|
910
|
+
result: null,
|
|
911
|
+
innerResult: null
|
|
912
|
+
}, index = impls.length - 1) {
|
|
913
|
+
let impl = impls[index];
|
|
914
|
+
if (!impl) {
|
|
915
|
+
try {
|
|
916
|
+
state.result = {
|
|
917
|
+
type: "success",
|
|
918
|
+
value: await handler()
|
|
919
|
+
};
|
|
920
|
+
} catch (e) {
|
|
921
|
+
state.result = {
|
|
922
|
+
type: "error",
|
|
923
|
+
value: e
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
state.innerResult = getInnerResult(state.result, info);
|
|
927
|
+
} else {
|
|
928
|
+
let handlerPromise = void 0;
|
|
929
|
+
let callHandler = async () => {
|
|
930
|
+
if (handlerPromise) console.error("You cannot call instrumented handlers more than once");
|
|
931
|
+
else handlerPromise = recurseRight(impls, info, handler, getInnerResult, state, index - 1);
|
|
932
|
+
await handlerPromise;
|
|
933
|
+
invariant$1(state.innerResult, "Expected an inner result");
|
|
934
|
+
return state.innerResult;
|
|
935
|
+
};
|
|
936
|
+
try {
|
|
937
|
+
await impl(callHandler, info);
|
|
938
|
+
} catch (e) {
|
|
939
|
+
console.error("An instrumentation function threw an error:", e);
|
|
940
|
+
}
|
|
941
|
+
if (!handlerPromise) await callHandler();
|
|
942
|
+
await handlerPromise;
|
|
943
|
+
}
|
|
944
|
+
if (state.result) return state.result;
|
|
945
|
+
state.result = {
|
|
946
|
+
type: "error",
|
|
947
|
+
value: /* @__PURE__ */ new Error("No result assigned in instrumentation chain.")
|
|
948
|
+
};
|
|
949
|
+
state.innerResult = getInnerResult(state.result, info);
|
|
950
|
+
return state.result;
|
|
951
|
+
}
|
|
952
|
+
function getInstrumentationInnerResult(result) {
|
|
953
|
+
if (result.type === "error" && result.value instanceof Error) return {
|
|
954
|
+
status: "error",
|
|
955
|
+
error: result.value
|
|
956
|
+
};
|
|
957
|
+
return {
|
|
958
|
+
status: "success",
|
|
959
|
+
error: void 0
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
function getHandlerInfo(args) {
|
|
963
|
+
let { request, context, params } = args;
|
|
964
|
+
return {
|
|
965
|
+
...args,
|
|
966
|
+
request: getReadonlyRequest(request),
|
|
967
|
+
params: { ...params },
|
|
968
|
+
context: getReadonlyContext(context)
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
function getReadonlyRequest(request) {
|
|
972
|
+
return {
|
|
973
|
+
method: request.method,
|
|
974
|
+
url: request.url,
|
|
975
|
+
headers: { get: (...args) => request.headers.get(...args) }
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
function getReadonlyContext(context) {
|
|
979
|
+
return { get: (ctx) => context.get(ctx) };
|
|
980
|
+
}
|
|
981
|
+
//#endregion
|
|
937
982
|
//#region lib/router/router.ts
|
|
938
983
|
const validMutationMethodsArr = [
|
|
939
984
|
"POST",
|
|
@@ -1868,21 +1913,6 @@ function normalizeRelativeRoutingRedirectResponse(response, request, routeId, ma
|
|
|
1868
1913
|
}
|
|
1869
1914
|
return response;
|
|
1870
1915
|
}
|
|
1871
|
-
function createDataFunctionUrl(request, path) {
|
|
1872
|
-
let url = new URL(request.url);
|
|
1873
|
-
let parsed = typeof path === "string" ? parsePath(path) : path;
|
|
1874
|
-
url.pathname = parsed.pathname || "/";
|
|
1875
|
-
if (parsed.search) {
|
|
1876
|
-
let searchParams = new URLSearchParams(parsed.search);
|
|
1877
|
-
let indexValues = searchParams.getAll("index");
|
|
1878
|
-
searchParams.delete("index");
|
|
1879
|
-
for (let value of indexValues.filter(Boolean)) searchParams.append("index", value);
|
|
1880
|
-
let search = searchParams.toString();
|
|
1881
|
-
url.search = search ? `?${search}` : "";
|
|
1882
|
-
} else url.search = "";
|
|
1883
|
-
url.hash = parsed.hash || "";
|
|
1884
|
-
return url;
|
|
1885
|
-
}
|
|
1886
1916
|
function processRouteLoaderData(matches, results, pendingActionResult, isStaticHandler = false, skipLoaderErrorBubbling = false) {
|
|
1887
1917
|
let loaderData = {};
|
|
1888
1918
|
let errors = null;
|
|
@@ -2431,7 +2461,7 @@ async function processServerAction(request, basename, decodeReply, loadServerAct
|
|
|
2431
2461
|
try {
|
|
2432
2462
|
let result = await action();
|
|
2433
2463
|
if (isRedirectResponse(result)) result = prependBasenameToRedirectResponse(result, basename);
|
|
2434
|
-
formState = decodeFormState?.(result, formData);
|
|
2464
|
+
formState = await decodeFormState?.(result, formData);
|
|
2435
2465
|
} catch (error) {
|
|
2436
2466
|
if (isRedirectResponse(error)) return prependBasenameToRedirectResponse(error, basename);
|
|
2437
2467
|
if (isResponse(error)) return error;
|
|
@@ -2769,6 +2799,9 @@ function canDecodeWithFormData(contentType) {
|
|
|
2769
2799
|
}
|
|
2770
2800
|
//#endregion
|
|
2771
2801
|
//#region lib/href.ts
|
|
2802
|
+
function stringify(p) {
|
|
2803
|
+
return p == null ? "" : typeof p === "string" ? p : String(p);
|
|
2804
|
+
}
|
|
2772
2805
|
/**
|
|
2773
2806
|
Returns a resolved URL path for the specified route.
|
|
2774
2807
|
|
|
@@ -2785,11 +2818,11 @@ function href(path, ...args) {
|
|
|
2785
2818
|
const isRequired = questionMark === void 0;
|
|
2786
2819
|
const value = params?.[param];
|
|
2787
2820
|
if (isRequired && value === void 0) throw new Error(`Path '${path}' requires param '${param}' but it was not provided`);
|
|
2788
|
-
return value
|
|
2821
|
+
return value == null ? "" : "/" + encodeURIComponent(stringify(value));
|
|
2789
2822
|
});
|
|
2790
2823
|
if (path.endsWith("*")) {
|
|
2791
2824
|
const value = params?.["*"];
|
|
2792
|
-
if (value !== void 0) result += "/" + value;
|
|
2825
|
+
if (value !== void 0) result += "/" + stringify(value).split("/").map(encodeURIComponent).join("/");
|
|
2793
2826
|
}
|
|
2794
2827
|
return result || "/";
|
|
2795
2828
|
}
|
|
@@ -35,10 +35,10 @@ import { createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, should
|
|
|
35
35
|
import { AssetsManifest, EntryContext } from "./lib/dom/ssr/entry.js";
|
|
36
36
|
import { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule } from "./lib/server-runtime/build.js";
|
|
37
37
|
import { CreateRequestHandlerFunction, RequestHandler, createRequestHandler } from "./lib/server-runtime/server.js";
|
|
38
|
-
import { ClientInstrumentation, InstrumentRequestHandlerFunction, InstrumentRouteFunction, InstrumentRouterFunction, InstrumentationHandlerResult, ServerInstrumentation } from "./lib/router/instrumentation.js";
|
|
38
|
+
import { ClientInstrumentation, InstrumentRequestHandlerFunction, InstrumentRouteFunction, InstrumentRouterFunction, InstrumentationClientRouterResult, InstrumentationHandlerResult, InstrumentationServerHandlerResult, ServerInstrumentation } from "./lib/router/instrumentation.js";
|
|
39
39
|
|
|
40
40
|
//#region index.d.ts
|
|
41
41
|
declare const unstable_getRequest: typeof getRequest;
|
|
42
42
|
declare const unstable_matchRSCServerRequest: typeof matchRSCServerRequest;
|
|
43
43
|
//#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 InstrumentationHandlerResult, 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 };
|
|
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 };
|
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v8.0
|
|
2
|
+
* react-router v8.2.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -22,7 +22,7 @@ import * as React$1 from "react";
|
|
|
22
22
|
//#region lib/dom/lib.tsx
|
|
23
23
|
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
24
24
|
try {
|
|
25
|
-
if (isBrowser) window.__reactRouterVersion = "8.0
|
|
25
|
+
if (isBrowser) window.__reactRouterVersion = "8.2.0";
|
|
26
26
|
} catch (e) {}
|
|
27
27
|
/**
|
|
28
28
|
* Create a new {@link DataRouter| data router} that manages the application
|