Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make useRenderGuard and profile work with React 19 #11795

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Tobbe
Copy link

@Tobbe Tobbe commented Apr 20, 2024

React 19 has changed the names of some internal variables. This PR updates the @apollo/client React integration to also support these new names.

The React changes were introduced here facebook/react@f613165

Also updating the version of @testing-library/react to a version that supports React 19.
Support was introduced in https://github.com/testing-library/react-testing-library/releases/tag/v14.3.0

@apollo-cla
Copy link

@Tobbe: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link

netlify bot commented Apr 20, 2024

👷 Deploy request for apollo-client-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 951ff42

Copy link

changeset-bot bot commented Apr 20, 2024

🦋 Changeset detected

Latest commit: 951ff42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Tobbe Tobbe marked this pull request as draft April 20, 2024 10:56
Comment on lines +4 to +8
const reactInternals =
(React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ||
(React as any)
.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
return reactInternals?.ReactCurrentDispatcher?.current;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that PR also fix the bundler issue you are encountering?
I'm a bit afraid that looking for both
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
and
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
might now trigger more "export not found" compiler warnings than before

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as I do import React from 'rehackt' instead of import * as Rea... it works without warnings with that code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants