apollographql / apollo-client

:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
https://apollographql.com/client
MIT License
19.4k stars 2.66k forks source link

React 19 has updated this SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED #12017

Open FlevianK opened 3 months ago

FlevianK commented 3 months ago

Issue Description

We are preparing for react 19 usage but we are block because of this https://github.com/apollographql/apollo-client/blob/5a1985f30b99ab0592598ff9dc8b5216fef3ef34/src/testing/internal/profile/profile.tsx#L439

Which is clearly stated here https://react.dev/blog/2024/04/25/react-19-upgrade-guide#libraries-depending-on-react-internals-may-block-upgrades

Are we expecting the update soon?

Link to Reproduction

https://codesandbox.io/p/devbox/frosty-water-mgxmx4?file=%2Fpackage.json%3A6%2C20

Reproduction Steps

Using react 19

@apollo/client version

3.11.4

jerelmiller commented 3 months ago

Hey @FlevianK 👋

These are our internal testing utilities that we use for our Apollo Client React tests. Unless you're using these directly, then that internal variable usage shouldn't matter. This code is not bundled with the core library.

I'm able to run the reproduction you created with React 19 just fine and see no errors anywhere. Can you explain more in detail what you're blocked by here?

phryneas commented 3 months ago

Normal usage of Apollo Client should not cause any problems with SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED since v3.10.1 (via #11803), which we released back in April.

Any traces of it beyond that in user-facing code have been removed with v3.10.5 (via #11888) in June.

All that's left is our internal usage, and as long as your userland code doesnt import from "@apollo/client/testing/internal" (please don't! the internal in the name is there for a reason), you should not be facing any problems.

Did you maybe try this out with an older version of Apollo Client initially?