Skip to content

Upgrade from React 17 to React 19 with CRA-to-Vite migration#23

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778687901-upgrade-react-19
Open

Upgrade from React 17 to React 19 with CRA-to-Vite migration#23
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1778687901-upgrade-react-19

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 13, 2026

Summary

Comprehensive upgrade from React 17 to React 19, including a migration from Create React App (CRA) to Vite as the build system and Jest to Vitest as the test runner.

Changes

Dependencies upgraded:

  • react / react-dom: ^17.0.2^19.0.0
  • react-icons: ^4.3.1^5.0.0
  • react-transition-group: ^4.4.2^4.4.5
  • web-vitals: ^2.1.4^4.0.0
  • @testing-library/react: ^12.1.4^16.0.0
  • @testing-library/jest-dom: ^5.16.3^6.0.0
  • @testing-library/user-event: ^13.5.0^14.0.0

Build system migration (CRA → Vite):

  • Removed react-scripts dependency
  • Added vite, @vitejs/plugin-react, vitest, jsdom as devDependencies
  • Created vite.config.js with path aliases matching the existing jsconfig.json baseUrl: "src" setup
  • Moved index.html to project root with <script type="module"> entry point
  • Updated npm scripts: start/devvite, buildvite build, testvitest run

React 19 API migration:

  • Entry point (src/index.jsx): Replaced ReactDOM.render() with createRoot() API
  • reportWebVitals.js: Updated for web-vitals v4 API (onCLS/onINP instead of getCLS/getFID)
  • CSSTransition components (Modal, Alert): Added nodeRef prop to avoid deprecated findDOMNode
  • Renamed .js files containing JSX to .jsx (required by Vite): index.jsindex.jsx, AlertContext.jsAlertContext.jsx

Test updates:

  • Migrated from Jest to Vitest (compatible API, configured in vite.config.js)
  • Updated App.test.jsx to wrap App in AlertProvider and test for correct content
  • setupTests.js uses @testing-library/jest-dom v6 import

No deprecated patterns found — the codebase did not use defaultProps, propTypes, string refs, legacy context, or findDOMNode directly.

Verification

  • npm run build (Vite production build) — passes
  • npm test (Vitest) — 1 test passing
  • npm run check (Prettier) — all files formatted
  • Dev server (npm run dev) — app renders correctly

Wordle running on React 19 with Vite

Review & Testing Checklist for Human

  • Run npm install && npm run dev and verify the game loads, keyboard input works, and guesses are scored correctly
  • Test modal interactions (How to Play, Settings, Stats) — these use the updated CSSTransition with nodeRef
  • Toggle dark mode / high contrast mode in Settings and verify theme switching works
  • Run npm test to confirm test suite passes
  • Run npm run build and serve dist/ to verify the production build works

Notes

  • react-countdown was kept at ^2.3.2 as it is compatible with React 19
  • The public/index.html was retained since Vite serves public/ as a static assets directory (favicons, manifest, etc.)
  • The root index.html is the new Vite entry point
  • Added /dist to .gitignore for Vite build output

Link to Devin session: https://app.devin.ai/sessions/acbd90f22fbb4d32b2e7b8237e4e37d6
Requested by: @shahmir-masood


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

- Update react, react-dom to ^19.0.0
- Replace react-scripts (CRA) with Vite + @vitejs/plugin-react
- Migrate entry point from ReactDOM.render to createRoot API
- Replace jest with vitest for testing
- Update @testing-library/react to ^16.0.0, jest-dom to ^6.0.0, user-event to ^14.0.0
- Update react-icons to ^5.0.0, web-vitals to ^4.0.0, react-transition-group to ^4.4.5
- Add nodeRef to CSSTransition components (Modal, Alert) to avoid findDOMNode
- Rename .js files containing JSX to .jsx (required by Vite)
- Update reportWebVitals for web-vitals v4 API (onCLS/onINP instead of getCLS/getFID)
- Create vite.config.js with path aliases matching jsconfig.json baseUrl
- Move index.html to project root with module script entry point
- Add /dist to .gitignore

Co-Authored-By: shahmir.masood <shahmir.masood@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants