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

Improve BaseControllerV2 messenger type #556

Merged
merged 3 commits into from
Aug 18, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 11, 2021

The new base controller now accepts the messenger type as a generic parameter, rather than hard-coding it to be RestrictedControllerMessenger<N, any, any, string, string>. This allows controllers to use the messenger directly without sacrificing any type safety.

Note: this is a breaking change, because anyone extending BaseControllerV2 will now be required to supply an additional generic parameter.

The new base controller now accepts the messenger type as a generic
parameter, rather than hard-coding it to be
`RestrictedControllerMessenger<N, any, any, string, string>`. This
allows controllers to use the messenger directly without sacrificing
any type safety.
@Gudahtt Gudahtt force-pushed the improve-base-controller-v2-messenger-type branch from 869aa30 to c0d7dbc Compare August 11, 2021 15:23
@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 11, 2021

This was motivated by this discussion: #555 (comment)

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!

@Gudahtt Gudahtt merged commit b8c8370 into main Aug 18, 2021
@Gudahtt Gudahtt deleted the improve-base-controller-v2-messenger-type branch August 18, 2021 16:23
@adonesky1 adonesky1 mentioned this pull request Aug 27, 2021
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
The new base controller now accepts the messenger type as a generic
parameter, rather than hard-coding it to be
`RestrictedControllerMessenger<N, any, any, string, string>`. This
allows controllers to use the messenger directly without sacrificing
any type safety.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
The new base controller now accepts the messenger type as a generic
parameter, rather than hard-coding it to be
`RestrictedControllerMessenger<N, any, any, string, string>`. This
allows controllers to use the messenger directly without sacrificing
any type safety.
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