Skip to content

Feature: Removing React from the default @apollo/client entry point #8190

Closed
@hwillson

Description

Apollo Client 3.0 streamlined our client codebases by merging React Apollo and Apollo Link directly into the Apollo Client core. As part of this stepping stone work, we wanted to ensure that React developers adopting Apollo were able to get up and running quickly. To this end, we made our React hooks available from the default @apollo/client entry point. People using Apollo Client that don't want to use React can use the @apollo/client/core entry point instead, which ensures that our React code is tree-shakable.

For Apollo Client 4.0 however, we would like to switch things around so @apollo/client by itself gives access to the Apollo Client core only, and importing from @apollo/client/react will be required to get access to our React hooks. Doing this allows us to make certain assumptions about how people are using Apollo Client and optimize accordingly. It also opens up the possibility of leveraging other view layer integrations.

This work will include:

  • Adjusting @apollo/client and @apollo/client/react accordingly
  • Writing a codemod to help with migration (maybe)
  • Writing a migration guide
  • Updating all AC React docs

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions