chore(deps): clean up dependencies and improve React 18 compatibility#1169
Open
Grim8956 wants to merge 2 commits intoGreenstand:masterfrom
Open
chore(deps): clean up dependencies and improve React 18 compatibility#1169Grim8956 wants to merge 2 commits intoGreenstand:masterfrom
Grim8956 wants to merge 2 commits intoGreenstand:masterfrom
Conversation
- Update @testing-library/react from ^12.0.0 to ^14.0.0 - Remove unused packages (react-infinite, react-inspector, recompose) - Fix react-redux from wildcard (*) to ^7.2.9 for stability - Regenerate package-lock.json
…patibility
- Replace getByRole(/table/i) with getByRole('table')
- Replace getByRole(/dialog/i) with getByRole('dialog')
- Fixes breaking changes from @testing-library/react v12 -> v14 update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a small, incremental PR for dependency cleanup and React 18 compatibility improvements. MUI and Cypress related changes will be handled in separate PRs following our step-by-step approach.
Issue(s) addressed
What kind of change(s) does this PR introduce?
Please check if the PR fulfils these requirements
Issue
What is the current behavior?
@testing-library/reactis using a version (^12.0.0) that is not fully compatible with React 18react-infinite,react-inspector,recompose) are included in dependenciesreact-reduxis set to wildcard version (*) which could cause version mismatchesrecomposeis included despite being deprecatedgetByRole(/regex/i)pattern fail with@testing-library/reactv14 due to breaking changesWhat is the new behavior?
@testing-library/reactto React 18 compatible version (^14.0.0)react-infiniteremovedreact-inspectorremoved (devDependencies)recomposeremoved (deprecated)react-reduxto a version (^7.2.9) compatible with redux@4 to resolve dependency conflictsgetByRoleAPI:getByRole(/table/i)→getByRole('table')getByRole(/dialog/i)→getByRole('dialog')package-lock.jsonBreaking change
Does this PR introduce a breaking change?
These changes are primarily dependency updates and cleanup work. The
@testing-library/reactv14 update introduced breaking changes in thegetByRoleAPI (no longer accepts regex as first argument), but all affected tests have been updated to use the new API format. All existing functionality is maintained.Other useful information
Changed Packages
Updated:
@testing-library/react:^12.0.0→^14.0.0(React 18 compatible)Removed:
react-infinite(unused)react-inspector(unused, devDependencies)recompose(deprecated)Fixed:
react-redux:*→^7.2.9(compatible with redux@4)Lock File:
package-lock.jsonupdatedTest Updates
Updated test files for
@testing-library/reactv14 compatibility:src/components/tests/regions.test.js: UpdatedgetByRoleusage (4 instances)src/components/tests/species.test.js: UpdatedgetByRoleusage (3 instances)Changes:
getByRole(/table/i)→getByRole('table')getByRole(/dialog/i)→getByRole('dialog')Notes
react-redux@7.2.9is fully compatible with redux@4 and also compatible with React 18.@testing-library/reactv14.