react-apollo v4.0.0 Release Notes
Release Date: 2020-07-20 // over 4 years ago-
๐ > โ ๏ธ Deprecation Notice โ ๏ธ
โก๏ธ > 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'sgraphql
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.๐ฅ Breaking Changes
React Apollo 4.0.0 only works with
@apollo/client
3.x; it does not work withapollo-client
2.x. If you are usingapollo-client
and are not ready to update to@apollo/client
, please use React Apollo 3.x.โ Due to changes made in Apollo Client, the previous SSR testing pattern of:
return getDataFromTree(app).then(() => { const markup = ReactDOM.renderToString(app); expect(markup).toMatch(/Waldo/); });
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 whengetDataFromTree
's Promise resolves:return getDataFromTree(app).then(markup => { expect(markup).toMatch(/Waldo/); });
- ๐ We are no longer building UMD versions of React Apollo.
๐ Improvements
- ๐ฆ The React Apollo project now uses
@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
.
Previous changes from v4.0.0-beta.2
-
2020-07-10