▲ | epolanski 7 days ago | ||||||||||||||||||||||
Great project but I can't stand syntax such as decorators. | |||||||||||||||||||||||
▲ | jfagnani 7 days ago | parent | next [-] | ||||||||||||||||||||||
Decorators are the only way to metaprogram over class fields in JS. Otherwise they're not even detectable on the prototype. We use them to make fields reactive mostly, and I love how declarative they are. But we use them sparingly. I personally don't love how some libraries try to put a lot of things into decorators that could have been standard class features, like a static field or a method. edit: As mentioned by skrebbel, decorators are optional. Every decorator has a simple plain-JS way of doing it. Event reactive properties: https://lit.dev/docs/components/properties/#declaring-proper... We also put a lot of effort into making all of our documentation and playground samples on lit.dev available in both JavaScript and TypeScript with decorators. There's a switch that will change everything on the site from JS to TS globally. | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | skrebbel 7 days ago | parent | prev | next [-] | ||||||||||||||||||||||
Just to add to a sibling comment, they are optional and not in a “optional but if you dont use them it really sucks” kind of way. The Lit authors tried hard to use vanilla JS everywhere they could, and it shows. | |||||||||||||||||||||||
▲ | mdhb 7 days ago | parent | prev | next [-] | ||||||||||||||||||||||
They are optional for what it’s worth. They are also landing in standard JS soon. | |||||||||||||||||||||||
| |||||||||||||||||||||||
▲ | hliyan 7 days ago | parent | prev | next [-] | ||||||||||||||||||||||
Not seeing decorators in the JS version:
| |||||||||||||||||||||||
▲ | gitaarik 7 days ago | parent | prev [-] | ||||||||||||||||||||||
Why exactly? |