-
Notifications
You must be signed in to change notification settings - Fork 799
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: Replace legacy ReactDOM.render method with createRoot. #38649
Conversation
…ominantly use '@wordpress/element' in the monorepo, for consistency.
…at-ReactDOM-render
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. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
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.
The cde changes look good. I tested with a self-hosted site and everything worked as expected
Fixes #38644
Proposed changes:
ReactDOM.render
usage to be viaReactDOM.createRoot
, to ensure compatibility with React 19.projects/packages/forms/src/dashboard/index.js
there was an additional deprecated function being used -unescape
. This has been replaced withdecodeURIComponent
.frontend-management.js
file is no longer imported anywhere - it used to be most recently in the Map block (removed here). However, the file may be used in the future based on this issue - Blocks: Convert blocks to use FrontendManagement #15838 - so I've left it with changes and presumably any hiccups when importing down the line will be able to be resolved then.Other information:
Jetpack product discussion
#38644
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
In all the below examples, the following console warning should be gone with the branch checked out:
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead.
, and visible on trunk.Testing on self-hosted / Atomic:
/wp-admin/edit.php?post_type=feedback
, click 'View' in the top right, and select 'Inbox' to use the new Jetpack forms dashboard. This should enable and take you to/wp-admin/admin.php?page=jetpack-forms#/landing
. The page should render as expected./wp-admin/admin.php?page=jetpack#/performance
. Navigate to Customberg (/wp-admin/admin.php?page=jetpack-search-configure
). The page should render as expected.jp-search-configure.js
and this is the one that disappears. The other comes fromwidgets.wp.com
, so will remain when this branch is checked out.Testing on Simple:
/wp-admin/admin.php?page=jetpack-search
.