react-apollo v4.0.0 Release Notes

Release Date: 2020-07-20 // almost 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'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.

    ๐Ÿ’ฅ Breaking Changes

    • 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.

    • โœ… Due to changes made in Apollo Client, the previous SSR testing pattern of:

      return getDataFromTree(app).then(() => {
        const markup = ReactDOM.renderToString(app);

    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:

      return getDataFromTree(app).then(markup => {
    • ๐Ÿ— 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