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

Create a basic jsdoc externs file for Polymer #769

Merged
merged 7 commits into from
Oct 16, 2014
Merged

Conversation

rictic
Copy link
Contributor

@rictic rictic commented Sep 25, 2014

No description provided.

jklein24 added a commit to jklein24/paper-radio-button that referenced this pull request Oct 14, 2014
…radio-button. Note that the externs are dependent on the Polymer externs in the pull request at Polymer/polymer#769.
jklein24 added a commit to jklein24/paper-checkbox that referenced this pull request Oct 14, 2014
@sjmiles sjmiles assigned ajklein and tjsavage and unassigned sjmiles and ajklein Oct 15, 2014
@sjmiles
Copy link
Contributor

sjmiles commented Oct 15, 2014

Taylor, we need to reroute this, I'm not the guy for externs. Maybe this goes to AJ?

@nevir nevir assigned nevir and unassigned tjsavage Oct 15, 2014

/**
* @param {string} name The name of the declared Polymer element.
* @param {PolymerElement} prototype The prototype of the element.
Copy link
Contributor

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.

Copy link
Contributor Author

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)

Copy link
Contributor

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.
*/
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nevir
Copy link
Contributor

nevir commented Oct 16, 2014

Alrighty, that's it from me

nevir added a commit that referenced this pull request Oct 16, 2014
Create a basic jsdoc externs file for Polymer
@nevir nevir merged commit 8019715 into Polymer:master Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants