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

Polymer 2.0 issues #892

Closed
21 of 25 tasks
aomarks opened this issue Nov 7, 2017 · 3 comments
Closed
21 of 25 tasks

Polymer 2.0 issues #892

aomarks opened this issue Nov 7, 2017 · 3 comments

Comments

@aomarks
Copy link
Member

aomarks commented Nov 7, 2017

The following are the remaining TypeScript issues with the Polymer 2.0 core library.

Missing APIs:

Things we shouldn't emit:

  • polymer/lib/utils/templatize.d.ts(40,15): error TS2300: Duplicate identifier 'klass'.

Missing types:

  • polymer/lib/legacy/class.d.ts(79,24): error TS2304: Cannot find name 'PolymerInit'.
  • polymer/lib/mixins/element-mixin.d.ts(74,13): error TS2304: Cannot find name -
    'StampedTemplate'.
  • polymer/lib/mixins/property-effects.d.ts(50,19): error TS2304: Cannot find name 'Polymer_PropertyEffects'.
  • polymer/lib/mixins/property-effects.d.ts(59,23): error TS2304: Cannot find name 'TemplateInfo'.
  • polymer/lib/utils/async.d.ts(14,38): error TS2304: Cannot find name 'AsyncInterface'.
  • polymer/lib/utils/async.d.ts(23,29): error TS2304: Cannot find name 'IdleDeadline'.
  • polymer/lib/utils/debounce.d.ts(14,28): error TS2304: Cannot find name 'AsyncModule'.
  • polymer/lib/utils/gestures.d.ts(35,30): error TS2304: Cannot find name 'GestureRecognizer'.
  • polymer/lib/utils/mixin.d.ts(11,33): error TS2304: Cannot find name 'T'.

Other:

  • Namespaces don't have descriptions.
  • Handle visibility. Exclude private things entirely?
  • Don't reference Shady CSS typings, because we aren't generating any (at least for now).
  • Polymer.Element does not inherit PropertyEffects mixin, so set() etc. are missing.
  • Respect @appliesMixin annotation.
  • Some things have a @summary annotation but no main description (e.g. the Polymer.ArraySplice namespace). What do we do with @summary vs description?
  • Output to types directory, if that's what we decide.
  • Many Polymer APIs are missing !s on their @params which they should have (e.g. calculateSplices), so they come out as |null.
@aomarks aomarks self-assigned this Nov 7, 2017
@aomarks aomarks changed the title Polymer 2.0 errors Polymer 2.0 issues Nov 10, 2017
@43081j
Copy link
Contributor

43081j commented Nov 14, 2017

Quite a few methods end up with a return type of any. An example of this is ready().

We should probably add @return {void} to all of these in polymer its self, or detect that the method never returns so we can infer it is void. We can't really safely assume "no return comment" means it returns void, so we should probably just add the missing comments eventually.

Also, a nice thing to have would be to make use of the @appliesMixin jsdoc comment so we can make mixins correctly return an inheriting type (such as T & ElementMixin & PropertyEffectsMixin). This will help avoid repeatedly defining things like ready().

Great work so far, looking good 👍

@43081j
Copy link
Contributor

43081j commented Dec 4, 2017

@aomarks just noticed what seems like a rather clear problem while trying the generated types out...

It seems the generator didn't figure out that Polymer.Element inherits the property effects mixin, so it has no type information for things like set(...) and what not.

https://github.com/Polymer/polymer/blob/1fbb5041d95468d5412317205a235eccc0cda21f/lib/mixins/element-mixin.html#L100

@aomarks
Copy link
Member Author

aomarks commented Dec 27, 2017

Typings are in Polymer master as of Polymer/polymer#4928. Closing this issue. The remaining items can be tracked at the issues below:

Dynamically "forwarded" APIs on Polymer.DomApi (https://github.com/Polymer/polymer/blob/master/lib/legacy/polymer.dom.html#L234).

Tracking at Polymer/polymer#5010. These methods are forwarded with a utility function that means Analyzer does not detect them.

Polymer.dom.flush (https://github.com/Polymer/polymer/blob/master/lib/legacy/polymer.dom.html#L330)
Polymer.dom.addDebouncer (https://github.com/Polymer/polymer/blob/master/lib/legacy/polymer.dom.html#L340)

Tracking at https://github.com/Polymer/polymer-analyzer/issues/752. Top-level function assignments are not picked up by Analyzer, even if they have a @function annotation.

All the getters fromEventApi (https://github.com/Polymer/polymer/blob/master/lib/legacy/polymer.dom.html#L256).

Tracking at https://github.com/Polymer/polymer-analyzer/issues/645. Analyzer needs support for scanning getters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants