-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Migrate core/connection.js to goog.module syntax #5102
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
Migrate core/connection.js to goog.module syntax #5102
Conversation
| Blockly.Connection.REASON_DIFFERENT_WORKSPACES = 5; | ||
| Blockly.Connection.REASON_SHADOW_PARENT = 6; | ||
| Blockly.Connection.REASON_DRAG_CHECKS_FAILED = 7; | ||
| Connection.CAN_CONNECT = 0; |
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.
This looks like an instance of "Exports a class constructor with unrelated static properties", which is one of the triage categories in #5073
Intuitively, I expected that these would be exported directly.
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.
Yes: not for this PR, but this looks like it should be an enum. In that form I think it is probably closely-related enough that it could be exported either as a static property of Connection (e.g. Connection.Reason) or beside it (e.g., exports = {Connection, ConnectionReason}). Added to list in #5073.
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.
Is there any action needed here beyond adding to the triage list?
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.
Nope.
core/connection.js
Outdated
| * @private | ||
| */ | ||
| Blockly.Connection.connectReciprocally_ = function(first, second) { | ||
| Connection.connectReciprocally_ = function(first, second) { |
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.
Since this one is private and static, I think it can just become a module-internal function named connectReciprocally.
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.
Same for the next few private static functions.
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.
Done!
|
As mentioned in the team meeting, this is one of the files I'm going to be modifying. In this case, to deal with shadows. |
The basics
goog_modulegoog_moduleconversion guide
npm testlocally already.The details
Resolves
Part of #5026