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

link events and attributes/properties #53

Open
jogibear9988 opened this issue May 9, 2021 · 3 comments
Open

link events and attributes/properties #53

jogibear9988 opened this issue May 9, 2021 · 3 comments

Comments

@jogibear9988
Copy link
Contributor

@justinfagnani
sometimes attributes&properties are linked to a specific event like it was in polymer. or in lit with this addon: https://github.com/morbidick/lit-element-notify

shouldn't this also be reflected in the schema?

@jogibear9988
Copy link
Contributor Author

#54

@jogibear9988
Copy link
Contributor Author

Also should we add this information in typescript somehow (with a comment, or a decorator), so a generator could extract this information directly into the manifest

@justinfagnani
Copy link
Collaborator

This seems fine, but we need to figure out the use cases and the appropriate structure that meets them.

One could model this as class properties and methods having associated events. Maybe like:

events?: Array<EventReference>;
interface EventReference {
  name: string;

  type?: Type;

  /** Some note about when the event fires */
  description?: string;
}

This is general, but might it might be too general for some use cases. Like the Polymer-style property change events have a specific semantic across all properties - they fire when the property changes. With a general related events mechanism you couldn't assume that, and some properties may have multiple events. On the other hand I wouldn't want to bake in Polymer-style change events to a format describing a lot more than Polymer elements.

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

No branches or pull requests

2 participants