Skip to content

chore(preferences-controller): Clean up types#3712

Merged
Gudahtt merged 1 commit into
mainfrom
clean-up-preferences-controller-types
Jan 4, 2024
Merged

chore(preferences-controller): Clean up types#3712
Gudahtt merged 1 commit into
mainfrom
clean-up-preferences-controller-types

Conversation

@Gudahtt
Copy link
Copy Markdown
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
Copy Markdown
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
@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