Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(js-ts): Migrate 37 0-error js files #11214

Merged
merged 91 commits into from
Sep 24, 2024
Merged

chore(js-ts): Migrate 37 0-error js files #11214

merged 91 commits into from
Sep 24, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 14, 2024

Pull Request: Refactor JavaScript Files to TypeScript

Description

This pull request completes the task of refactoring JavaScript files to TypeScript in the metamask-mobile repository. The changes involve renaming .js files to .ts or .tsx based on the presence of JSX syntax, and making necessary adjustments for TypeScript compatibility.

Changes Made

  • Refactored 39 JavaScript files to TypeScript
  • Renamed file extensions from .js to .ts or .tsx
  • Made minor syntax adjustments for TypeScript compatibility
  • Ensured all changes pass linting checks (yarn lint:tsc ran successfully without errors)
  • Removed todo_list.txt from the repository
  • Updated jest.config.js to reflect new TypeScript file extensions for mocks:
    • Changed svgMock.js to svgMock.ts
    • Changed pngMock.js to pngMock.ts
  • Renamed snapshot files from .test.js.snap to .test.tsx.snap for consistency

Files Affected

The refactoring covered various types of components and utilities, including:

  • Mocks
  • Core components
  • Utilities
  • Constants
  • UI components
  • Views
  • Actions
  • Store migrations

For a complete list of refactored files, please refer to the diff.

Snapshot Files Renamed

The following snapshot files were renamed from .test.js.snap to .test.tsx.snap:

  1. app/components/UI/Swaps/components/snapshots/TokenIcon.test.tsx.snap
  2. app/components/UI/Swaps/components/snapshots/TokenSelectButton.test.tsx.snap
  3. app/components/UI/UrlAutocomplete/snapshots/index.test.tsx.snap
  4. app/components/Views/Asset/snapshots/index.test.tsx.snap
  5. app/components/Views/confirmations/components/TransactionReview/TransactionReviewDetailsCard/snapshots/index.test.tsx.snap

This renaming was done to maintain consistency with the recent refactoring of JavaScript files to TypeScript.

Important Notes for Reviewers

  • No functional changes were made; only file extensions and potential minor syntax adjustments
  • Please check for any overlooked TypeScript-specific issues
  • Verify that the refactored files maintain their original functionality
  • Ensure that the changes in jest.config.js correctly map to the new TypeScript mock files
  • Confirm that the renamed snapshot files are correctly referenced in their respective test files

Testing

  • All existing tests should pass without modifications
  • Manual testing of affected components is recommended to ensure no regressions
  • Verify that jest tests run correctly with the updated mock file extensions and renamed snapshot files

Next Steps

  • Address any feedback from the code review
  • Consider updating documentation to reflect the transition to TypeScript
  • Plan for gradual TypeScript adoption in future development

Checklist

  • Code follows the project's coding standards
  • All files pass linting checks (yarn lint:tsc)
  • Documentation has been updated (if necessary)
  • All tests pass
  • Manual testing completed

Please review and provide any feedback. Thank you!

@devin-ai-integration devin-ai-integration bot changed the title chore: Refactor JavaScript Files to TypeScript chore(js-ts): Migrate 37 0-error js files Sep 15, 2024
@Cal-L
Copy link
Contributor

Cal-L commented Sep 16, 2024

Quality gate failures can be ignored since this is just renaming

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L added team-mobile-platform team-ai AI team (for the Devin AI bot) labels Sep 16, 2024
@sethkfman sethkfman marked this pull request as ready for review September 18, 2024 16:07
@sethkfman sethkfman requested review from a team as code owners September 18, 2024 16:07
@sethkfman sethkfman added the No QA Needed Apply this label when your PR does not need any QA effort. label Sep 18, 2024
@Cal-L Cal-L enabled auto-merge September 23, 2024 23:45
Copy link

@Cal-L Cal-L added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit e6af33a Sep 24, 2024
36 checks passed
@Cal-L Cal-L deleted the rename-jsx-files branch September 24, 2024 00:03
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.33.0 Issue or pull request that will be included in release 7.33.0 team-ai AI team (for the Devin AI bot) team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants