draft: Chore/upgrade to react 19#1850
Draft
lakshaychopra wants to merge 3 commits intoKhalisFoundation:devfrom
Draft
draft: Chore/upgrade to react 19#1850lakshaychopra wants to merge 3 commits intoKhalisFoundation:devfrom
lakshaychopra wants to merge 3 commits intoKhalisFoundation:devfrom
Conversation
- 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
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. |
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.
Major dependency updates:
React 19 migration:
Replace ReactDOM.render() with createRoot API
Remove deprecated react-test-renderer
React Router v6 migration:
TanStack Query v5 migration:
TypeScript fixes:
Node:
npm test& fixed newly introduced lint errors.