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

Support decorators for typescript applications #892

Open
wilberforce opened this issue Oct 29, 2021 · 1 comment
Open

Support decorators for typescript applications #892

wilberforce opened this issue Oct 29, 2021 · 1 comment
Labels
enhancement New feature or request upstream Related to or blocked on an upstream project

Comments

@wilberforce
Copy link
Contributor

wilberforce commented Oct 29, 2021

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 ;-)

@wilberforce wilberforce added the enhancement New feature or request label Oct 29, 2021
@developit developit added the upstream Related to or blocked on an upstream project label Oct 29, 2021
@rodydavis
Copy link

rodydavis commented Jan 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream Related to or blocked on an upstream project
Projects
None yet
Development

No branches or pull requests

3 participants