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(preferences-controller): Clean up types #3712

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jan 4, 2024

Explanation

The PreferencesController types are now declared as types rather than interfaces, in accordance with our conventions, and they are now fully documented. The state properties have also been alphabetized so that they are easier to maintain.

Additionally, the old "ContactEntry" type has been renamed to "Identity", which is a more accurate name for what it is being used for here.

References

This was an effort to reduce the scope of the BaseControllerV2 migration, tracked by #3708

Changelog

@metamask/preferences-controller

Changed

  • BREAKING: Replace ContactEntry interface with Identity type
  • BREAKING: Convert PreferencesState from an interface to a type

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@Gudahtt Gudahtt force-pushed the clean-up-preferences-controller-types branch 2 times, most recently from bb37cd1 to 320415c Compare January 4, 2024 16:04
@Gudahtt Gudahtt marked this pull request as ready for review January 4, 2024 16:12
@Gudahtt Gudahtt requested a review from a team as a code owner January 4, 2024 16:12
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

The `PreferencesController` types are now declared as types rather than
interfaces, in accordance with our conventions, and they are now fully
documented. The state properties have also been alphabetized so that
they are easier to maintain.

Additionally, the old "ContactEntry" type has been renamed to
"Identity", which is a more accurate name for what it is being used for
here.
@Gudahtt Gudahtt force-pushed the clean-up-preferences-controller-types branch from 320415c to 0ffc8af Compare January 4, 2024 19:45
@Gudahtt Gudahtt merged commit fd7117c into main Jan 4, 2024
136 checks passed
@Gudahtt Gudahtt deleted the clean-up-preferences-controller-types branch January 4, 2024 20:34
@bergeron bergeron mentioned this pull request Jan 9, 2024
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.

2 participants