Skip to content

chore: upgrade Redux stack (RTK 2.x, react-redux 9.x, redux 5.x) #425

@hb2708

Description

@hb2708

Summary

Upgrade the Redux ecosystem to the latest major versions. The project currently uses RTK 1.x which is significantly behind the modern Redux patterns introduced in RTK 2.x.

Current → Target

Package Current Latest
@reduxjs/toolkit 1.8.6 2.x
react-redux 8.0.4 9.x
redux 4.2.0 5.x
redux-thunk 2.4.1 3.x (bundled in RTK 2.x)

Why Upgrade

  • RTK 2.x introduces improved TypeScript support, better defaults, and the new listenerMiddleware
  • react-redux 9.x has performance improvements and drops legacy context usage
  • Redux 5.x is a TypeScript rewrite with improved types
  • redux-thunk is bundled in RTK 2.x — no longer needed as a separate dependency

Migration Steps

  1. Upgrade all packages together — these are tightly coupled:
    yarn add @reduxjs/toolkit@latest react-redux@latest redux@latest
    yarn remove redux-thunk
  2. Review configureStore usage — RTK 2.x changes some defaults:
    • redux-thunk is included automatically — remove manual middleware addition
    • serializableCheck and immutabilityCheck are on by default
  3. Update createSlice usage — check for deprecated patterns:
    • createSlice reducers now support a builder callback (preferred)
    • Check any extraReducers using the map object notation → switch to builder
  4. Fix TypeScript types — RTK 2.x exports improved types:
    • RootState and AppDispatch inference should still work but verify
    • useSelector and useDispatch hooks may need typed versions
  5. Run testsyarn ci to ensure all 435 tests still pass

Files Likely Affected

  • app/ducks/ — all Redux slices and store configuration
  • Any component using useSelector/useDispatch
  • Store setup file (likely configureStore call)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions