Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 1708124

Browse files
authored
Merge pull request #4037 from apollographql/export-from-ac
Re-export all React Apollo functionality from @apollo/client
2 parents 2cfa726 + 7b5cff8 commit 1708124

File tree

207 files changed

+1293
-32262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1293
-32262
lines changed

.circleci/config.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

Changelog.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
> ⚠️ **Deprecation Notice** ⚠️
66
>
7-
> Please note that as of version 4.0.0 you should prefer to import React hooks and testing utilities from `@apollo/client`. While we still have separate `@apollo/react-hooks` and `@apollo/react-testing` packages for ease of migration, they are no longer under active development, as they simply re-export from `@apollo/client`. React Apollo's `graphql` HOC (`@apollo/react-hoc`) and render proper components (`@apollo/react-components`) are in maintenance mode, meaning they will continue to receive important bug fixes, but will not be updated with new functionality.
7+
> Please note that this is the final version of all React Apollo packages, and that this repository is going to be archived. React Apollo functionality is now directly available from `@apollo/client` >= 3. While using the `@apollo/react-X` packages will still work, we recommend using the following imports from `@apollo/client` directly instead:
8+
>
9+
> - old: `@apollo/react-components` --> new: `@apollo/client/react/components`
10+
> - old: `@apollo/react-hoc` --> new: `@apollo/client/react/hoc`
11+
> - old: `@apollo/react-ssr` --> new: `@apollo/client/react/ssr`
12+
> - old: `@apollo/react-testing` --> new: `@apollo/client/testing`
13+
> - old: `@apollo/react-hooks` --> new: `@apollo/client`
814
915
### Breaking Changes
1016

11-
- **React Apollo 4.0.0 only works with `@apollo/client` 3.x; it does not work with `apollo-client` 2.x.** If you are using `apollo-client` and are not ready to update to `@apollo/client`, please use React Apollo 3.x.
17+
- **React Apollo 4.0.0 is dependent on `@apollo/client` >= 3.** If you are using `apollo-client` 2.x and are not ready to update to `@apollo/client`, please use React Apollo 3.x.
18+
19+
- The `react-apollo` package has been fully removed. Please use `@apollo/client` or `@apollo/react-X` packages directly. <br/>
20+
[@hwillson](https://github.com/hwillson) in [#4037](https://github.com/apollographql/react-apollo/pull/4037)
1221

1322
- Due to changes made in Apollo Client, the previous SSR testing pattern of:
1423

@@ -22,17 +31,13 @@
2231
will no longer work (`ReactDOM.renderToString(app)` will just return the initial loading state of the component under test). Instead, we can leverage the markup returned when `getDataFromTree`'s Promise resolves:
2332

2433
```js
25-
return getDataFromTree(app).then(markup => {
34+
return getDataFromTree(app).then((markup) => {
2635
expect(markup).toMatch(/Waldo/);
2736
});
2837
```
2938

3039
- We are no longer building UMD versions of React Apollo.
3140

32-
### Improvements
33-
34-
- The React Apollo project now uses [`@apollo/client`](https://github.com/apollographql/apollo-client), which means it no longer houses Apollo's React hooks or testing utilities. `@apollo/react-hooks` and `@apollo/react-testing` can continue to be used, but their functionality is now re-exported from the `@apollo/client` package. If you're only using Apollo's React hooks, we recommend using `@apollo/client` directly, and dropping your dependency on `@apollo/react-hooks`.
35-
3641
## 3.1.3 (2019-10-15)
3742

3843
- Revert the changes made in [#3497](https://github.com/apollographql/react-apollo/pull/3497), which have lead to problems with `onCompleted` being called more often than necessary. <br/>
@@ -1209,7 +1214,7 @@ import { getDataFromTree, renderToStringWithData } from 'react-apollo';
12091214
renderToStringWithData(component).then({ markup, initialState });
12101215

12111216
// new -- you must get it yourself
1212-
renderToStringWithData(component).then(markup => {
1217+
renderToStringWithData(component).then((markup) => {
12131218
const initialState = client.store.getState()[client.reduxRootKey];
12141219

12151220
// ...

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88

99
> ⚠️ **Deprecation Notice** ⚠️
1010
>
11-
> Please note that as of version 4.0.0 you should prefer to import React hooks and testing utilities from `@apollo/client`. While we still have separate `@apollo/react-hooks` and `@apollo/react-testing` packages for ease of migration, they are no longer under active development, as they simply re-export from `@apollo/client`. React Apollo's `graphql` HOC (`@apollo/react-hoc`) and render proper components (`@apollo/react-components`) are in maintenance mode, meaning they will continue to receive important bug fixes, but will not be updated with new functionality.
11+
> Please note that 4.0.0 is the final version of all React Apollo packages, and that this repository is going to be archived. React Apollo functionality is now directly available from `@apollo/client` >= 3. While using the `@apollo/react-X` packages will still work, we recommend using the following imports from `@apollo/client` directly instead:
12+
>
13+
> - old: `@apollo/react-components` --> new: `@apollo/client/react/components`
14+
> - old: `@apollo/react-hoc` --> new: `@apollo/client/react/hoc`
15+
> - old: `@apollo/react-ssr` --> new: `@apollo/client/react/ssr`
16+
> - old: `@apollo/react-testing` --> new: `@apollo/client/testing`
17+
> - old: `@apollo/react-hooks` --> new: `@apollo/client`
1218
1319
React Apollo allows you to fetch data from your GraphQL server and use it in building complex and reactive UIs using the React framework. React Apollo may be used in any context that React may be used. In the browser, in React Native, or in Node.js when you want to do server-side rendering.
1420

config/jest.cjs.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

config/jest.config.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

config/prettier.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/rollup.config.js

Lines changed: 0 additions & 144 deletions
This file was deleted.

examples/base/.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/base/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/base/package.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/base/public/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)