Skip to content

Create a basic jsdoc externs file for Polymer - #769

Merged
nevir merged 7 commits into
Polymer:masterfrom
rictic:patch-1
Oct 16, 2014
Merged

nevir merged 7 commits into
Polymer:masterfrom
rictic:patch-1

Conversation

@rictic

@rictic rictic commented Sep 25, 2014

Copy link
Copy Markdown
Contributor

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

sjmiles commented Oct 15, 2014

Copy link
Copy Markdown
Contributor

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
Comment thread polymer.externs.js

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
Comment thread polymer.externs.js Outdated

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@nevir

nevir commented Oct 16, 2014

Copy link
Copy Markdown
Contributor

Alrighty, that's it from me

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