Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Support defining custom elements via a decorator #788

Closed
matt-gadd opened this issue Nov 28, 2017 · 0 comments
Closed

Support defining custom elements via a decorator #788

matt-gadd opened this issue Nov 28, 2017 · 0 comments
Assignees
Milestone

Comments

@matt-gadd
Copy link
Contributor

matt-gadd commented Nov 28, 2017

Enhancement
The ergonomics for creating a custom element from a dojo widget are currently a bit fiddly via the customElementDescriptor, it would be nice if we could support a simplified form as a decorator on the component.

As part of the simplification we'd like to drop or do better with dealing with things automatically for the author. that would mean that they would no longer have to specify a mapping for anything. events would automatically drop the on and be lowercased? we would no longer want to support changing the property names or attribute names either I don't think as so far it's caused more trouble than it's worth?

Something like:

@customElement({
  tag: 'my-foo',
  properties: [ 'foo', 'bar' ],
  attributes: [ 'baz', 'qux' ],
  events: [ 'onSomething' ]
})
class Foo extends WidgetBase {
}

The only potential last thing we'd need is still functionality for the initialization function.

@kitsonk kitsonk added this to the beta.5 milestone Nov 29, 2017
maier49 added a commit that referenced this issue Dec 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants