-
Notifications
You must be signed in to change notification settings - Fork 383
Upgrade React to v18, update npm deps and migrate JS tests to @testing-library/react
#7394
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
Conversation
- Remove unsage of `render` from `@wordpress/element` - Use `act` from `@testing-library/react` instead of `react-dom/test-utils` - Update test cases for AMPDocumentStatusNotification component - Update test cases for AMPRevalidateNotification component - Update test cases for AMPValidationStatusNotification component - Update test cases for Icons component - Update test cases for SidebarNotification component - Update test cases for SidebarNotificationsContainer component - Update test cases for withAMPToolbarButton component - Update test cases for useAMPDocumentToggle hook - Update test cases for AMPToggle component - Update test cases for Nav component - Update test cases for ThemesContextProvider component - Update test cases for TemplateModeOption component - Update test cases for SiteScanSourcesList component - Update test cases for Selectable component - Update test cases for RedirectToggle component - Update test cases for ProgressBar component - Update test cases for PluginsContextProvider component - Update test cases for NavMenu component - Update test cases for Loading component - Update test cases for DevToolsToggle component - Update test cases for ConditionalDetails component - Update test cases for AMPNotice component - Update test cases for AMPSettingToggle component - Update test cases for AmpAdminNotice component - Update test cases for useValidationErrorStateUpdates hook - Update test cases for usePostDirtyStateChanges hook - Update test cases for Error component - Update test cases for CarouselNav component - Update test cases for useErrorsFetchingStateChanges hook
|
Cherry-picked updated JS unit test cases commits from #7375 as new Gutenberg package updates are available and old ones are not merged yet. Also see: #7375 (comment) |
|
Plugin builds for cdbc29e are ready 🛎️!
|
…boarding wizard page
…te-scan-notice page
|
I'm getting E2E errors repeatedly with this: |
|
Sorry for creating merge conflicts by merging other dependency updates. |
Yes, I am addressing the problem, and it can be duplicated. The problem arises when a It's not functioning as planned after the upgrade to Steps to reproduce the issue:Switch to While moving forward to the |
Used by @wordpress/scripts so we don't need to manage it.
postcss-nested and postcss-preset-env uses postcss v8 now.
@wordpress/scripts uses webpack v5 now.
@wordpress/element is used for react and react-dom abstractions.
da37b4c to
32b310f
Compare
@testing-library/react
1eef28d to
cdbc29e
Compare
|
What ended up being the source of the problem with the E2E tests? Actually, I see they're still failing? |
|
@westonruter It's the same as mentioned in #7394 (comment) and I am investigating it. |
|
As discussed, instead of upgrading React let's stay on React 17 for now.
|
|
@westonruter Since several of the |
|
Sounds good. Do we need to downgrade And should we disable the GitHub Action entirely for now? No sense to have it keep running if it is going to always be closed. |
Nope, all packages are already stable on
Yes, please. |
|
Blocking this PR until the upstream(Gutenberg) package's peer dependencies are bumped to React 18(if any). Once all @westonruter JFI I have temporarily disabled the |
|
Since WordPress 6.2 is including React 18, I think this PR will need to be picked up again eventually. |
|
Of note: We could undo the logic we had to prevent adding certain logic to the page if React 17 is not installed. |
I've filed this as #7489. In a subsequent release, we can consider upgrading to React 18, although this may require that we increase the minimum-supported version to WordPress 6.2. |
|
Since many of the items were cherry-picked from this PR so closing this in favor of #7548. |



Updated following
@wordpress/*packages@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@wordpress/[email protected]
@testing-library/react.postcss-nestedandcopy-webpack-pluginto the latest version.react,react-dom(we use@wordpress/elementpackage for React) andpostcss-loader(@wordpress/scriptsalready handle css loaders).