-
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
Update to React 18 #28710
Update to React 18 #28710
Conversation
Various indirect deps don't declare support for React 18 yet.
Updates react packages and corresponding `@types/`, all the `@wordpress/*` and `@types/wordpress__*`, and `@testing-library/react`. Also updates some indirect deps of `@storybook/addon-actions` and `@storybook/react` that we have new overrides for. Also `@testing-library/react-hooks` has been merged into `@testing-library/react` now, so we need to remove that (and then update tests to get `renderHook` from the latter package instead). To regenerate, run ``` pnpm remove -r @testing-library/react-hooks && \ pnpm update -r react@latest react-dom@latest react-test-renderer@latest @types/react@latest @types/react-dom@latest @types/react-test-renderer@latest \ $(ls -d node_modules/.pnpm/@WordPress+* node_modules/.pnpm/@types+wordpress__* | sed 's!^node_modules/.pnpm/!!;s!+!/!;s!\(.\)@.*$!\1@latest!' | sort -u) \ @testing-library/react@latest @storybook/addon-actions @storybook/react ```
Functionality mostly merged into `@testing-library/react`
Mostly `render()`, also a few `unmountComponentAtNode()`.
Looks like the actual deprecaion happened back in 2019, so we should be safe to just replace it.
Seems odd that the defaults make PanelColorSettings not render at all, when AFAICT the actual theme defaults supply the right settings, but that's how it is.
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 (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
Boost plugin:
Social plugin:
Starter Plugin plugin:
Protect plugin:
Videopress plugin:
Migration plugin:
|
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run
to get started. More details: p9dueE-5Nn-p2 |
It doesn't help that `react-dom/client` is not handled by dependency-extraction-webpack-plugin, so the v18 version gets bundled but tries to use the v17 version from WP core and breaks. Fortunately `@wordpress/element` in v5 re-exports the `react-dom/client` functions, making it easy to check for whether WP core has it or not. So switch everything over to that.
Note Boost's Critical CSS feature is currently broken in trunk, that's not an effect of this PR. p1675393194601369/1675373367.797419-slack-CBG1CP4EN |
I did some clicking around on a JN site but wasn't able to notice any issues. |
Checked everything I could - Jurassic Ninja, WoA, Simple site, all standalone plugin pages, dashboards and block editors. Didn't notice any issues. Looks like there are some merge conflicts. I say we go ahead and merge this so we can get as close to a full cycle of testing as possible. |
I was planning on waiting for Wednesday in case something blows up with the release tomorrow in code that's touched here. But if others think that won't complicate backporting fixes, I'm fine with going ahead now. There's not that much non-test code being touched (mainly just the replacing of |
Gotcha, that makes sense to me. Let's wait until Wednesday and merge it after 11.8 just to be safe. |
Nice work here folks! 👏🏽 |
When #28710 updated the React dependencies, our packages' peer dependencies were overlooked. Update them too.
When #28710 updated the React dependencies, our packages' peer dependencies were overlooked. Update them too.
Proposed changes:
Update to React 18.
Other information:
Jetpack product discussion
p9dueE-6wd-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions: