-
-
Notifications
You must be signed in to change notification settings - Fork 255
feat: Migrate controller guidelines and examples to new Messenger #6335
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
Conversation
815bf50 to
39756ca
Compare
ae71891 to
67c7853
Compare
0a1a16b to
0bdc3d1
Compare
0bdc3d1 to
7bbe29c
Compare
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.
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.
This comment was marked as resolved.
This comment was marked as resolved.
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.
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.
…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
c4836ce to
d669a35
Compare
|
Rebased to resolve conflict (the messenger package publish) |
mcmire
left a comment
There was a problem hiding this 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.
packages/sample-controllers/src/sample-gas-prices-controller.test.ts
Outdated
Show resolved
Hide resolved
0f4215d to
5d451a9
Compare
efa167b to
80d7730
Compare
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
mcmire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cryptodev-2s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
nit: we should run |
Explanation
Migrate the controller guidelines and the
sample-controllerspackage to thenextexport of the@metamask/base-controllerpackage and the newMessengerclass from@metamask/messenger.References
Relates to #5626
Checklist
Note
Migrate controller docs and sample-controllers to the new @metamask/messenger Messenger and @metamask/base-controller/next, updating APIs, metadata, tests, and dependencies.
@metamask/messengerMessengerinstead ofRestrictedMessenger; update examples for actions/events typing, root/child messenger setup, delegation, and selector utilities (MessengerActions/MessengerEvents).messenger.call/subscribe/publish/registerMethodActionHandlers.@metamask/sample-controllers)@metamask/base-controller/nextand@metamask/messenger.messagingSystem.*withmessenger.*; update controller/service messenger types toMessenger<...>and constructor usage.anonymous→includeInDebugSnapshot).Messenger, mock namespace utilities, andMessengerActions/MessengerEvents.@metamask/messenger; update TS project references.sample_controllers --> messenger; add middleware/controller edge; list@metamask/messengerpackage.Written by Cursor Bugbot for commit c1ad7a4. This will update automatically on new commits. Configure here.