@remix-run/router 1.20.0-pre.1 → 1.21.0-pre.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,36 +1,41 @@
1
1
  # `@remix-run/router`
2
2
 
3
- ## 1.20.0-pre.1
3
+ ## 1.21.0-pre.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
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - Expose errors thrown from `patchRoutesOnNavigation` directly to `useRouteError` instead of wrapping them in a 400 `ErrorResponse` instance ([#12111](https://github.com/remix-run/react-router/pull/12111))
13
+ - Update JSDoc URLs for new website structure (add /v6/ segment) ([#12141](https://github.com/remix-run/react-router/pull/12141))
8
14
 
9
- ## 1.20.0-pre.0
15
+ ## 1.20.0
10
16
 
11
17
  ### Minor Changes
12
18
 
13
19
  - Stabilize `unstable_patchRoutesOnNavigation` ([#11973](https://github.com/remix-run/react-router/pull/11973))
20
+ - Add new `PatchRoutesOnNavigationFunctionArgs` type for convenience ([#11967](https://github.com/remix-run/react-router/pull/11967))
14
21
  - Stabilize `unstable_dataStrategy` ([#11974](https://github.com/remix-run/react-router/pull/11974))
15
22
  - Stabilize the `unstable_flushSync` option for navigations and fetchers ([#11989](https://github.com/remix-run/react-router/pull/11989))
16
23
  - Stabilize the `unstable_viewTransition` option for navigations and the corresponding `unstable_useViewTransitionState` hook ([#11989](https://github.com/remix-run/react-router/pull/11989))
17
24
 
18
25
  ### Patch Changes
19
26
 
20
- - - Fix bug when submitting to the current contextual route (parent route with an index child) when an `?index` param already exists from a prior submission ([#12003](https://github.com/remix-run/react-router/pull/12003))
21
- - Fix `useFormAction` bug - when removing `?index` param it would not keep other non-Remix `index` params
27
+ - Fix bug when submitting to the current contextual route (parent route with an index child) when an `?index` param already exists from a prior submission ([#12003](https://github.com/remix-run/react-router/pull/12003))
28
+ - Fix `useFormAction` bug - when removing `?index` param it would not keep other non-Remix `index` params ([#12003](https://github.com/remix-run/react-router/pull/12003))
22
29
  - Fix bug with fetchers not persisting `preventScrollReset` through redirects during concurrent fetches ([#11999](https://github.com/remix-run/react-router/pull/11999))
23
30
  - Remove internal cache to fix issues with interrupted `patchRoutesOnNavigation` calls ([#12055](https://github.com/remix-run/react-router/pull/12055))
24
-
25
31
  - We used to cache in-progress calls to `patchRoutesOnNavigation` internally so that multiple navigations with the same start/end would only execute the function once and use the same promise
26
32
  - However, this approach was at odds with `patch` short circuiting if a navigation was interrupted (and the `request.signal` aborted) since the first invocation's `patch` would no-op
27
33
  - This cache also made some assumptions as to what a valid cache key might be - and is oblivious to any other application-state changes that may have occurred
28
34
  - So, the cache has been removed because in _most_ cases, repeated calls to something like `import()` for async routes will already be cached automatically - and if not it's easy enough for users to implement this cache in userland
29
-
30
35
  - Avoid unnecessary `console.error` on fetcher abort due to back-to-back revalidation calls ([#12050](https://github.com/remix-run/react-router/pull/12050))
31
- - - Fix types for `RouteObject` within `PatchRoutesOnNavigationFunction`'s `patch` method so it doesn't expect agnostic route objects passed to `patch` ([#11967](https://github.com/remix-run/react-router/pull/11967))
32
- - Add new `PatchRoutesOnNavigationFunctionArgs` type for convenience
33
- - Fix bugs with partialHydration when hydrating with errors ([#12070](https://github.com/remix-run/react-router/pull/12070))
36
+ - Expose errors thrown from `patchRoutesOnNavigation` directly to `useRouteError` instead of wrapping them in a 400 `ErrorResponse` instance ([#12111](https://github.com/remix-run/react-router/pull/12111))
37
+ - Fix types for `RouteObject` within `PatchRoutesOnNavigationFunction`'s `patch` method so it doesn't expect agnostic route objects passed to `patch` ([#11967](https://github.com/remix-run/react-router/pull/11967))
38
+ - Fix bugs with `partialHydration` when hydrating with errors ([#12070](https://github.com/remix-run/react-router/pull/12070))
34
39
  - Remove internal `discoveredRoutes` FIFO queue from `unstable_patchRoutesOnNavigation` ([#11977](https://github.com/remix-run/react-router/pull/11977))
35
40
 
36
41
  ## 1.19.2
@@ -111,7 +116,7 @@
111
116
  - Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
112
117
 
113
118
  - RFC: <https://github.com/remix-run/react-router/discussions/11113>
114
- - `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/en/main/routers/create-browser-router>
119
+ - `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/v6/routers/create-browser-router>
115
120
 
116
121
  ## 1.16.1
117
122
 
@@ -588,7 +593,7 @@
588
593
 
589
594
  ### Minor Changes
590
595
 
591
- - 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))
592
597
 
593
598
  - When `future.v7_normalizeFormMethod === false` (default v6 behavior),
594
599
  - `useNavigation().formMethod` is lowercase
@@ -846,6 +851,6 @@ function Comp() {
846
851
 
847
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`.
848
853
 
849
- 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).
850
855
 
851
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-pre.1
2
+ * @remix-run/router v1.21.0-pre.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 = {};