@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/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) => Promise<HandlerResult>) => Promise<HandlerResult>;
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<HandlerResult[]>;
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix-run/router",
3
- "version": "1.19.1",
3
+ "version": "1.19.2",
4
4
  "description": "Nested/Data-driven/Framework-agnostic Routing",
5
5
  "keywords": [
6
6
  "remix",