web-component-analyzer icon indicating copy to clipboard operation
web-component-analyzer copied to clipboard

Methods should be a ComponentMember, attributes should be separate.

Open justinfagnani opened this issue 4 years ago • 0 comments

Properties and methods are actual members of the component class. Attributes are not represented in the JavaScript object model. The current organization of properties and attributes being collected into members and methods being separate doesn't match this.

I would suggest the following reorganization:

export type ComponentMemberKind = "property" | "method";

export type ComponentMember = ComponentMemberProperty | ComponentMemberMethod;

export interface ComponentFeatures {
  members: ComponentMember[];
  attributes: ComponentAttribute[];
  events: ComponentEvent[];
  slots: ComponentSlot[];
  cssProperties: ComponentCssProperty[];
  cssParts: ComponentCssPart[];
}

justinfagnani avatar Mar 15 '20 23:03 justinfagnani