-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: have inputs construct connections #7116
fix: have inputs construct connections #7116
Conversation
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.
Reviewed since Rachel is ooo
core/inputs/input.ts
Outdated
@@ -298,6 +293,10 @@ export class Input { | |||
this.connection.dispose(); | |||
} | |||
} | |||
|
|||
protected makeConnection(type: number): Connection { |
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.
Just curious, why isn't the type of type
ConnectionType
?
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.
upon rereading this sentence: @_@
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.
Fixed!
On the block version of this method we used to pass inputTypes
to it sometimes, which isn't compatible with ConnectionType
, so we had to use number
instead. But since the code has been reorganized, that is no longer an issue =) Everything has been switched to use ConnectionType
!
The basics
npm run format
andnpm run lint
The details
Resolves
Fixes #2062
Proposed Changes
Makes it so that inputs must + can easily construct their own connections (for inputs that have connections).
Behavior Before Change
Inputs were passed their connections, except for custom inputs which weren't. It was difficult for custom inputs to construct their own connections, because they had to deal with rendered vs headless.
Behavior After Change
All inputs must construct their own connections. They can easily do this using the
protected makeConnection
method.Reason for Changes
This makes built-in inputs and custom inputs more consistent. It also makes custom inputs with connections easier to implement.
Test Coverage
N/A
Documentation
N/A
Additional Information
N/A