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

Migrates avatar base to TypeScript #18494

Merged
merged 37 commits into from
May 4, 2023

Conversation

spiritanand
Copy link
Contributor

@spiritanand spiritanand commented Apr 6, 2023

Explanation

Currently, the AvatarBase component is built in JavaScript. This PR deprecates the JS component and creates a new TypeScript version.

Migrated all .js to .tsx or .ts files

Screenshots/Screencaps

Before

Before.AvatarBase.mp4

After

No changes to the functionality of the component, stories, and controls all work. Updated docs.

screen-recording-2023-04-07-at-123922-pm_0cUhUGas.mp4

Manual Testing Steps

  • Go to the storybook build on this PR
  • Search AvatarBase in IDE and story in storybook.
  • Check docs align with enums

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be required.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@spiritanand spiritanand marked this pull request as ready for review April 7, 2023 09:44
@spiritanand spiritanand requested a review from a team as a code owner April 7, 2023 09:44
@spiritanand spiritanand requested a review from danjm April 7, 2023 09:44
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Not sure if Text being in TS is a dependency of this PR?

DDDDDanica
DDDDDanica previously approved these changes Apr 12, 2023
@spiritanand
Copy link
Contributor Author

@georgewrmarshall I am getting the error
AvatarBase not found via ../avatar-base/index.ts -> ../avatar-base/avatar-base.js import/named

@spiritanand
Copy link
Contributor Author

@georgewrmarshall what is the update on my questions?

@georgewrmarshall
Copy link
Contributor

Hi @spiritanand, I'm not sure what your issue is from a quick glance. I'll try do some digging this week. It also looks like you have a failing unit test.

Screenshot 2023-04-27 at 8 45 08 AM

@spiritanand
Copy link
Contributor Author

Thanks for the catch @legobeat, that was something I missed as well. The linting errors that I am getting are,
image

I have fixed the issue you have pointed out above, though. Added forwardRef in AvatarBase

@spiritanand
Copy link
Contributor Author

It is working perfectly. Thank you, @legobeat and @georgewrmarshall

You guys have been tremendously patient and helpful :)

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Looking great! Left 2 small suggestions

@spiritanand
Copy link
Contributor Author

Done :)

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! 💯 Thank you for you contribution @spiritanand

Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

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

LGTM

@georgewrmarshall georgewrmarshall merged commit c92d738 into MetaMask:develop May 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2023
@spiritanand spiritanand deleted the migrate_avatar_base_ts branch May 8, 2023 02:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external-contributor team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate components to TS: AvatarBase
5 participants