From 69ba50e06633fd4add234fb47f2d49b0a5ee41f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:33:13 -0500 Subject: [PATCH] chore: Update version for release (#11114) --- .changeset/catch-unwrap-error.md | 5 - .changeset/empty-ligers-walk.md | 6 - .changeset/handle-falsy-errors.md | 5 - .changeset/lemon-rivers-battle.md | 5 - .changeset/partial-hydration-data.md | 44 ------ .changeset/pre.json | 21 --- .changeset/pretty-dolphins-relax.md | 5 - .changeset/relative-splat-path.md | 138 ------------------ .changeset/serious-rivers-rest.md | 7 - CHANGELOG.md | 132 +---------------- .../react-router-dom-v5-compat/CHANGELOG.md | 30 +--- .../react-router-dom-v5-compat/package.json | 4 +- packages/react-router-dom/CHANGELOG.md | 31 +--- packages/react-router-dom/package.json | 6 +- packages/react-router-native/CHANGELOG.md | 25 +--- packages/react-router-native/package.json | 4 +- packages/react-router/CHANGELOG.md | 20 +-- packages/react-router/package.json | 4 +- packages/router/CHANGELOG.md | 8 +- packages/router/package.json | 2 +- 20 files changed, 27 insertions(+), 475 deletions(-) delete mode 100644 .changeset/catch-unwrap-error.md delete mode 100644 .changeset/empty-ligers-walk.md delete mode 100644 .changeset/handle-falsy-errors.md delete mode 100644 .changeset/lemon-rivers-battle.md delete mode 100644 .changeset/partial-hydration-data.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/pretty-dolphins-relax.md delete mode 100644 .changeset/relative-splat-path.md delete mode 100644 .changeset/serious-rivers-rest.md diff --git a/.changeset/catch-unwrap-error.md b/.changeset/catch-unwrap-error.md deleted file mode 100644 index 1a89d4b35c..0000000000 --- a/.changeset/catch-unwrap-error.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -Catch and bubble errors thrown when trying to unwrap responses from `loader`/`action` functions diff --git a/.changeset/empty-ligers-walk.md b/.changeset/empty-ligers-walk.md deleted file mode 100644 index f773425915..0000000000 --- a/.changeset/empty-ligers-walk.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router-dom": patch -"react-router": patch ---- - -[REMOVE] Fix plumbing of future flags diff --git a/.changeset/handle-falsy-errors.md b/.changeset/handle-falsy-errors.md deleted file mode 100644 index 59a5b8b6e5..0000000000 --- a/.changeset/handle-falsy-errors.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -Properly handle falsy error values in ErrorBoundary's diff --git a/.changeset/lemon-rivers-battle.md b/.changeset/lemon-rivers-battle.md deleted file mode 100644 index 51448fdbb3..0000000000 --- a/.changeset/lemon-rivers-battle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom": patch ---- - -[Remove] Fix server future plumbing diff --git a/.changeset/partial-hydration-data.md b/.changeset/partial-hydration-data.md deleted file mode 100644 index b5c7157022..0000000000 --- a/.changeset/partial-hydration-data.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -"@remix-run/router": minor ---- - -Added a new `future.v7_partialHydration` future flag that enables partial hydration of a data router when Server-Side Rendering. This allows you to provide `hydrationData.loaderData` that has values for _some_ initially matched route loaders, but not all. When this flag is enabled, the router will call `loader` functions for routes that do not have hydration loader data during `router.initialize()`, and it will render down to the deepest provided `HydrateFallback` (up to the first route without hydration data) while it executes the unhydrated routes. - -For example, the following router has a `root` and `index` route, but only provided `hydrationData.loaderData` for the `root` route. Because the `index` route has a `loader`, we need to run that during initialization. With `future.v7_partialHydration` specified, `` will render the `RootComponent` (because it has data) and then the `IndexFallback` (since it does not have data). Once `indexLoader` finishes, application will update and display `IndexComponent`. - -```jsx -let router = createBrowserRouter( - [ - { - id: "root", - path: "/", - loader: rootLoader, - Component: RootComponent, - Fallback: RootFallback, - children: [ - { - id: "index", - index: true, - loader: indexLoader, - Component: IndexComponent, - HydrateFallback: IndexFallback, - }, - ], - }, - ], - { - future: { - v7_partialHydration: true, - }, - hydrationData: { - loaderData: { - root: { message: "Hydrated from Root!" }, - }, - }, - } -); -``` - -If the above example did not have an `IndexFallback`, then `RouterProvider` would instead render the `RootFallback` while it executed the `indexLoader`. - -**Note:** When `future.v7_partialHydration` is provided, the `` prop is ignored since you can move it to a `Fallback` on your top-most route. The `fallbackElement` prop will be removed in React Router v7 when `v7_partialHydration` behavior becomes the standard behavior. diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 190ad1d6ad..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "mode": "exit", - "tag": "pre", - "initialVersions": { - "react-router": "6.20.1", - "react-router-dom": "6.20.1", - "react-router-dom-v5-compat": "6.20.1", - "react-router-native": "6.20.1", - "@remix-run/router": "1.13.1" - }, - "changesets": [ - "catch-unwrap-error", - "empty-ligers-walk", - "handle-falsy-errors", - "lemon-rivers-battle", - "partial-hydration-data", - "pretty-dolphins-relax", - "relative-splat-path", - "serious-rivers-rest" - ] -} diff --git a/.changeset/pretty-dolphins-relax.md b/.changeset/pretty-dolphins-relax.md deleted file mode 100644 index bd30b1c8ca..0000000000 --- a/.changeset/pretty-dolphins-relax.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -Fix `relative="path"` issue when rendering `Link`/`NavLink` outside of matched routes diff --git a/.changeset/relative-splat-path.md b/.changeset/relative-splat-path.md deleted file mode 100644 index 3bd6562348..0000000000 --- a/.changeset/relative-splat-path.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -"react-router-dom-v5-compat": minor -"react-router-native": minor -"react-router-dom": minor -"react-router": minor -"@remix-run/router": minor ---- - -Add a new `future.v7_relativeSplatPath` flag to implement a breaking bug fix to relative routing when inside a splat route. - -This fix was originally added in [#10983](https://github.com/remix-run/react-router/issues/10983) and was later reverted in [#11078](https://github.com/remix-run/react-router/pull/11078) because it was determined that a large number of existing applications were relying on the buggy behavior (see [#11052](https://github.com/remix-run/react-router/issues/11052)) - -**The Bug** -The buggy behavior is that without this flag, the default behavior when resolving relative paths is to _ignore_ any splat (`*`) portion of the current route path. - -**The Background** -This decision was originally made thinking that it would make the concept of nested different sections of your apps in `` easier if relative routing would _replace_ the current splat: - -```jsx - - - } /> - } /> - - -``` - -Any paths like `/dashboard`, `/dashboard/team`, `/dashboard/projects` will match the `Dashboard` route. The dashboard component itself can then render nested ``: - -```jsx -function Dashboard() { - return ( -
-

Dashboard

- - - - } /> - } /> - } /> - -
- ); -} -``` - -Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the `Dashboard` as its own independent app, or embed it into your large app without making any changes to it. - -**The Problem** - -The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that `"."` always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using `"."`: - -```jsx -// If we are on URL /dashboard/team, and we want to link to /dashboard/team: -function DashboardTeam() { - // ❌ This is broken and results in - return A broken link to the Current URL; - - // ✅ This is fixed but super unintuitive since we're already at /dashboard/team! - return A broken link to the Current URL; -} -``` - -We've also introduced an issue that we can no longer move our `DashboardTeam` component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as `/dashboard/:widget`. Now, our `"."` links will, properly point to ourself _inclusive of the dynamic param value_ so behavior will break from it's corresponding usage in a `/dashboard/*` route. - -Even worse, consider a nested splat route configuration: - -```jsx - - - - } /> - - - -``` - -Now, a `` and a `` inside the `Dashboard` component go to the same place! That is definitely not correct! - -Another common issue arose in Data Routers (and Remix) where any `
` should post to it's own route `action` if you the user doesn't specify a form action: - -```jsx -let router = createBrowserRouter({ - path: "/dashboard", - children: [ - { - path: "*", - action: dashboardAction, - Component() { - // ❌ This form is broken! It throws a 405 error when it submits because - // it tries to submit to /dashboard (without the splat value) and the parent - // `/dashboard` route doesn't have an action - return ...
; - }, - }, - ], -}); -``` - -This is just a compounded issue from the above because the default location for a `Form` to submit to is itself (`"."`) - and if we ignore the splat portion, that now resolves to the parent route. - -**The Solution** -If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage `../` for any links to "sibling" pages: - -```jsx - - - - } /> - - - - -function Dashboard() { - return ( -
-

Dashboard

- - - - } /> - } /> - } /> - -
- ); -} -``` - -This way, `.` means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and `..` always means "my parents pathname". diff --git a/.changeset/serious-rivers-rest.md b/.changeset/serious-rivers-rest.md deleted file mode 100644 index d72f2ac912..0000000000 --- a/.changeset/serious-rivers-rest.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router-dom": patch -"react-router": patch -"@remix-run/router": patch ---- - -[REMOVE] Refactor internals for partial hydration diff --git a/CHANGELOG.md b/CHANGELOG.md index f863922bbf..4aa0546c77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [v6.21.0](#v6210) - [What's Changed](#whats-changed) - [`future.v7_relativeSplatPath`](#futurev7_relativesplatpath) + - [Partial Hydration](#partial-hydration) - [Minor Changes](#minor-changes) - [Patch Changes](#patch-changes) - [v6.20.1](#v6201) @@ -165,139 +166,18 @@ To add a new release, copy from this template: We fixed a splat route path-resolution bug in `6.19.0`, but later determined a large number of applications were relying on the buggy behavior, so we reverted the fix in `6.20.1` (see [#10983](https://github.com/remix-run/react-router/issues/10983), [#11052](https://github.com/remix-run/react-router/issues/11052), [#11078](https://github.com/remix-run/react-router/issues/11078)). -The buggy behavior is that the default behavior when resolving relative paths inside a splat route would _ignore_ any splat (`*`) portion of the current route path. +The buggy behavior is that the default behavior when resolving relative paths inside a splat route would _ignore_ any splat (`*`) portion of the current route path. When the future flag is enabled, splat portions are included in relative path logic within splat routes. -**Background** +For more information, please refer to the [`useResolvedPath` docs](https://reactrouter.com/hooks/use-resolved-path#splat-paths) and/or the [detailed changelog entry](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md#6210). -This decision was originally made thinking that it would make the concept of nested different sections of your apps in `` easier if relative routing would _replace_ the current splat: +#### Partial Hydration -```jsx - - - } /> - } /> - - -``` - -Any paths like `/dashboard`, `/dashboard/team`, `/dashboard/projects` will match the `Dashboard` route. The dashboard component itself can then render nested ``: - -```jsx -function Dashboard() { - return ( -
-

Dashboard

- - - - } /> - } /> - } /> - -
- ); -} -``` - -Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the `Dashboard` as its own independent app, or embed it into your large app without making any changes to it. - -**The Problem** - -The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that `"."` always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using `"."`: - -```jsx -// If we are on URL /dashboard/team, and we want to link to /dashboard/team: -function DashboardTeam() { - // ❌ This is broken and results in
- return A broken link to the Current URL; - - // ✅ This is fixed but super unintuitive since we're already at /dashboard/team! - return A broken link to the Current URL; -} -``` - -We've also introduced an issue that we can no longer move our `DashboardTeam` component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as `/dashboard/:widget`. Now, our `"."` links will, properly point to ourself _inclusive of the dynamic param value_ so behavior will break from it's corresponding usage in a `/dashboard/*` route. - -Furthermore, consider a nested splat route configuration: - -```jsx - - - - } /> - - - -``` - -Now, a `` and a `` inside the `Dashboard` component go to the same place! That is definitely not correct! - -Another common issue arose in Data Routers (and Remix) where any `
` should post to it's own route `action` if you the user doesn't specify a form action: - -```jsx -let router = createBrowserRouter({ - path: "/dashboard", - children: [ - { - path: "*", - action: dashboardAction, - Component() { - // ❌ This form is broken! It throws a 405 error when it submits because - // it tries to submit to /dashboard (without the splat value) and the parent - // `/dashboard` route doesn't have an action - return ...
; - }, - }, - ], -}); -``` - -This is just a compounded issue from the above because the default location for a `Form` to submit to is itself (`"."`) - and if we ignore the splat portion, that now resolves to the parent route. - -**The Solution** - -If you are leveraging this behavior, it's recommended to enable the `future.v7_relativeSplatPath` flag, move your splat to it's own `Route`, and leverage `../` for any links to "sibling" pages: - -```jsx - - - - } /> - - - - -function Dashboard() { - return ( -
-

Dashboard

- - - - } /> - } /> - } /> - -
- ); -} -``` - -This way, `.` means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and `..` always means "my parents pathname". - -For more information, please see the [`useResolvedPath` docs](https://reactrouter.com/hooks/use-resolved-path#splat-paths). +We added a new `future.v7_partialHydration` future flag for the `@remix-run/router` that enables partial hydration of a data router when Server-Side Rendering. This allows you to provide `hydrationData.loaderData` that has values for _some_ initially matched route loaders, but not all. When this flag is enabled, the router will call `loader` functions for routes that do not have hydration loader data during `router.initialize()`, and it will render down to the deepest provided `HydrateFallback` (up to the first route without hydration data) while it executes the unhydrated routes. ([#11033](https://github.com/remix-run/react-router/pull/11033)) ### Minor Changes - Add a new `future.v7_relativeSplatPath` flag to implement a breaking bug fix to relative routing when inside a splat route. ([#11087](https://github.com/remix-run/react-router/pull/11087)) +- Add a new `future.v7_partialHydration` future flag that enables partial hydration of a data router when Server-Side Rendering ([#11033](https://github.com/remix-run/react-router/pull/11033)) ### Patch Changes diff --git a/packages/react-router-dom-v5-compat/CHANGELOG.md b/packages/react-router-dom-v5-compat/CHANGELOG.md index 89df35c141..8c1fdd5ef3 100644 --- a/packages/react-router-dom-v5-compat/CHANGELOG.md +++ b/packages/react-router-dom-v5-compat/CHANGELOG.md @@ -1,30 +1,6 @@ # `react-router-dom-v5-compat` -## 6.21.0-pre.3 - -### Patch Changes - -- Updated dependencies: - - `react-router-dom@6.21.0-pre.3` - - `react-router@6.21.0-pre.3` - -## 6.21.0-pre.2 - -### Patch Changes - -- Updated dependencies: - - `react-router-dom@6.21.0-pre.2` - - `react-router@6.21.0-pre.2` - -## 6.21.0-pre.1 - -### Patch Changes - -- Updated dependencies: - - `react-router-dom@6.21.0-pre.1` - - `react-router@6.21.0-pre.1` - -## 6.21.0-pre.0 +## 6.21.0 ### Minor Changes @@ -162,8 +138,8 @@ ### Patch Changes - Updated dependencies: - - `react-router@6.21.0-pre.0` - - `react-router-dom@6.21.0-pre.0` + - `react-router-dom@6.21.0` + - `react-router@6.21.0` ## 6.20.1 diff --git a/packages/react-router-dom-v5-compat/package.json b/packages/react-router-dom-v5-compat/package.json index d072ad2203..5c99ce9aec 100644 --- a/packages/react-router-dom-v5-compat/package.json +++ b/packages/react-router-dom-v5-compat/package.json @@ -1,6 +1,6 @@ { "name": "react-router-dom-v5-compat", - "version": "6.21.0-pre.3", + "version": "6.21.0", "description": "Migration path to React Router v6 from v4/5", "keywords": [ "react", @@ -24,7 +24,7 @@ "types": "./dist/index.d.ts", "dependencies": { "history": "^5.3.0", - "react-router": "6.21.0-pre.3" + "react-router": "6.21.0" }, "peerDependencies": { "react": ">=16.8", diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index 70f5c77758..1095a506c5 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -1,31 +1,6 @@ # `react-router-dom` -## 6.21.0-pre.3 - -### Patch Changes - -- [REMOVE] Refactor internals for partial hydration ([#11094](https://github.com/remix-run/react-router/pull/11094)) -- Updated dependencies: - - `react-router@6.21.0-pre.3` - - `@remix-run/router@1.14.0-pre.1` - -## 6.21.0-pre.2 - -### Patch Changes - -- [Remove] Fix server future plumbing ([`f9d7ed62`](https://github.com/remix-run/react-router/commit/f9d7ed62904766013d05a1642232d73e47f3bc27)) -- Updated dependencies: - - `react-router@6.21.0-pre.2` - -## 6.21.0-pre.1 - -### Patch Changes - -- [REMOVE] Fix plumbing of future flags ([`558d7936`](https://github.com/remix-run/react-router/commit/558d7936cc8fe643374a2c9a9fdcf022e8c4c939)) -- Updated dependencies: - - `react-router@6.21.0-pre.1` - -## 6.21.0-pre.0 +## 6.21.0 ### Minor Changes @@ -163,8 +138,8 @@ ### Patch Changes - Updated dependencies: - - `@remix-run/router@1.14.0-pre.0` - - `react-router@6.21.0-pre.0` + - `@remix-run/router@1.14.0` + - `react-router@6.21.0` ## 6.20.1 diff --git a/packages/react-router-dom/package.json b/packages/react-router-dom/package.json index a1b231f634..ff0b4cb2e7 100644 --- a/packages/react-router-dom/package.json +++ b/packages/react-router-dom/package.json @@ -1,6 +1,6 @@ { "name": "react-router-dom", - "version": "6.21.0-pre.3", + "version": "6.21.0", "description": "Declarative routing for React web applications", "keywords": [ "react", @@ -23,8 +23,8 @@ "module": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@remix-run/router": "1.14.0-pre.1", - "react-router": "6.21.0-pre.3" + "@remix-run/router": "1.14.0", + "react-router": "6.21.0" }, "devDependencies": { "react": "^18.2.0", diff --git a/packages/react-router-native/CHANGELOG.md b/packages/react-router-native/CHANGELOG.md index e5592bc82f..f733affd5e 100644 --- a/packages/react-router-native/CHANGELOG.md +++ b/packages/react-router-native/CHANGELOG.md @@ -1,27 +1,6 @@ # `react-router-native` -## 6.21.0-pre.3 - -### Patch Changes - -- Updated dependencies: - - `react-router@6.21.0-pre.3` - -## 6.21.0-pre.2 - -### Patch Changes - -- Updated dependencies: - - `react-router@6.21.0-pre.2` - -## 6.21.0-pre.1 - -### Patch Changes - -- Updated dependencies: - - `react-router@6.21.0-pre.1` - -## 6.21.0-pre.0 +## 6.21.0 ### Minor Changes @@ -159,7 +138,7 @@ ### Patch Changes - Updated dependencies: - - `react-router@6.21.0-pre.0` + - `react-router@6.21.0` ## 6.20.1 diff --git a/packages/react-router-native/package.json b/packages/react-router-native/package.json index cc8c0c33d9..619c72121c 100644 --- a/packages/react-router-native/package.json +++ b/packages/react-router-native/package.json @@ -1,6 +1,6 @@ { "name": "react-router-native", - "version": "6.21.0-pre.3", + "version": "6.21.0", "description": "Declarative routing for React Native applications", "keywords": [ "react", @@ -22,7 +22,7 @@ "types": "./dist/index.d.ts", "dependencies": { "@ungap/url-search-params": "^0.2.2", - "react-router": "6.21.0-pre.3" + "react-router": "6.21.0" }, "devDependencies": { "react": "^18.2.0", diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index ebc149fc21..23536881b2 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -1,22 +1,6 @@ # `react-router` -## 6.21.0-pre.3 - -### Patch Changes - -- [REMOVE] Refactor internals for partial hydration ([#11094](https://github.com/remix-run/react-router/pull/11094)) -- Updated dependencies: - - `@remix-run/router@1.14.0-pre.1` - -## 6.21.0-pre.2 - -## 6.21.0-pre.1 - -### Patch Changes - -- [REMOVE] Fix plumbing of future flags ([`558d7936`](https://github.com/remix-run/react-router/commit/558d7936cc8fe643374a2c9a9fdcf022e8c4c939)) - -## 6.21.0-pre.0 +## 6.21.0 ### Minor Changes @@ -155,7 +139,7 @@ - Properly handle falsy error values in ErrorBoundary's ([#11071](https://github.com/remix-run/react-router/pull/11071)) - Updated dependencies: - - `@remix-run/router@1.14.0-pre.0` + - `@remix-run/router@1.14.0` ## 6.20.1 diff --git a/packages/react-router/package.json b/packages/react-router/package.json index e78f911482..b3073ecd92 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "6.21.0-pre.3", + "version": "6.21.0", "description": "Declarative routing for React", "keywords": [ "react", @@ -23,7 +23,7 @@ "module": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@remix-run/router": "1.14.0-pre.1" + "@remix-run/router": "1.14.0" }, "devDependencies": { "react": "^18.2.0" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index c107001b47..821fe0aa56 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -1,12 +1,6 @@ # `@remix-run/router` -## 1.14.0-pre.1 - -### Patch Changes - -- [REMOVE] Refactor internals for partial hydration ([#11094](https://github.com/remix-run/react-router/pull/11094)) - -## 1.14.0-pre.0 +## 1.14.0 ### Minor Changes diff --git a/packages/router/package.json b/packages/router/package.json index 2009208641..1e4fdd17eb 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/router", - "version": "1.14.0-pre.1", + "version": "1.14.0", "description": "Nested/Data-driven/Framework-agnostic Routing", "keywords": [ "remix",