Skip to content

Conversation

@Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 19, 2025

Explanation

Migrate the controller guidelines and the sample-controllers package to the next export of the @metamask/base-controller package and the new Messenger class from @metamask/messenger.

References

Relates to #5626

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Migrate controller docs and sample-controllers to the new @metamask/messenger Messenger and @metamask/base-controller/next, updating APIs, metadata, tests, and dependencies.

  • Docs
    • Rewrite guidelines and data-services to use @metamask/messenger Messenger instead of RestrictedMessenger; update examples for actions/events typing, root/child messenger setup, delegation, and selector utilities (MessengerActions/MessengerEvents).
    • Replace references to “messaging system” with “messenger”; update code samples to messenger.call/subscribe/publish/registerMethodActionHandlers.
  • Sample Controllers (@metamask/sample-controllers)
    • Migrate to @metamask/base-controller/next and @metamask/messenger.
    • Replace messagingSystem.* with messenger.*; update controller/service messenger types to Messenger<...> and constructor usage.
    • Update state metadata (anonymousincludeInDebugSnapshot).
    • Revise tests to use new Messenger, mock namespace utilities, and MessengerActions/MessengerEvents.
    • Add dependency on @metamask/messenger; update TS project references.
    • Changelog: mark BREAKING changes for Messenger migration and metadata rename.
  • Repo/README
    • Dependency graph: add sample_controllers --> messenger; add middleware/controller edge; list @metamask/messenger package.

Written by Cursor Bugbot for commit c1ad7a4. This will update automatically on new commits. Configure here.

@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch 2 times, most recently from 815bf50 to 39756ca Compare August 19, 2025 18:05
@Gudahtt Gudahtt force-pushed the messenger-migrate-base-controller branch 2 times, most recently from ae71891 to 67c7853 Compare August 20, 2025 14:04
Base automatically changed from messenger-migrate-base-controller to main August 20, 2025 14:10
@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch 4 times, most recently from 0a1a16b to 0bdc3d1 Compare August 20, 2025 15:58
@Gudahtt Gudahtt marked this pull request as ready for review August 20, 2025 15:58
@Gudahtt Gudahtt requested a review from a team as a code owner August 20, 2025 15:58
@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch from 0bdc3d1 to 7bbe29c Compare August 20, 2025 17:25
cursor[bot]

This comment was marked as outdated.

Gudahtt added a commit that referenced this pull request Aug 20, 2025
Tests that used the `@metamask/base-controller/next` export were not
working correctly until after a build was completed. They were using
the built code rather than the source code. On CI the tests run without
any build, so they would always fail.

This was resolved up updating the TSConfig and Jest config to map the
`next` export to the correct source code.

This unblocks #6335 as well as other controller migrations to the
upcoming BaseController version.
Gudahtt added a commit that referenced this pull request Aug 20, 2025
Tests that used the `@metamask/base-controller/next` export were not
working correctly until after a build was completed. They were using
the built code rather than the source code. On CI the tests run without
any build, so they would always fail.

This was resolved up updating the TSConfig and Jest config to map the
`next` export to the correct source code.

This unblocks #6335 as well as other controller migrations to the
upcoming BaseController version.
@Gudahtt

This comment was marked as resolved.

Gudahtt added a commit that referenced this pull request Aug 20, 2025
Tests that used the `@metamask/base-controller/next` export were not
working correctly until after a build was completed. They were using
the built code rather than the source code. On CI the tests run without
any build, so they would always fail.

This was resolved up updating the TSConfig and Jest config to map the
`next` export to the correct source code.

This unblocks #6335 as well as other controller migrations to the
upcoming BaseController version.
Gudahtt added a commit that referenced this pull request Aug 21, 2025
Tests that used the `@metamask/base-controller/next` export were not
working correctly until after a build was completed. They were using
the built code rather than the source code. On CI the tests run without
any build, so they would always fail.

This was resolved up updating the TSConfig and Jest config to map the
`next` export to the correct source code.

This unblocks #6335 as well as other controller migrations to the
upcoming BaseController version.
Gudahtt added a commit that referenced this pull request Aug 21, 2025
…6349)

## Explanation

Tests that used the `@metamask/base-controller/next` export were not
working correctly until after a build was completed. They were using the
built code rather than the source code. On CI the tests run without any
build, so they would always fail.

This was resolved up updating the TSConfig and Jest config to map the
`next` export to the correct source code.

This unblocks #6335 as well as other controller migrations to the
upcoming BaseController version.

## References

Relates to #5626

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] 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),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch 2 times, most recently from c4836ce to d669a35 Compare August 21, 2025 16:43
@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 21, 2025

Rebased to resolve conflict (the messenger package publish)

@Gudahtt Gudahtt mentioned this pull request Jul 17, 2025
43 tasks
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.

Had some minor comments, but overall these changes make sense.

@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch 2 times, most recently from 0f4215d to 5d451a9 Compare August 28, 2025 16:50
@Gudahtt Gudahtt force-pushed the messenger-migrate-controller-docs branch from efa167b to 80d7730 Compare October 21, 2025 20:57
@socket-security
Copy link

socket-security bot commented Oct 21, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

mcmire
mcmire previously approved these changes Oct 21, 2025
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.

LGTM!

cryptodev-2s
cryptodev-2s previously approved these changes Oct 21, 2025
Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikesposito
Copy link
Member

nit: we should run yarn update-readme-content to refresh the README dependency graph

@mikesposito mikesposito dismissed stale reviews from cryptodev-2s and mcmire via f8360c3 October 24, 2025 17:43
@mikesposito mikesposito added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit a607066 Oct 27, 2025
256 of 257 checks passed
@mikesposito mikesposito deleted the messenger-migrate-controller-docs branch October 27, 2025 13:18
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.

5 participants