Skip to content
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

Merged
merged 3 commits into from
Apr 22, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 19, 2021

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.

@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 19, 2021

This depends upon #446

@Gudahtt Gudahtt force-pushed the restricted-controller-messenger-optional-allowed branch from c81ceaf to 7c7eb66 Compare April 19, 2021 19:30
@Gudahtt Gudahtt force-pushed the composed-controller-v2-compatibility branch from 91d13f2 to c38021a Compare April 19, 2021 19:31
Base automatically changed from restricted-controller-messenger-optional-allowed to develop April 19, 2021 21:37
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.
@Gudahtt Gudahtt force-pushed the composed-controller-v2-compatibility branch from c38021a to 6ee460f Compare April 19, 2021 21:37
@Gudahtt Gudahtt marked this pull request as ready for review April 19, 2021 21:37
@Gudahtt Gudahtt requested a review from a team as a code owner April 19, 2021 21:37
rekmarks
rekmarks previously approved these changes Apr 22, 2021
Copy link
Member

@rekmarks rekmarks left a 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.

src/ComposableController.ts Show resolved Hide resolved
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.
@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 22, 2021

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

@rekmarks rekmarks self-assigned this Apr 22, 2021
@Gudahtt Gudahtt merged commit 5777094 into develop Apr 22, 2021
@Gudahtt Gudahtt deleted the composed-controller-v2-compatibility branch April 22, 2021 21:49
Gudahtt added a commit that referenced this pull request Apr 30, 2021
…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.
Gudahtt added a commit that referenced this pull request Apr 30, 2021
…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.
Gudahtt added a commit that referenced this pull request Apr 30, 2021
…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.
Gudahtt added a commit that referenced this pull request Apr 30, 2021
…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.
estebanmino added a commit that referenced this pull request May 4, 2021
@Gudahtt Gudahtt mentioned this pull request May 18, 2021
estebanmino added a commit that referenced this pull request May 20, 2021
estebanmino added a commit that referenced this pull request May 20, 2021
* 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
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
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.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…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.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* 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
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
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.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
…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.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* 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
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.

2 participants