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

Support defining custom elements via a decorator #788

@matt-gadd

Description

@matt-gadd

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions