Skip to content

Bump @metamask/assets-controller to v20.0.0#22152

Merged
adonesky1 merged 3 commits intodevelopfrom
assets-controllers-v20-revert
Dec 6, 2023
Merged

Bump @metamask/assets-controller to v20.0.0#22152
adonesky1 merged 3 commits intodevelopfrom
assets-controllers-v20-revert

Conversation

@adonesky1
Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 commented Dec 4, 2023

Bumps @metamask/assets-controller to v20.0.0.

Adds getNetworkClientById callback to TokenRatesController constructor to address only breaking change

This overwrites and deletes a patch that was added on top of @metamask/assets-controllers version 19.0.0. This was added for the 11.7.0 extension release but can be removed now and will be added back later via MetaMask/core#3619 (cc @DDDDDanica @Gudahtt)

@adonesky1 adonesky1 requested review from a team as code owners December 4, 2023 22:17
@adonesky1 adonesky1 changed the title Bump @metamask/assets-controller to v20 Bump @metamask/assets-controller to v20.0.0 Dec 4, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 4, 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.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Dec 4, 2023

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/assets-controllers 19.0.0...20.0.0 None +3/-3 1.3 MB metamaskbot

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Dec 4, 2023
jiexi
jiexi previously approved these changes Dec 4, 2023
yarn.lock Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This dependency becomes duplicated here and @metamask/keyring-controller is still staying on @metamask/preferences-controller@4.4.3. Is this as intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@legobeat legobeat Dec 5, 2023

Choose a reason for hiding this comment

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

Before this PR, this repo has:

  • @metamask/preferences-controller@4.4.3
    • via @metamask/assets-controller@19.0.0
    • via @metamask/keyring-controller@8.1.0

After:

  • @metamask/preferences-controller@4.4.3
    • via @metamask/keyring-controller@8.1.0
  • @metamask/preferences-controller@5.0.0
    • via @metamask/assets-controller@20.0.0

Highlighting to ensure that this has been considered and the update here doesn't mean that the peerDependencies of either of these get violated due to expecting one version and getting passed an incompatible one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤔 But they're different major versions? Won't @metamask/keyring-controller@8.1.0 just continue to get @metamask/preferences-controller@4.4.3 and now @metamask/preferences-controller@4.4.3 will use @metamask/preferences-controller@5.0.0?
We have 3 different major versions of @metamask/eth-sig-util in the extension's dependency graph for example. Each dep gets the right version as a sub dep:
Screenshot 2023-12-05 at 8 43 15 PM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@adonesky1 the concern that @legobeat is voicing isn't that they operate on different code, but rather that values or instances in the extension get passed around that might differ in shape for the two various preferences controllers. As an example imagine if each of these controllers (assets and keyring) required an instance of Preferences Controller to be supplied to it. If the differences in the preferences controller was breaking its reasonable to assume that the instance passed in to these two controllers would not satisfy both.

I don't think this is the case here, but this is what @legobeat is trying to be assured of. It doesn't necessarily have to be passed in either. If each instance of preferences controller required the presence of a named post message stream to exist on the extension, and the major version changed the way this stream works with data, then it would fundamentally cause a problem because each version of the preferences controller would be looking for different signatures.

again not saying that is happening here :) he just wants us to be sure that these differing versions have been accounted for. In addition we should do our best to not duplicate dependencies as this causes bloat in bundle size as you are well aware given all of your past work trying to mitigate this issue. So its good to note and call out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gotcha. Yeah I see now. Well hilariously in this case the extension uses its own version of the PreferenceController. And definitely no instance of the controller is passed around. The breaking change that caused the bump to version 5.0.0 was adding the showIncomingTransactions value to state which is never referenced anywhere in @metamask/assets-controllers so I think we're all good.

Copy link
Copy Markdown
Contributor

@legobeat legobeat Dec 6, 2023

Choose a reason for hiding this comment

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

Thanks for sharing my perspective @brad-decker 😸

Secondary concern to the main point above but it also looks like think the ~34kb bundle-size increase incurred here could be undone if they get back on the same version.

@adonesky1 adonesky1 force-pushed the assets-controllers-v20-revert branch from 92a369f to 9e51ccd Compare December 5, 2023 18:01
@adonesky1 adonesky1 added team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Dec 5, 2023
@adonesky1 adonesky1 force-pushed the assets-controllers-v20-revert branch from 9e51ccd to 7b1d06e Compare December 5, 2023 18:43
@adonesky1 adonesky1 force-pushed the assets-controllers-v20-revert branch from 7b1d06e to 44c0fdb Compare December 5, 2023 18:47
@adonesky1 adonesky1 requested review from jiexi and legobeat December 5, 2023 18:50
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Dec 5, 2023
DDDDDanica
DDDDDanica previously approved these changes Dec 5, 2023
@adonesky1 adonesky1 removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Dec 5, 2023
@adonesky1 adonesky1 requested a review from DDDDDanica December 6, 2023 02:44
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [2b21415]
Page Load Metrics (1333 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint933231314924
domContentLoaded10222354622
load10711800133317283
domInteractive10222354622
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 944 Bytes (0.02%)
  • ui: 0 Bytes (0.00%)
  • common: 33.81 KiB (0.66%)

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7a1aa46) 67.71% compared to head (2b21415) 67.67%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22152      +/-   ##
===========================================
- Coverage    67.71%   67.67%   -0.05%     
===========================================
  Files         1052     1052              
  Lines        40859    40876      +17     
  Branches     10945    10950       +5     
===========================================
- Hits         27667    27660       -7     
- Misses       13192    13216      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adonesky1 adonesky1 merged commit 4e460c7 into develop Dec 6, 2023
@adonesky1 adonesky1 deleted the assets-controllers-v20-revert branch December 6, 2023 15:39
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2023
@metamaskbot metamaskbot added the release-11.8.0 Issue or pull request that will be included in release 11.8.0 label Dec 6, 2023
@metamaskbot metamaskbot added release-11.7.3 Issue or pull request that will be included in release 11.7.3 and removed release-11.8.0 Issue or pull request that will be included in release 11.8.0 labels Jan 2, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-11.7.3 on PR. Adding release label release-11.7.3 on PR and removing other release labels(release-11.8.0), as PR was cherry-picked in branch 11.7.3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.7.3 Issue or pull request that will be included in release 11.7.3 team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants