-
Notifications
You must be signed in to change notification settings - Fork 178
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 React to v17 #5793
Update React to v17 #5793
Conversation
Size Change: +3.85 kB (0%) Total Size: 1.66 MB
ℹ️ View Unchanged
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
.../src/dashboard/app/views/editorSettings/adManagement/googleAdManager/test/googleAdManager.js
Show resolved
Hide resolved
# Conflicts: # package-lock.json # package.json
assets/src/edit-story/components/library/panes/media/common/innerElement.js
Show resolved
Hide resolved
assets/src/edit-story/components/library/panes/media/common/mediaElement.js
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
I think we should make sure that #6900 is merged before merging this. |
I don't see why. There are no real dependencies between these two. Whatever is ready first could go in. |
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.
Changes look good to me.
Avoids warrnings about side effects in these providers during tests
Matches the one from the design system
Summary
To learn more about React 17:
React 17 blog post: https://reactjs.org/blog/2020/10/20/react-v17.html
Breaking changes: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#other-breaking-changes
New JSX transform: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
Side effect: This also avoids some misleading
SharedArrayBuffer
warnings that were fixed in React 17.0.2, see https://github.com/facebook/react/blob/7c4e6aae3ef4e77596125f30b801c84800e949a9/CHANGELOG.md#react-domRelevant Technical Choices
React
using the provided codemod (npx react-codemod update-react-imports
).This is done in preparation of using the new JSX transform, since the new JSX transform doesn’t require React to be in scope.
Note: These imports are already unneeded today, and basically dead code. It doesn’t hurt to keep them, but they can be removed safely.
@wordpress/element
(currently on React 16.x) in tests to map to React 17.Avoids issues with mismatching React versions used for code and tests.
These can be removed once
@wordpress/element
upgrades too (Update to React 17.0.1 WordPress/gutenberg#26847)To-do
Turns out this requires some changes to the Karma config and how we spy on
React.createElement
, as this spy needs to be changed to work againstreact/jsx-runtime
.User-facing changes
N/A
Testing Instructions
N/A
Fixes #6938