-
Notifications
You must be signed in to change notification settings - Fork 800
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
React compatibility: createRoot import and usage updates to remain compatible with new versions of React #38495
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
That doesn't seem right, Looks like what's going on is this:
The changes in this PR to import |
…ting console warning as existing method unsupported
…he change in that package
I'm glad you jumped in here @anomiex , I realized something was amiss when I couldn't replicate the fix on a Jurassic Ninja site. That'll simplify this PR hugely, thank you for explaining what was likely going on. I'll remove everything except the fix for the separate Boost issue. |
a5d328e
to
26198c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me.
Fixes #38480
Proposed changes:
createRoot
that was generating warnings.tooltips-plugin.ts
, affecting the Boost dashboard. In this case, due to the layout of the component, the rendering and thencreateRoot
were happening in two different hooks, and it appears thatcreateRoot
was then being called more than once. By checking if root already exists, we prevent this warning and issue.Initially the PR attempted to also address the following console warning, however this turns out only to be an issue with development builds (see the comment below), so that commit was removed.
Other information:
Jetpack product discussion
#38480
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Replicating the issue:
wp-config.php
:define( 'SCRIPT_DEBUG', true );
. Testing in trunk (or bleeding edge on JN).Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
. (ignore the othercreateRoot
console warning, mentioned in 'Proposed Changes' above)./wp-admin/admin.php?page=jetpack-boost
Testing the fix:
js-packages/components
package, andplugins/boost
. In the beta tester plugin, apply the PR to the Boost plugin.