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

Update @metamask/controllers to v33 #16493

Merged
merged 3 commits into from
Nov 15, 2022
Merged

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Nov 14, 2022

The controllers package has been updated to v33. The only breaking change in this release was to rename the term "collectible" to "NFT" wherever it appeared in the API.

Changes in this PR have been kept minimal; additional renaming can be done in separate PRs. This PR only updates the controller names, controller state, controller methods, and any direct references to these things. NFTs are still called "collectibles" in most places.

Manual Testing Steps

To test the migration, you can setup a wallet using a build from develop, then switch to a build on this branch. You can compare the wallet state before and after to ensure the migration was correctly applied.

Aside from the migration, there are functional changes, so any standard regression testing steps would apply. Maybe pay special attention to any NFT-related functionality though.

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 be required.

@Gudahtt Gudahtt force-pushed the update-controllers-to-v33 branch 3 times, most recently from 5967b07 to 0123ab2 Compare November 14, 2022 23:04
@Gudahtt Gudahtt marked this pull request as ready for review November 14, 2022 23:16
@Gudahtt Gudahtt requested a review from a team as a code owner November 14, 2022 23:16
@Gudahtt Gudahtt requested a review from garrettbear November 14, 2022 23:16
@@ -345,14 +345,14 @@ export default class MetamaskController extends EventEmitter {
this.assetsContractController.getERC1155TokenURI.bind(
this.assetsContractController,
),
onCollectibleAdded: ({ address, symbol, tokenId, standard, source }) =>
onNftAdded: ({ address, symbol, tokenId, standard, source }) =>
this.metaMetricsController.trackEvent({
event: EVENT_NAMES.NFT_ADDED,
Copy link
Contributor

Choose a reason for hiding this comment

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

@Gudahtt can you change the event name from EVENT_NAMES.NFT_ADDED to EVENT_NAMES.TOKEN_ADDED? Despite NFT_ADDED being defined in constants/metametrics.js we've never actually used it yet and this would be the preferred way. (ie one event capturing the generalized activity and specific properties to split it out if needed)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds reasonable! I might do this in a separate PR though, it doesn't seem directly related to the controllers update. This code is pre-existing (possibly still behind a build flag)

The controllers package has been updated to v33. The only breaking
change in this release was to rename the term "collectible" to "NFT"
wherever it appeared in the API.

Changes in this PR have been kept minimal; additional renaming can be
done in separate PRs. This PR only updates the controller names,
controller state, controller methods, and any direct references to
these things. NFTs are still called "collectibles" in most places.
@Gudahtt Gudahtt force-pushed the update-controllers-to-v33 branch from e2f4ae6 to c1bbb82 Compare November 15, 2022 17:01
@metamaskbot
Copy link
Collaborator

Builds ready [c1bbb82]
Page Load Metrics (2007 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint89125101105
domContentLoaded15972261198818890
load16352261200718689
domInteractive15972261198818890
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 706 bytes
  • ui: -168 bytes
  • common: -1180 bytes

highlights:

storybook

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM! Tested functionality and migration. All looks good!

@Gudahtt Gudahtt merged commit 4f66dc9 into develop Nov 15, 2022
@Gudahtt Gudahtt deleted the update-controllers-to-v33 branch November 15, 2022 18:49
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants