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 analyzer: add event parsing when a property is defined with notify true #250

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jpradelle
Copy link

Analysis of Polymer custom components doesn't report Polymer events of properties with notify: true attribute.

This pull request adds it according to documentation: https://polymer-library.polymer-project.org/3.0/docs/devguide/data-system#change-events

Example of analyzed source
import {PolymerElement, html} from '@polymer/polymer/polymer-element';

/**
 * @polymer
 *
 * @fires test-event {CustomEvent<{foo: string}>} - Demo test event
 */
export class PolymerTest extends PolymerElement {
  static get properties() {
    return {
      fooBar: {
        type: String,
        notify: true
      },

      testType: {
        type: String
      }
    };
  }

  static get template() {
    return html`
      <p>Hello</p>
    `;
  }
}

customElements.define('polymer-test', PolymerTest);
Markdown result with pull request code

polymer-test

Events

Event Type Description
foo-bar-changed CustomEvent<{value: *, path: ?string}> Fired when the fooBar property changes
test-event CustomEvent<{foo: string}> Demo test event
Markdown result without pull request code

Events

Event Type Description
test-event CustomEvent<{foo: string}> Demo test event

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

Successfully merging this pull request may close these issues.

1 participant