Skip to content

Comments

chore(js-ts): migrate 11 Redux action creator files from JS to TS#324

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771498804-js-to-ts-action-creators
Open

chore(js-ts): migrate 11 Redux action creator files from JS to TS#324
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771498804-js-to-ts-action-creators

Conversation

@devin-ai-integration
Copy link

chore(js-ts): migrate 11 Redux action creator files to TypeScript

Summary

Converts all 11 Redux action creator files under app/actions/ from JavaScript to TypeScript as part of the ongoing JS-to-TS migration:

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

Each file gets:

  • Typed interfaces for every action shape
  • Typed parameters and return types on all action creators
  • An exported discriminated union type per domain (e.g. BrowserAction, TransactionAction)

No runtime logic was changed. yarn lint (0 errors) and yarn lint:tsc pass cleanly.

Review & Testing Checklist for Human

  • Verify type assertions in transaction/index.ts: newAssetTransaction and setSelectedAsset accept SelectedAsset | object and immediately cast via as SelectedAsset. This works around getEther() (a JS file) being typed as returning object via its JSDoc. Confirm this tradeoff is acceptable vs. fixing getEther's return type upstream.
  • Audit loosely-typed Bookmark interface (bookmarks/index.ts): url and name are optional with a [key: string]: unknown index signature. This was necessary because callers pass AutocompleteSearchResult (no url on TokenSearchResult) and { url: any } (no name). Verify this doesn't mask real bugs at call sites like RPCMethodMiddleware.ts:905 and UrlAutocomplete/Result.tsx:38.
  • Check securityAlertResponse: object in transaction/index.ts: Typed as bare object because the imported SecurityAlertResponse interface from BlockaidBanner lacks an index signature. This is very permissive.
  • Spot-check union types used as workarounds for caller mismatches: step: number | boolean (wizard), autodismiss: number | boolean (notification), timestamp: number | string (privacy), marketingEnabled: boolean | null (browser), basicFunctionalityEnabled: boolean | null (settings). These were widened to match existing callers — confirm the widened types reflect intentional usage, not latent bugs.
  • Verify TokenSortConfig shape in settings/index.ts — the key, order, sortCallback fields were inferred; confirm they match the actual reducer expectations.

Suggested test plan: Run the full app locally and exercise flows that dispatch these actions — send a transaction, toggle settings, manage bookmarks/NFTs, open browser tabs — to verify no runtime regressions from the file renames.

Notes

Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
@devin-ai-integration
Copy link
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