Move peer deps for controller/service packages to direct deps#7209
Merged
Move peer deps for controller/service packages to direct deps#7209
Conversation
Some controllers and services expect other controllers and services to pre-exist so that they can communicate with them. Traditionally the way that we have expressed this dependency is via peer dependencies. That is, if a controller in `@metamask/foo-controller` used a service in `@metamask/bar-service`, then it would declare a peer dependency on a major version of `@metamask/bar-service`. This would enforce that clients declare a direct dependency on `@metamask/bar-service` and the major version used for this dependency matched the major version that `@metamask/foo-controller` expressed. However, this approach complicates the release process. If the major version of a package is bumped, it must be synchronized across all peer dependents across the monorepo. But as a result, all peer dependents must be bumped by a major (since changing a peer dependency is a breaing change) and thus must be included in the release. This means that releases can quickly balloon in size, causing pain for other teams. To address this issue, this commit converts all peer dependencies on controller and service packages to regular direct dependencies. This allows major versions of packages to be released more flexibly as needed. However, this change also means that, at the client level, it is possible for different versions of packages to be present in the dependency tree. For instance, the client could directly depend on `@metamask/foo-controller` 1.0.0 and `@metamask/bar-controller` 1.0.0, but `@metamask/bar-controller` could itself depend on `@metamask/foo-controller` 1.1.0. So while `@metamask/bar-controller` thinks it is talking to a later version of `@metamask/foo-controller`, it would actually be talking to an earlier version. In most cases any incompatibilities would show up at compile-time, but they could also show up at runtime. In general we expect client engineers to be aware of these differences when making new releases — perhaps more aware than they might be now.
9e115bc to
5342e97
Compare
Contributor
Author
|
Adding the |
cryptodev-2s
approved these changes
Nov 21, 2025
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 21, 2025
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Minor release of @metamask/transaction-controller. Added `musdConversion` transaction type. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## 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 communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Releases 691.0.0, publishing @metamask/transaction-controller 62.2.0 (adds `musdConversion` type) and updating all dependents to ^62.2.0 with corresponding changelog entries. > > - **Core** > - Bump monorepo version to `691.0.0`. > - **Transaction Controller** > - Release `@metamask/transaction-controller@62.2.0` adding `musdConversion` transaction type. > - **Dependents updated to `^62.2.0`** > - `@metamask/assets-controllers`, `bridge-controller`, `bridge-status-controller`, `eip-5792-middleware`, `gator-permissions-controller`, `network-enablement-controller`, `phishing-controller`, `shield-controller`, `subscription-controller`, `transaction-pay-controller`, `user-operation-controller`, and devDep in `earn-controller`. > - **Changelogs** > - Note dependency bumps and continued migration of peer deps to direct deps (refs `#7209`, `#7220`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b7997e5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
7 tasks
github-merge-queue Bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 23, 2026
## **Description** Bump the following packages: ### `@metamask/chain-agnostic-permission` `^1.3.0` → `^1.4.0` [Changelog](https://github.com/MetaMask/core/blob/main/packages/chain-agnostic-permission/CHANGELOG.md#140) - **Added:** `Bip122AccountChangedNotifications` property in `KnownSessionProperties` enum ([#7537](MetaMask/core#7537)) - **Changed:** Remove `@metamask/network-controller` dependency ([#7561](MetaMask/core#7561)) - **Changed:** Dependency bumps (`@metamask/utils`, `@metamask/controller-utils`, `@metamask/permission-controller`) ### `@metamask/multichain-api-middleware` `^1.2.5` → `^1.2.7` [Changelog](https://github.com/MetaMask/core/blob/main/packages/multichain-api-middleware/CHANGELOG.md#127) - **v1.2.7:** Dependency bumps (`network-controller` ^30.0.0, `json-rpc-engine`, `multichain-transactions-controller`, `controller-utils`) - **v1.2.6 Fixed:** `wallet_revokeSession` to handle cases where `params` is not provided ([#7551](MetaMask/core#7551)) - **v1.2.6 Changed:** Dependency bumps (`json-rpc-engine`, `utils`, `network-controller`, `controller-utils`, `permission-controller`, `chain-agnostic-permission`) ### `@metamask/ppom-validator` `0.39.0` → `0.39.1` [Changelog](https://github.com/MetaMask/ppom-validator/blob/main/CHANGELOG.md#0391) - **Changed:** Move `@metamask/network-controller` from peer to direct dependency and bump ^25.0.0 → ^30.0.0 ([#254](MetaMask/ppom-validator#254)) - **Changed:** Bump `@metamask/utils` from `^9.2.1` to `^11.0.0` ([#254](MetaMask/ppom-validator#254)) ### `@metamask/selected-network-controller` `^25.0.0` → `^26.0.3` [Changelog](https://github.com/MetaMask/core/blob/main/packages/selected-network-controller/CHANGELOG.md#2600) - **v26.0.0 BREAKING:** Use `InternalProvider` instead of `SafeEventEmitterProvider` ([#6796](MetaMask/core#6796)) - **v26.0.0 BREAKING:** Bump `@metamask/network-controller` from ^25.0.0 to ^26.0.0 ([#7202](MetaMask/core#7202)) - **v26.0.1:** Move peer dependencies to direct dependencies (`network-controller`, `permission-controller`) ([#7209](MetaMask/core#7209)) - **v26.0.2–v26.0.3:** Dependency bumps (`network-controller` to ^30.0.0, `json-rpc-engine`) No code changes required — breaking changes are internal to the packages and don't affect extension usage. All dependency versions are already compatible. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A ## **Manual testing steps** 1. Build the extension and verify it runs correctly 2. Confirm no type errors are introduced ## **Screenshots/Recordings** N/A — dependency-only changes ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Dependency-only update, but it upgrades core networking/permission-related packages (e.g., `@metamask/selected-network-controller` and transitive `@metamask/network-controller`/RPC middleware), which can subtly affect session/network behavior at runtime. > > **Overview** > Bumps several MetaMask core dependencies: `@metamask/chain-agnostic-permission` to `^1.4.0`, `@metamask/multichain-api-middleware` to `^1.2.7`, `@metamask/ppom-validator` to `0.39.1`, and `@metamask/selected-network-controller` to `^26.0.3`. > > Updates `yarn.lock` accordingly, including transitive shifts such as `@metamask/network-controller` moving to `^30.0.0` in dependent packages and related RPC middleware/util version bumps. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 133258b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Some controllers and services expect other controllers and services to pre-exist so that they can communicate with them. Traditionally the way that we have expressed this dependency is via peer dependencies. That is, if a controller in
@metamask/foo-controllerused a service in@metamask/bar-service, then it would declare a peer dependency on a major version of@metamask/bar-service. This would enforce that clients declare a direct dependency on@metamask/bar-serviceand the major version used for this dependency matched the major version that@metamask/foo-controllerexpressed.However, this approach complicates the release process. If the major version of a package is bumped, it must be synchronized across all peer dependents across the monorepo. But as a result, all peer dependents must be bumped by a major (since changing a peer dependency is a breaking change) and thus must be included in the release. This means that releases can quickly balloon in size, causing pain for other teams.
To address this issue, this commit converts all peer dependencies on controller and service packages to regular direct dependencies. This allows major versions of packages to be released more flexibly as needed.
However, this change also means that, at the client level, it is possible for different versions of packages to be present in the dependency tree. For instance, the client could directly depend on
@metamask/foo-controller1.0.0 and@metamask/bar-controller1.0.0, but@metamask/bar-controllercould itself depend on@metamask/foo-controller1.1.0. So while@metamask/bar-controllerthinks it is talking to a later version of@metamask/foo-controller, it would actually be talking to an earlier version.In most cases any incompatibilities would show up at compile-time, but they could also show up at runtime. In general we expect client engineers to be aware of these differences when making new releases — perhaps more aware than they might be now.
References
Closes https://consensyssoftware.atlassian.net/browse/WPC-91.
Checklist
Note
Replaces peerDependencies with direct dependencies across controller/service packages and updates Yarn config/lock/validation to enforce the new model.
peerDependenciesto directdependenciesacross many packages (e.g., accounts, assets, bridge, gas-fee, network, profile-sync, signature, transaction, etc.).peerDependenciesand adjustdevDependenciesaccordingly; updateyarn.lock.devDependenciesfor non-workspace peers.Written by Cursor Bugbot for commit 47a5aed. This will update automatically on new commits. Configure here.