Upgrade from React 17 to React 19 with CRA-to-Vite migration#23
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Upgrade from React 17 to React 19 with CRA-to-Vite migration#23devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- 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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
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.0react-icons:^4.3.1→^5.0.0react-transition-group:^4.4.2→^4.4.5web-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.0Build system migration (CRA → Vite):
react-scriptsdependencyvite,@vitejs/plugin-react,vitest,jsdomas devDependenciesvite.config.jswith path aliases matching the existingjsconfig.jsonbaseUrl: "src"setupindex.htmlto project root with<script type="module">entry pointstart/dev→vite,build→vite build,test→vitest runReact 19 API migration:
src/index.jsx): ReplacedReactDOM.render()withcreateRoot()APIreportWebVitals.js: Updated for web-vitals v4 API (onCLS/onINPinstead ofgetCLS/getFID)CSSTransitioncomponents (Modal, Alert): AddednodeRefprop to avoid deprecatedfindDOMNode.jsfiles containing JSX to.jsx(required by Vite):index.js→index.jsx,AlertContext.js→AlertContext.jsxTest updates:
vite.config.js)App.test.jsxto wrapAppinAlertProviderand test for correct contentsetupTests.jsuses@testing-library/jest-domv6 importNo deprecated patterns found — the codebase did not use
defaultProps,propTypes, string refs, legacy context, orfindDOMNodedirectly.Verification
npm run build(Vite production build) — passesnpm test(Vitest) — 1 test passingnpm run check(Prettier) — all files formattednpm run dev) — app renders correctlyReview & Testing Checklist for Human
npm install && npm run devand verify the game loads, keyboard input works, and guesses are scored correctlyCSSTransitionwithnodeRefnpm testto confirm test suite passesnpm run buildand servedist/to verify the production build worksNotes
react-countdownwas kept at^2.3.2as it is compatible with React 19public/index.htmlwas retained since Vite servespublic/as a static assets directory (favicons, manifest, etc.)index.htmlis the new Vite entry point/distto.gitignorefor Vite build outputLink to Devin session: https://app.devin.ai/sessions/acbd90f22fbb4d32b2e7b8237e4e37d6
Requested by: @shahmir-masood
Devin Review