Skip to content

chore(deps): clean up dependencies and improve React 18 compatibility#1169

Open
Grim8956 wants to merge 2 commits intoGreenstand:masterfrom
Grim8956:hotfix/new-master
Open

chore(deps): clean up dependencies and improve React 18 compatibility#1169
Grim8956 wants to merge 2 commits intoGreenstand:masterfrom
Grim8956:hotfix/new-master

Conversation

@Grim8956
Copy link
Copy Markdown

@Grim8956 Grim8956 commented Nov 7, 2025

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?

  • Enhancement
  • Bug fix
  • Refactor

Please check if the PR fulfils these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Issue

What is the current behavior?

  • @testing-library/react is using a version (^12.0.0) that is not fully compatible with React 18
  • Unused packages (react-infinite, react-inspector, recompose) are included in dependencies
  • react-redux is set to wildcard version (*) which could cause version mismatches
  • recompose is included despite being deprecated
  • Tests using getByRole(/regex/i) pattern fail with @testing-library/react v14 due to breaking changes

What is the new behavior?

  • Updated @testing-library/react to React 18 compatible version (^14.0.0)
  • Removed unused packages:
    • react-infinite removed
    • react-inspector removed (devDependencies)
    • recompose removed (deprecated)
  • Fixed react-redux to a version (^7.2.9) compatible with redux@4 to resolve dependency conflicts
  • Updated test files to use v14-compatible getByRole API:
    • getByRole(/table/i)getByRole('table')
    • getByRole(/dialog/i)getByRole('dialog')
  • Updated package-lock.json

Breaking change

Does this PR introduce a breaking change?

  • Yes
  • No

These changes are primarily dependency updates and cleanup work. The @testing-library/react v14 update introduced breaking changes in the getByRole API (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.json updated

Test Updates

Updated test files for @testing-library/react v14 compatibility:

  • src/components/tests/regions.test.js: Updated getByRole usage (4 instances)
  • src/components/tests/species.test.js: Updated getByRole usage (3 instances)

Changes:

  • getByRole(/table/i)getByRole('table')
  • getByRole(/dialog/i)getByRole('dialog')

Notes

  • This PR follows the small, incremental approach and only includes dependency cleanup and related test fixes.
  • MUI and Cypress related dependency errors will be handled in separate PRs.
  • react-redux@7.2.9 is fully compatible with redux@4 and also compatible with React 18.
  • All changes have been verified to not affect existing functionality.
  • All tests pass with the updated @testing-library/react v14.
  • After this PR is reviewed and merged, we will proceed with the next step (fixing MUI related dependency errors).

- 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
@Grim8956 Grim8956 requested a review from a team as a code owner November 7, 2025 11:23
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solve the npm package dependency problem on this project

1 participant