DEV Community

loading...

Discussion on: How to create a scalable vue.js setup (Part I)

Collapse
vonziu profile image
vonziu

I have some concerns about decorators. They are not valid javascript, and won't be implemented anytime soon into language. Isn't it better to avoid it? (I guess TS will still support it because a lot of projects e.g Angular are based on it but still, it might be a pain in the ass to refactor a fully-fledged project back into valid javascript, or get rid of decorators, if TS decide to not support them anymore).

Collapse
marcel_cremer profile image
Marcel Cremer Author

Hey there,

as you described, decorators are currently in proposal state for JavaScript (github.com/tc39/proposal-decorators) and experimental for typescript (typescriptlang.org/docs/handbook/d...). However, they are widely spread (like you mentioned: angular, react, mobx, ... - there are plenty of famous examples), so I personally think it's no question if, but only when they will arrive in ECMA standard.

Of course this is highly opinionated, but as they are so commonly used nowadays, I don't have bad feelings about using themπŸ˜‰

Also, depending on your configuration, it's possible that your transpiler (e.g. babel) transforms it on compile-time into standard javascript.

Cheers