Skip to content

draft: Chore/upgrade to react 19#1850

Draft
lakshaychopra wants to merge 3 commits intoKhalisFoundation:devfrom
lakshaychopra:chore/upgrade-to-react-19
Draft

draft: Chore/upgrade to react 19#1850
lakshaychopra wants to merge 3 commits intoKhalisFoundation:devfrom
lakshaychopra:chore/upgrade-to-react-19

Conversation

@lakshaychopra
Copy link

Major dependency updates:

  • Node: 18->24
  • React and React DOM: 17 → 19
  • React Router DOM: 5 → 6
  • Redux: 4 → 5, React-Redux: 8 → 9
  • React Query → TanStack Query v5

React 19 migration:

Replace ReactDOM.render() with createRoot API
Remove deprecated react-test-renderer

React Router v6 migration:

  • Add withRouter compatibility HOC (src/js/util/router-compat.js)
  • Replace useHistory with useNavigate
  • Replace Redirect with Navigate component
  • Update Routes/Route component patterns
  • Replace StaticRouter with MemoryRouter in tests

TanStack Query v5 migration:

  • Update import paths from react-query to @tanstack/react-query
  • Use object syntax for useMutation with mutationFn
  • Move onError from useQuery to useEffect

TypeScript fixes:

  • Add SearchForm.d.ts type declarations
  • Add SP_API global declaration
  • Fix state typing in useSelector calls
  • Update tsconfig.json for better compatibility

Node:

  • Update Node version in package.json, .nvmrc, Dockerfile, .travis.yml
  • Migrate from esm package to native ES modules ("type": "module")
  • Rename CommonJS config files to .cjs extension (webpack, jest, babel)
  • Add .js extensions to all ESM imports in server files
  • Add __dirname workaround for ESM (using import.meta.url)
  • Fix CommonJS interop for @sttm/banidb and redux-debounced
  • Update tsconfig.json to exclude server files from type checking
  • Remove deprecated esm package dependency
  • Passed sanity tests.
  • Ran npm test & fixed newly introduced lint errors.
  • Checked console for errors.

- Update Node version in package.json, .nvmrc, Dockerfile, .travis.yml
- Migrate from esm package to native ES modules ("type": "module")
- Rename CommonJS config files to .cjs extension (webpack, jest, babel)
- Add .js extensions to all ESM imports in server files
- Add __dirname workaround for ESM (using import.meta.url)
- Fix CommonJS interop for @sttm/banidb and redux-debounced
- Update tsconfig.json to exclude server files from type checking
- Remove deprecated esm package dependency
Major dependency updates:
- React and React DOM: 17 → 19
- React Router DOM: 5 → 6
- Redux: 4 → 5, React-Redux: 8 → 9
- React Query → TanStack Query v5

React 19 migration:
- Replace ReactDOM.render() with createRoot API
- Remove deprecated react-test-renderer

React Router v6 migration:
- Add withRouter compatibility HOC (src/js/util/router-compat.js)
- Replace useHistory with useNavigate
- Replace Redirect with Navigate component
- Update Routes/Route component patterns
- Replace StaticRouter with MemoryRouter in tests

TanStack Query v5 migration:
- Update import paths from react-query to @tanstack/react-query
- Use object syntax for useMutation with mutationFn
- Move onError from useQuery to useEffect

Redux updates:
- Use named import for thunk: { thunk } from 'redux-thunk'

TypeScript fixes:
- Add SearchForm.d.ts type declarations
- Add SP_API global declaration
- Fix state typing in useSelector calls
- Update tsconfig.json for better compatibility
@lakshaychopra lakshaychopra marked this pull request as draft February 9, 2026 19:25
@Gauravjeetsingh
Copy link
Collaborator

@lakshaychopra ji, as this PR is still in draft, can you please confirm if the upgrade is complete, or if you are still working on this?

If its complete, can you please mark this PR ready for review.

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.

2 participants