We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The analyzer seems to completely ignore ES6 getters - they are not recognized as properties.
We're beginning to switch our code base to use ES6 getters instead of computed properties.
class FooElement extends Polymer.Element { static get is() { return 'foo-element'; } get otherProp() { return 'some value'; } }
The text was updated successfully, but these errors were encountered:
I'm gonna do a pass in a bit where I'll recognize property declarations in constructors. Will be a good time to add this in too.
Sorry, something went wrong.
This lack of functionality affects also: https://github.com/Polymer/polymer-analyzer/issues/329.
Is there any support for analyze elements which extends Polymer.Element with ES6 classes? For my example I don't get any elelements details: test.html
<!-- Test element. --> <script> class FooElement extends Polymer.Element { static get is() { return 'foo-element'; } get otherProp() { return 'some value'; } static get properties() { return { /** * Propety test. */ type: { type: String } } } } </script>
Script.js
const Analyzer = require('polymer-analyzer').Analyzer; const FSUrlLoader = require('polymer-analyzer/lib/url-loader/fs-url-loader').FSUrlLoader; let analyzer = new Analyzer({ urlLoader: new FSUrlLoader('build/debug/xxx/elements'), }); analyzer.analyze(['test.html']).then(result => { // console.log('result', result); var doc = result.getDocument('test.html'); for (const element of doc.getFeatures({kind: 'element'})) { console.log('element', element); } });
@baszczewski You need annotations:
/** * @polymer * @customElement * @extends {Polymer.Element} */ class FooElement extends Polymer.Element { }
Alternatively you need to do customElements.define(FooElement.is, FooElement); in the same script that you declare FooElement.
customElements.define(FooElement.is, FooElement);
FooElement
rictic
No branches or pull requests
The analyzer seems to completely ignore ES6 getters - they are not recognized as properties.
We're beginning to switch our code base to use ES6 getters instead of computed properties.
The text was updated successfully, but these errors were encountered: