@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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # `@remix-run/router`
2
2
 
3
+ ## 1.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - - Log deprecation warnings for v7 flags ([#11750](https://github.com/remix-run/react-router/pull/11750))
8
+ - Add deprecation warnings to `json`/`defer` in favor of returning raw objects
9
+ - These methods will be removed in React Router v7
10
+
11
+ ### Patch Changes
12
+
13
+ - Update JSDoc URLs for new website structure (add /v6/ segment) ([#12141](https://github.com/remix-run/react-router/pull/12141))
14
+
3
15
  ## 1.20.0
4
16
 
5
17
  ### Minor Changes
@@ -104,7 +116,7 @@
104
116
  - Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
105
117
 
106
118
  - RFC: <https://github.com/remix-run/react-router/discussions/11113>
107
- - `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/en/main/routers/create-browser-router>
119
+ - `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/v6/routers/create-browser-router>
108
120
 
109
121
  ## 1.16.1
110
122
 
@@ -581,7 +593,7 @@
581
593
 
582
594
  ### Minor Changes
583
595
 
584
- - Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
596
+ - Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
585
597
 
586
598
  - When `future.v7_normalizeFormMethod === false` (default v6 behavior),
587
599
  - `useNavigation().formMethod` is lowercase
@@ -839,6 +851,6 @@ function Comp() {
839
851
 
840
852
  This is the first stable release of `@remix-run/router`, which provides all the underlying routing and data loading/mutation logic for `react-router`. You should _not_ be using this package directly unless you are authoring a routing library similar to `react-router`.
841
853
 
842
- For an overview of the features provided by `react-router`, we recommend you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial).
854
+ For an overview of the features provided by `react-router`, we recommend you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial).
843
855
 
844
856
  For an overview of the features provided by `@remix-run/router`, please check out the [`README`](./README.md).
package/README.md CHANGED
@@ -131,5 +131,5 @@ We use _Future Flags_ in the router to help us introduce breaking changes in an
131
131
  [remix]: https://remix.run
132
132
  [react-router-repo]: https://github.com/remix-run/react-router
133
133
  [remix-routers-repo]: https://github.com/brophdawg11/remix-routers
134
- [api-development-strategy]: https://reactrouter.com/en/main/guides/api-development-strategy
134
+ [api-development-strategy]: https://reactrouter.com/v6/guides/api-development-strategy
135
135
  [future-flags-post]: https://remix.run/blog/future-flags
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.20.0
2
+ * @remix-run/router v1.21.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -744,7 +744,7 @@ function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manif
744
744
  /**
745
745
  * Matches the given routes to a location and returns the match data.
746
746
  *
747
- * @see https://reactrouter.com/utils/match-routes
747
+ * @see https://reactrouter.com/v6/utils/match-routes
748
748
  */
749
749
  function matchRoutes(routes, locationArg, basename) {
750
750
  if (basename === void 0) {
@@ -977,7 +977,7 @@ function matchRouteBranch(branch, pathname, allowPartial) {
977
977
  /**
978
978
  * Returns a path with params interpolated.
979
979
  *
980
- * @see https://reactrouter.com/utils/generate-path
980
+ * @see https://reactrouter.com/v6/utils/generate-path
981
981
  */
982
982
  function generatePath(originalPath, params) {
983
983
  if (params === void 0) {
@@ -1029,7 +1029,7 @@ function generatePath(originalPath, params) {
1029
1029
  * Performs pattern matching on a URL pathname and returns information about
1030
1030
  * the match.
1031
1031
  *
1032
- * @see https://reactrouter.com/utils/match-path
1032
+ * @see https://reactrouter.com/v6/utils/match-path
1033
1033
  */
1034
1034
  function matchPath(pattern, pathname) {
1035
1035
  if (typeof pattern === "string") {
@@ -1144,7 +1144,7 @@ function stripBasename(pathname, basename) {
1144
1144
  /**
1145
1145
  * Returns a resolved path object relative to the given pathname.
1146
1146
  *
1147
- * @see https://reactrouter.com/utils/resolve-path
1147
+ * @see https://reactrouter.com/v6/utils/resolve-path
1148
1148
  */
1149
1149
  function resolvePath(to, fromPathname) {
1150
1150
  if (fromPathname === void 0) {
@@ -1310,6 +1310,9 @@ const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#")
1310
1310
  /**
1311
1311
  * This is a shortcut for creating `application/json` responses. Converts `data`
1312
1312
  * to JSON and sets the `Content-Type` header.
1313
+ *
1314
+ * @deprecated The `json` method is deprecated in favor of returning raw objects.
1315
+ * This method will be removed in v7.
1313
1316
  */
1314
1317
  const json = function json(data, init) {
1315
1318
  if (init === void 0) {
@@ -1483,6 +1486,10 @@ function unwrapTrackedPromise(value) {
1483
1486
  }
1484
1487
  return value._data;
1485
1488
  }
1489
+ /**
1490
+ * @deprecated The `defer` method is deprecated in favor of returning raw
1491
+ * objects. This method will be removed in v7.
1492
+ */
1486
1493
  const defer = function defer(data, init) {
1487
1494
  if (init === void 0) {
1488
1495
  init = {};