Buslowicz / twc

TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
32 stars 1 forks source link

Element documentation doesn't work #58

Closed tpluscode closed 7 years ago

tpluscode commented 7 years ago

Related to #47, when the exported element class has a documentation comment, it is already included in the HTML output and it seems that it can work fine when all docs are in script.

It doesn't work however, because TWC outputs the Polymer() call as assignment to variable:

var MyElement = Polymer(
  {
    "is": "my-element"
  }
);

For the iron-component-page to work the generated output must be just the Polymer() call with no assignment. Otherwise the comment doesn't show

Buslowicz commented 7 years ago

It has to be something else. I created an element with Polymer CLI, wrapped the JS declaration of the element with IIFE and assigned output to a variable. It still generates the proper documentation when polymer serve is fired. I am working on preserving jsDoc twc-47 branch, once it's finished and merged we will try again with it.

tpluscode commented 7 years ago

No matter. With the documentation comment being moved above <dom-module> it doesn't need fixing ATM.

The only reason would be to potentially ensure that elements without <dom-module> can be generated.

Buslowicz commented 7 years ago

Every element is wrapped with <dom-module>, even those without template, so there will be no issue :).