preactjs/wmr

Support decorators for typescript applications

wilberforce opened this issue · 1 comments

Discussion - #891

I'm trying build Lit Element examples using wmr. The ts examples play nicely - the ts ones fail with the @ of the decorator

https://lit.dev/playground/#sample=examples/full-component

Is your feature request related to a problem? Please describe.

./public\motion-todos.ts - Unexpected character '@' (./motion-todos.ts:26:1)

  24 |
  25 |
> 26 | @customElement('motion-todos')
     | ^
  27 | export class MotionTodos extends LitElement {constructor(...args) { super…
  28 |   static __initStatic() {this.styles = styles}
  29 |

alangpierce/sucrase#330

Work around
Use the long form customElements.define('motion-todos',MotionTodos)

define the properties the old skool js way

Describe the solution you'd like
It would be great it it just worked ;-)

I created a minimal example, but as previously stated the decorators do not work. I have to use the long form:

https://github.com/rodydavis/lit-wmr

Branch with decorators:

https://github.com/rodydavis/lit-wmr/tree/ts-decorators