Skip to content

chore: convert ~331 remaining JS/JSX files in app/ to TypeScript#26

Open
devin-ai-integration[bot] wants to merge 29 commits intomainfrom
ts-migration/app
Open

chore: convert ~331 remaining JS/JSX files in app/ to TypeScript#26
devin-ai-integration[bot] wants to merge 29 commits intomainfrom
ts-migration/app

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Mar 25, 2026

Summary

Converts all remaining ~331 JavaScript/JSX files in app/ to TypeScript/TSX, completing the TypeScript migration for the application layer. Zero .js/.jsx files remain in app/ after this PR.

The migration was executed in 6 dependency-aware phases:

  1. Leaf utilities (66 files): actions, reducers, constants, mocks, test utils, small util modules
  2. Core utility hubs (4 files): number/, networks/, transactions/, conversion/
  3. Core services (25 files): NotificationManager, RPCMethods, BackgroundBridge, WalletConnect, Permissions, lib/
  4. Shared UI components (111 files): Navbar, TransactionElement, Base/, small UI components, Swaps/
  5. View components (80 files): confirmations, Settings, Browser, DrawerView, onboarding flows, Nav components
  6. Store migrations (38 files): migrations/000.ts through 027.ts + test files

What changed per file:

  • .js/.jsx.ts/.tsx rename
  • PropTypes replaced with TypeScript interface/type definitions
  • connect(mapStateToProps, mapDispatchToProps) HOCs given RootState/AppDispatch typings
  • Explicit return types added to exported functions
  • module.exports/require() → ES module import/export where present

What did NOT change: No logic refactoring or behavioral changes. This is a type-only migration.

Updates since last revision

  • Fixed export default misplacement in ExpandedMessage and TransactionReviewDetailsCard — During the PropTypes-to-interface conversion, export default was left attached to the interface declaration instead of the class. Since TypeScript interfaces are erased at compile time, the default export at runtime would be undefined, crashing any file that imports and renders these components (e.g., TypedSign, PersonalSign, ApproveTransactionReview). Fixed by moving export default to the class declaration. Verified via grep that no other instances of this pattern exist. (Caught by Devin Review.)

  • Fixed transactionFailed listener crash in app/core/NotificationManager.ts — The conversion incorrectly changed the transactionFailed subscriber callbacks to destructure a wrapped { transactionMeta } object, but the event emits transactionMeta directly (consistent with how transactionConfirmed and speedupTransactionAdded are handled). When a transaction failed, payload.transactionMeta would be undefined, crashing _failedCallback on .id and .txParams.nonce access. The as never casts suppressed all type-checking, hiding the mismatch. Fixed to receive transactionMeta: TransactionMeta directly. (Caught by Devin Review.)

  • Fixed decimalSeparator bug in app/components/Base/Keypad/index.tsx — The original conversion used decimalSeparator || '' which corrupted valueAsNumber for currencies with null decimal separators (JPY, KRW, CLP, ISK, VND). '123'.replace('', '.') produces '.123' instead of '123'. Fixed to use a conditional: decimalSeparator ? newValue.replace(decimalSeparator, '.') : newValue, preserving the original no-op behavior when decimalSeparator is null. (Caught by Devin Review.)

Review & Testing Checklist for Human

⚠️ Devin Review caught 4 real bugs across 4 different bug categories (misplaced export, incorrect destructuring, wrong nullish operator, misplaced export default). Given the scale (361 files, 20 parallel child sessions), additional undiscovered issues are likely. Thorough manual review is strongly recommended.

  • Run yarn test end-to-end — No CI pipeline ran on this PR. This is the single most important validation step. Child sessions reported pre-existing tsc errors, so it's unclear whether the full test suite passes.
  • Search for remaining as never casts — The NotificationManager bug was hidden by as never. Grep the diff for as never and verify each usage is safe — these casts completely disable type checking and can mask behavioral changes.
  • Search for export default immediately followed by interface — The ExpandedMessage/TransactionReviewDetailsCard bug was a structural pattern where export default got detached from the class. While grep confirmed no remaining instances of a bare export default on its own line, verify there are no other malformed export patterns.
  • Spot-check as any and as string casts in critical utility files — files like app/util/transactions/index.ts, app/util/number/index.ts, and app/util/networks/index.ts use casts to work around pre-existing type gaps. Search for as any and as string in the diff to verify these don't mask real issues.
  • Verify subtle behavioral changes in transactions/index.ts — Several non-type changes were made: || [] fallback added to decodeTransferData, ?? 0 fallbacks on conversionRate/decimals, removal of redundant .toString(10) in minimumTokenAllowance, !!() wrappers converting truthy/falsy chain results to strict booleans, and tokenData?.args?.[1]?._hex adding optional chaining (prevents potential crash). These should be semantically equivalent but warrant a second look given they touch transaction logic.

Recommended test plan: yarn test && npx tsc --noEmit 2>&1 | head -100 && yarn lint

Notes

  • Each phase was executed via parallel child sessions on isolated feature branches, then squash-merged into the ts-migration/app integration branch (26 squash-merge commits total).
  • Pre-existing repo-wide type errors (react-native typings, missing declaration files, component-library mismatches) were intentionally left unfixed as they are out of scope for this migration.
  • Three straggling .test.jsx files (Navbar, AddressInputs, BaseNotification) were renamed to .test.tsx in a final cleanup commit.
  • Devin Review caught 4 real bugs (Keypad decimalSeparator, NotificationManager transactionFailed listener, ExpandedMessage export default, TransactionReviewDetailsCard export default) that have been fixed; additional findings are visible in the Devin Review dashboard.

Link to Devin session: https://app.devin.ai/sessions/0d8152d404384961a3e037b90ea5667b
Requested by: @mbatchelor81


Open with Devin

devin-ai-integration Bot and others added 26 commits March 25, 2026 04:06
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
…hase 1d)

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
… 2b)

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
…e 3c)

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
…ase 4b)

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
@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

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…rectly

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…and TransactionReviewDetailsCard

Co-Authored-By: mason.batchelor <masonbatchelor81@gmail.com>
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.

1 participant