iron-component-page icon indicating copy to clipboard operation
iron-component-page copied to clipboard

Elements Shouldn't show Polymer's internal API

Open manolo opened this issue 7 years ago • 4 comments

Description

Elements directly extending the Polymer.Element, shouldn't show methods listed in Polymer.ElementMixin or Polymer.PropertyEffects

Expected outcome

Create a new element with polymer init and add iron-component-page to its index.html. Since the element does not have any method, the API should look:

screen shot 2017-08-28 at 11 11 07

Actual outcome

The API of Polymer.Element is listed instead

screen shot 2017-08-28 at 11 12 35

manolo avatar Aug 28 '17 09:08 manolo

Note that just when the simple element extends an empty mixin, the problem is fixed.

  /**
   * @polymerMixin
   */
  Foo = superClass => class FooMixin extends superClass {
  };
class KkElement extends Foo(Polymer.Element) {
...

Probably the issue might be fixed in the analyzer.

manolo avatar Aug 28 '17 10:08 manolo

Something I would really like to see which would fix this nicely is to add checkbox's to enable/disable each source of inherited properties/methods so you can focus on just what you care about.

jsilvermist avatar Aug 28 '17 10:08 jsilvermist

Friendly ping to @aomarks. 🙂

abdonrd avatar Nov 30 '17 14:11 abdonrd

@manolo Another one liner workaround is: class SomeElement extends (class extends Polymer.Element {})

Reference: https://github.com/Polymer/tools/issues/1566#issuecomment-341096900

armujahid avatar Jul 26 '19 10:07 armujahid