-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Create a basic jsdoc externs file for Polymer #769
Conversation
…radio-button. Note that the externs are dependent on the Polymer externs in the pull request at Polymer/polymer#769.
…. This is dependent on the externs for paper-radio-button (googlearchive/paper-radio-button#8) and Polymer (Polymer/polymer#769).
Taylor, we need to reroute this, I'm not the guy for externs. Maybe this goes to AJ? |
|
||
/** | ||
* @param {string} name The name of the declared Polymer element. | ||
* @param {PolymerElement} prototype The prototype of the element. |
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.
Note we overload this too: Polymer({})
without a name
is also valid (though not seen in the wild that frequently ...yet?). Not sure if that's worth it for the externs, though.
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.
My preference would be to punt on this for the moment, as the existing use cases I've seen for compilation would put the Polymer() calls far away and uncorrelated with the element declaration such that I suspect that it will not be possible to infer the name.
(ok, that and I don't know how to set up the types such that Polymer('hello-world', {}) and Polymer({}) are both accepted but Polymer({}, {}) is rejected)
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.
I think vulcanize handles this now by attaching a name
to the containing element, and we respect that: https://github.com/Polymer/polymer-dev/blob/master/src/declaration/polymer.js#L25
However, I'm there with ya on making the type expression work :P Punt!
Addressing comments in the pull request. A couple more require more experimenting, followup commit coming.
* @param {Array=} opt_args Arguments to pass to callback. | ||
* @param {number=} opt_timeoutMillis Minimum delay in milliseconds before | ||
* calling the callback. | ||
*/ |
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.
async also takes functions by name, and returns a handle (for cancelAsync
): https://github.com/Polymer/polymer-dev/blob/master/src/instance/utils.js#L18-59
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
Alrighty, that's it from me |
Create a basic jsdoc externs file for Polymer
No description provided.