-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add BaseControllerV2 support to ComposableController #447
Conversation
|
c81ceaf
to
7c7eb66
Compare
91d13f2
to
c38021a
Compare
The ComposableController now supports controllers that are based upon BaseControllerV2. These newer controllers use the controller messaging system to communicate, so the messenger is now a required constructor parameter if any BaseControllerV2 controllers are used. The `name` property in `BaseControllerV2` had to be made public for the ComposableController to properly construct its state. This seems OK. It was only kept private initially until a use was found for it.
c38021a
to
6ee460f
Compare
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!
I have one inline nit. Should Mark decide to address it, I hereby grant literally anyone who is able my permission to rubber stamp this PR once that commit is made and this approval becomes invalidated.
These generic type parameters weren't really used in practice. They were passed to the `messagingSystem`, but we erased the type of the messaging system in the one place that we call it, making the more specific types pointless. You can tell that they weren't useful because they were never set in tests, and everything still worked.
I've pushed one more commit to simplify the ComposableController type by removing the generic parameters: b1772f2. This should be ready for review again now |
…rollers When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events.
…rollers When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events.
…rollers When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events.
…rollers (#458) When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events. The BaseControllerV2 class now prevents the use of the `subscribe` property, ensuring the duck typing strategy used by the ComposableController to tell old and new controllers apart continues to work.
This reverts commit 5777094.
* openseainterface * openseainterface * types * fixes MetaMask/metamask-mobile#2264 * collectiblesmetadata * collectiblecontract * compareCollectiblesMetadata * compareCollectiblesMetadatatest * ignoreassigns * lintfix * Revert "Add BaseControllerV2 support to ComposableController (#447)" This reverts commit 5777094. * ApiCollectibleLastSale * address * addmetadata * fixtests * Revert "Revert "Add BaseControllerV2 support to ComposableController (#447)"" This reverts commit c3ebf47. * ignore
The ComposableController now supports controllers that are based upon BaseControllerV2. These newer controllers use the controller messaging system to communicate, so the messenger is now a required constructor parameter if any BaseControllerV2 controllers are used. The `name` property in `BaseControllerV2` had to be made public for the ComposableController to properly construct its state. This seems OK. It was only kept private initially until a use was found for it.
…rollers (#458) When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events. The BaseControllerV2 class now prevents the use of the `subscribe` property, ensuring the duck typing strategy used by the ComposableController to tell old and new controllers apart continues to work.
* openseainterface * openseainterface * types * fixes MetaMask/metamask-mobile#2264 * collectiblesmetadata * collectiblecontract * compareCollectiblesMetadata * compareCollectiblesMetadatatest * ignoreassigns * lintfix * Revert "Add BaseControllerV2 support to ComposableController (#447)" This reverts commit 5777094. * ApiCollectibleLastSale * address * addmetadata * fixtests * Revert "Revert "Add BaseControllerV2 support to ComposableController (#447)"" This reverts commit c3ebf47. * ignore
The ComposableController now supports controllers that are based upon BaseControllerV2. These newer controllers use the controller messaging system to communicate, so the messenger is now a required constructor parameter if any BaseControllerV2 controllers are used. The `name` property in `BaseControllerV2` had to be made public for the ComposableController to properly construct its state. This seems OK. It was only kept private initially until a use was found for it.
…rollers (#458) When adding support for BaseControllerV2 to the ComposableController in #447, we accidentally removed support for using two different versions of the BaseController in the same ComposableController. This is because we used the `instanceof` operator to check whether a controller was extended from BaseController. The `instanceof` check has been replaced by a check for the `subscribe` function. It seems unlikely that a BaseControllerV2 controller will ever have a `subscribe` function because the controller messenger will be used for all events. The BaseControllerV2 class now prevents the use of the `subscribe` property, ensuring the duck typing strategy used by the ComposableController to tell old and new controllers apart continues to work.
* openseainterface * openseainterface * types * fixes MetaMask/metamask-mobile#2264 * collectiblesmetadata * collectiblecontract * compareCollectiblesMetadata * compareCollectiblesMetadatatest * ignoreassigns * lintfix * Revert "Add BaseControllerV2 support to ComposableController (#447)" This reverts commit 5777094. * ApiCollectibleLastSale * address * addmetadata * fixtests * Revert "Revert "Add BaseControllerV2 support to ComposableController (#447)"" This reverts commit c3ebf47. * ignore
The ComposableController now supports controllers that are based upon BaseControllerV2. These newer controllers use the controller messaging system to communicate, so the messenger is now a required constructor parameter if any BaseControllerV2 controllers are used.
The
name
property inBaseControllerV2
had to be made public for the ComposableController to properly construct its state. This seems OK. It was only kept private initially until a use was found for it.