Skip to content

chore(js-ts): Convert all Redux actions and reducers to TypeScript#611

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1777471045-js-ts-actions
Open

chore(js-ts): Convert all Redux actions and reducers to TypeScript#611
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1777471045-js-ts-actions

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 29, 2026

Summary

Converts all 23 remaining JavaScript Redux action and reducer files to TypeScript as part of the JS→TS migration effort.

Actions converted (11 files):

  • app/actions/alert, bookmarks, browser, collectibles, infuraAvailability
  • app/actions/modals, notification, privacy, settings, transaction, wizard

For each action file:

  • Defined action type constants with as const string literal types
  • Created discriminated union Action types (e.g., AlertAction, BrowserAction)
  • Added explicit parameter and return types to all action creators
  • Follows the pattern established in app/actions/onboarding/index.ts

Reducers converted (12 files):

  • app/reducers/alert, bookmarks, browser, collectibles, infuraAvailability
  • app/reducers/modals, notification, privacy, settings, swaps, transaction, wizard

For each reducer file:

  • Defined and exported State interfaces (e.g., AlertState, BrowserState, SwapsState)
  • Imported Action union types from corresponding action files
  • Typed reducer function signatures: (state: XState, action: XAction) => XState

RootState updated:

  • Replaced 12 any types with proper State interfaces in app/reducers/index.ts
  • Removed corresponding // TODO: Replace "any" with type and eslint-disable comments

Review & Testing Checklist for Human

  • Verify all action creators still produce the correct action shapes (no behavioral changes)
  • Verify all reducer state shapes match the original initialState objects
  • Check that the swaps reducer (most complex, 420+ lines with selectors) compiles correctly with yarn tsc --noEmit
  • Run yarn test --findRelatedTests on a few key files to confirm test compatibility

Notes

  • No logic or behavior changes — this is a pure type annotation migration
  • The swaps/index.ts reducer is the most complex conversion with many createSelector calls and dynamic chain-ID-keyed state
  • The @typescript-eslint/default-param-last eslint-disable is preserved in reducer files since Redux reducers require (state = initialState, action) signature

Link to Devin session: https://app.devin.ai/sessions/51734166b8b740daa75579e47f5a94be
Requested by: @lukepage-COG


Devin Review

Status Commit
⚪ Not started

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

devin-ai-integration Bot and others added 2 commits April 29, 2026 14:04
Convert all 11 Redux action files in app/actions/ from JavaScript to TypeScript:
- alert, bookmarks, browser, collectibles, infuraAvailability
- modals, notification, privacy, settings, transaction, wizard

For each file:
- Renamed .js to .ts
- Added string literal type constants with 'as const'
- Defined discriminated union Action types
- Added explicit parameter types and return types to all action creators
- Exported Action union types for use by reducers

Follows the pattern established in app/actions/onboarding/index.ts

Co-Authored-By: Luke Page <luke.page@cognition.ai>
Convert all 12 Redux reducer files in app/reducers/ from JavaScript to TypeScript:
- alert, bookmarks, browser, collectibles, infuraAvailability
- modals, notification, privacy, settings, swaps, transaction, wizard

For each reducer:
- Renamed .js to .ts
- Defined State interfaces for all reducer state shapes
- Imported Action union types from corresponding action files
- Typed reducer function signatures with proper State and Action types
- Exported State interfaces for use in RootState

Updated app/reducers/index.ts RootState interface:
- Replaced 'any' with proper State types for all 12 converted reducers
- Removed corresponding TODO comments and eslint-disable comments
- Added imports for all new State types

Co-Authored-By: Luke Page <luke.page@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants