Tools: Polymer Element public API shouldn't be in custom elements extending Polymer.Element

Created on 28 Aug 2017  路  4Comments  路  Source: Polymer/tools

When you have an custom element extending Polymer.Element, all public API of polymer is shown.

class KkElement extends Polymer.Element {
...

Otherwise, if your custom element extends a mixin, Polymer API is not listed.

  /**
   * @polymerMixin
   */
  Foo = superClass => class FooMixin extends superClass {
  };

  class KkElement extends Foo(Polymer.Element) {
  ...

Related with https://github.com/PolymerElements/iron-component-page/issues/147

analyzer

Most helpful comment

a41

All 4 comments

a41

It is possible to use a workaround until proper solution will be implemented.
Workaround: class SomeElement extends (class extends Polymer.Element {})

I dont see this behavior after removing @extends Polymer.Element from jsdoc... not sure its a valid thing to do though

This should be solved in iron-component-page, perhaps by hiding inherited properties by default, or otherwise downplaying them.

From a static analysis perspective, if Foo extends Bar, then Foo also inherits Bar's public API. The reason adding a mixin removes those entries from your iron-component-page results is that mixins currently defeat polymer-analyzer's analysis, but that shouldn't be relied upon.

Was this page helpful?
0 / 5 - 0 ratings