Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/v4 remove hydration package #2936

Merged
merged 3 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/src/manifests/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
"title": "Migrating to React Query 3",
"path": "/guides/migrating-to-react-query-3",
"editUrl": "/guides/migrating-to-react-query-3.md"
},
{
"title": "Migrating to React Query 4",
"path": "/guides/migrating-to-react-query-4",
"editUrl": "/guides/migrating-to-react-query-4.md"
}
]
},
Expand Down Expand Up @@ -442,4 +447,4 @@
]
}
]
}
}
19 changes: 19 additions & 0 deletions docs/src/pages/guides/migrating-to-react-query-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: migrating-to-react-query-4
title: Migrating to React Query 4
---

## Breaking Changes

### Separate hydration exports have been removed

With version [3.22.0](https://github.com/tannerlinsley/react-query/releases/tag/v3.22.0), hydration utilities moved into the react-query core. With v3, you could still use the old exports from `react-query/hydration`, but these exports have been removed with v4.

```diff
- import { dehydrate, hydrate, useHydrate, Hydrate } from 'react-query/hydration'
+ import { dehydrate, hydrate, useHydrate, Hydrate } from 'react-query'
```




8 changes: 0 additions & 8 deletions docs/src/pages/reference/hydration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const dehydratedState = dehydrate(queryClient, {
})
```

> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `dehydrate` from `react-query/hydration`

**Options**

- `client: QueryClient`
Expand Down Expand Up @@ -72,8 +70,6 @@ import { hydrate } from 'react-query'
hydrate(queryClient, dehydratedState, options)
```

> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `hydrate` from `react-query/hydration`

**Options**

- `client: QueryClient`
Expand All @@ -99,8 +95,6 @@ import { useHydrate } from 'react-query'
useHydrate(dehydratedState, options)
```

> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `useHydrate` from `react-query/hydration`

**Options**

- `dehydratedState: DehydratedState`
Expand All @@ -123,8 +117,6 @@ function App() {
}
```

> Note: Since version `3.22.0` hydration utilities moved into to core. If you using lower version your should import `Hydrate` from `react-query/hydration`

**Options**

- `state: DehydratedState`
Expand Down
6 changes: 0 additions & 6 deletions hydration/package.json

This file was deleted.

1 change: 0 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const inputSrcs = [
['src/index.ts', 'ReactQuery', 'react-query'],
['src/core/index.ts', 'ReactQueryCore', 'react-query-core'],
['src/devtools/index.ts', 'ReactQueryDevtools', 'react-query-devtools'],
['src/hydration/index.ts', 'ReactQueryHydration', 'react-query-hydration'],
[
'src/persistQueryClient-experimental/index.ts',
'ReactQueryPersistQueryClientExperimental',
Expand Down
15 changes: 0 additions & 15 deletions src/hydration/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"files": [
"./src/index.ts",
"./src/hydration/index.ts",
"./src/devtools/index.ts",
"./src/persistQueryClient-experimental/index.ts",
"./src/createWebStoragePersistor-experimental/index.ts",
Expand Down