@remix-run/router 1.19.1 → 1.19.2
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 +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/router.cjs.js +246 -163
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +241 -158
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +246 -163
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/dist/utils.d.ts +10 -9
- package/index.ts +1 -1
- package/package.json +1 -1
- package/router.ts +334 -229
- package/utils.ts +12 -11
package/dist/utils.d.ts
CHANGED
|
@@ -49,13 +49,6 @@ export interface ErrorResult {
|
|
|
49
49
|
* Result from a loader or action - potentially successful or unsuccessful
|
|
50
50
|
*/
|
|
51
51
|
export type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
|
|
52
|
-
/**
|
|
53
|
-
* Result from a loader or action called via dataStrategy
|
|
54
|
-
*/
|
|
55
|
-
export interface HandlerResult {
|
|
56
|
-
type: "data" | "error";
|
|
57
|
-
result: unknown;
|
|
58
|
-
}
|
|
59
52
|
type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
60
53
|
type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
|
|
61
54
|
/**
|
|
@@ -191,13 +184,21 @@ export interface DetectErrorBoundaryFunction {
|
|
|
191
184
|
}
|
|
192
185
|
export interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
|
|
193
186
|
shouldLoad: boolean;
|
|
194
|
-
resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) =>
|
|
187
|
+
resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => DataFunctionReturnValue) => Promise<DataStrategyResult>;
|
|
195
188
|
}
|
|
196
189
|
export interface DataStrategyFunctionArgs<Context = any> extends DataFunctionArgs<Context> {
|
|
197
190
|
matches: DataStrategyMatch[];
|
|
191
|
+
fetcherKey: string | null;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Result from a loader or action called via dataStrategy
|
|
195
|
+
*/
|
|
196
|
+
export interface DataStrategyResult {
|
|
197
|
+
type: "data" | "error";
|
|
198
|
+
result: unknown;
|
|
198
199
|
}
|
|
199
200
|
export interface DataStrategyFunction {
|
|
200
|
-
(args: DataStrategyFunctionArgs): Promise<
|
|
201
|
+
(args: DataStrategyFunctionArgs): Promise<Record<string, DataStrategyResult>>;
|
|
201
202
|
}
|
|
202
203
|
export interface AgnosticPatchRoutesOnNavigationFunction<M extends AgnosticRouteMatch = AgnosticRouteMatch> {
|
|
203
204
|
(opts: {
|
package/index.ts
CHANGED
|
@@ -12,10 +12,10 @@ export type {
|
|
|
12
12
|
DataStrategyFunction as unstable_DataStrategyFunction,
|
|
13
13
|
DataStrategyFunctionArgs as unstable_DataStrategyFunctionArgs,
|
|
14
14
|
DataStrategyMatch as unstable_DataStrategyMatch,
|
|
15
|
+
DataStrategyResult as unstable_DataStrategyResult,
|
|
15
16
|
ErrorResponse,
|
|
16
17
|
FormEncType,
|
|
17
18
|
FormMethod,
|
|
18
|
-
HandlerResult as unstable_HandlerResult,
|
|
19
19
|
HTMLFormMethod,
|
|
20
20
|
JsonFunction,
|
|
21
21
|
LazyRouteFunction,
|