Upgrade React 17 to React 19, replace Create React App with Vite#27
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Upgrade React 17 to React 19, replace Create React App with Vite#27devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Replace Create React App (react-scripts) with Vite + @vitejs/plugin-react - Upgrade react and react-dom from ^17.0.2 to ^19.0.0 - Update entry point from ReactDOM.render() to createRoot API - Add nodeRef prop to CSSTransition components (Modal, Alert) for React 19 compat - Upgrade companion libraries: react-icons 5.x, react-countdown 2.3.6, react-transition-group 4.4.5, classnames 2.5.1, sass 1.83, web-vitals 4.x - Update reportWebVitals: getFID -> getINP (web-vitals v4) - Replace Jest/CRA test setup with Vitest + jsdom - Upgrade @testing-library/react 16.x, jest-dom 6.x, user-event 14.x - Upgrade dev deps: husky 9.x, lint-staged 15.x, prettier 3.x - Move index.html to project root, remove %PUBLIC_URL% refs, add module script - Rename .js files with JSX syntax to .jsx (AlertContext, index) - Remove CRA-specific eslintConfig and browserslist from package.json - Add vite.config.js with path aliases matching jsconfig.json baseUrl - Run prettier --write to normalize formatting for prettier 3.x 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:
|
Author
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
Two-major-version React upgrade (17 → 19) combined with a full build tooling migration from Create React App to Vite.
Build tooling (CRA → Vite):
vite.config.jswith@vitejs/plugin-reactandresolve.aliasentries mirroring the existingjsconfig.jsonbaseUrl: "src"conventionpublic/index.htmlto rootindex.html, stripped%PUBLIC_URL%placeholders, added<script type="module" src="/src/index.jsx">react-scriptsscripts withvite/vite build/vite preview"type": "module"topackage.json; removedeslintConfigandbrowserslistCRA blocksAlertContext.js→.jsxandindex.js→.jsx(Vite requires.jsxextension for files containing JSX)React 19 entry point:
ReactDOM.render()→createRoot()fromreact-dom/clientinsrc/index.jsxreact-transition-group
findDOMNodefix (React 19 removesfindDOMNode):nodeRefprop + matchingrefon child DOM nodes in bothModal.jsxandAlert.jsxDependency upgrades:
getFID→getINP)Testing infra: Jest (via CRA) → Vitest + jsdom. Setup file now imports
@testing-library/jest-dom/vitest. The existing boilerplate test was updated to actually match app content (wraps<App>in<AlertProvider>, asserts on "wordle" text).Formatting-only diffs in several files are from Prettier 3.x (trailing commas, multi-line SCSS transitions).
Review & Testing Checklist for Human
nodeRefadditions toCSSTransitioninModal.jsxandAlert.jsxare the most fragile part of this upgrade. Open the app and confirm modal fade-in/out, alert pop-in/out, and cell flip/jiggle animations all behave correctly.react-icons/ristill resolve.npm run buildand serve vianpm run preview— verify the built app works identically to dev mode (Vite's production build uses Rollup which can surface different issues than the dev server's esbuild).react-app,react-app/jest) was removed with no standalone replacement. Decide if a new ESLint config is needed.Notes
preparescript still useshusky installwhich is deprecated in husky v9 (the commit showed a deprecation warning). A follow-up to migrate to husky v9'shuskyinit pattern may be desired.renders learn react link) was a CRA boilerplate that likely never passed against this app. The replacement test is minimal but functional.react-countdownandreact-transition-groupwere only minor-bumped; their React 19 compat should be fine with thenodeReffix in place, but worth a quick smoke test of the countdown timer inStatsModal.Link to Devin session: https://app.devin.ai/sessions/3322519acf4a4dec902eee53230ef0ba
Devin Review