@remix-run/router 1.20.0 → 1.21.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/dist/utils.d.ts CHANGED
@@ -324,7 +324,7 @@ export declare function convertRoutesToDataRoutes(routes: AgnosticRouteObject[],
324
324
  /**
325
325
  * Matches the given routes to a location and returns the match data.
326
326
  *
327
- * @see https://reactrouter.com/utils/match-routes
327
+ * @see https://reactrouter.com/v6/utils/match-routes
328
328
  */
329
329
  export declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null;
330
330
  export declare function matchRoutesImpl<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename: string, allowPartial: boolean): AgnosticRouteMatch<string, RouteObjectType>[] | null;
@@ -339,7 +339,7 @@ export declare function convertRouteMatchToUiMatch(match: AgnosticDataRouteMatch
339
339
  /**
340
340
  * Returns a path with params interpolated.
341
341
  *
342
- * @see https://reactrouter.com/utils/generate-path
342
+ * @see https://reactrouter.com/v6/utils/generate-path
343
343
  */
344
344
  export declare function generatePath<Path extends string>(originalPath: Path, params?: {
345
345
  [key in PathParam<Path>]: string | null;
@@ -389,7 +389,7 @@ export interface PathMatch<ParamKey extends string = string> {
389
389
  * Performs pattern matching on a URL pathname and returns information about
390
390
  * the match.
391
391
  *
392
- * @see https://reactrouter.com/utils/match-path
392
+ * @see https://reactrouter.com/v6/utils/match-path
393
393
  */
394
394
  export declare function matchPath<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamKey> | null;
395
395
  export declare function decodePath(value: string): string;
@@ -400,7 +400,7 @@ export declare function stripBasename(pathname: string, basename: string): strin
400
400
  /**
401
401
  * Returns a resolved path object relative to the given pathname.
402
402
  *
403
- * @see https://reactrouter.com/utils/resolve-path
403
+ * @see https://reactrouter.com/v6/utils/resolve-path
404
404
  */
405
405
  export declare function resolvePath(to: To, fromPathname?: string): Path;
406
406
  /**
@@ -456,6 +456,9 @@ export type JsonFunction = <Data>(data: Data, init?: number | ResponseInit) => R
456
456
  /**
457
457
  * This is a shortcut for creating `application/json` responses. Converts `data`
458
458
  * to JSON and sets the `Content-Type` header.
459
+ *
460
+ * @deprecated The `json` method is deprecated in favor of returning raw objects.
461
+ * This method will be removed in v7.
459
462
  */
460
463
  export declare const json: JsonFunction;
461
464
  export declare class DataWithResponseInit<D> {
@@ -497,6 +500,10 @@ export declare class DeferredData {
497
500
  get pendingKeys(): string[];
498
501
  }
499
502
  export type DeferFunction = (data: Record<string, unknown>, init?: number | ResponseInit) => DeferredData;
503
+ /**
504
+ * @deprecated The `defer` method is deprecated in favor of returning raw
505
+ * objects. This method will be removed in v7.
506
+ */
500
507
  export declare const defer: DeferFunction;
501
508
  export type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
502
509
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix-run/router",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Nested/Data-driven/Framework-agnostic Routing",
5
5
  "keywords": [
6
6
  "remix",
package/utils.ts CHANGED
@@ -510,7 +510,7 @@ export function convertRoutesToDataRoutes(
510
510
  /**
511
511
  * Matches the given routes to a location and returns the match data.
512
512
  *
513
- * @see https://reactrouter.com/utils/match-routes
513
+ * @see https://reactrouter.com/v6/utils/match-routes
514
514
  */
515
515
  export function matchRoutes<
516
516
  RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject
@@ -863,7 +863,7 @@ function matchRouteBranch<
863
863
  /**
864
864
  * Returns a path with params interpolated.
865
865
  *
866
- * @see https://reactrouter.com/utils/generate-path
866
+ * @see https://reactrouter.com/v6/utils/generate-path
867
867
  */
868
868
  export function generatePath<Path extends string>(
869
869
  originalPath: Path,
@@ -969,7 +969,7 @@ type Mutable<T> = {
969
969
  * Performs pattern matching on a URL pathname and returns information about
970
970
  * the match.
971
971
  *
972
- * @see https://reactrouter.com/utils/match-path
972
+ * @see https://reactrouter.com/v6/utils/match-path
973
973
  */
974
974
  export function matchPath<
975
975
  ParamKey extends ParamParseKey<Path>,
@@ -1129,7 +1129,7 @@ export function stripBasename(
1129
1129
  /**
1130
1130
  * Returns a resolved path object relative to the given pathname.
1131
1131
  *
1132
- * @see https://reactrouter.com/utils/resolve-path
1132
+ * @see https://reactrouter.com/v6/utils/resolve-path
1133
1133
  */
1134
1134
  export function resolvePath(to: To, fromPathname = "/"): Path {
1135
1135
  let {
@@ -1366,6 +1366,9 @@ export type JsonFunction = <Data>(
1366
1366
  /**
1367
1367
  * This is a shortcut for creating `application/json` responses. Converts `data`
1368
1368
  * to JSON and sets the `Content-Type` header.
1369
+ *
1370
+ * @deprecated The `json` method is deprecated in favor of returning raw objects.
1371
+ * This method will be removed in v7.
1369
1372
  */
1370
1373
  export const json: JsonFunction = (data, init = {}) => {
1371
1374
  let responseInit = typeof init === "number" ? { status: init } : init;
@@ -1604,6 +1607,10 @@ export type DeferFunction = (
1604
1607
  init?: number | ResponseInit
1605
1608
  ) => DeferredData;
1606
1609
 
1610
+ /**
1611
+ * @deprecated The `defer` method is deprecated in favor of returning raw
1612
+ * objects. This method will be removed in v7.
1613
+ */
1607
1614
  export const defer: DeferFunction = (data, init = {}) => {
1608
1615
  let responseInit = typeof init === "number" ? { status: init } : init;
1609
1616