Re:Angular 2 – Best Practises
by rahkiin on Monday June 27, 2016 @07:25AM
(#11985455)
As is shown with the decorator transpiling in both typescript and babel, it doesn't really matter if it never makes it to the spec: you can still use it using a compiler. I use it in my own production software and it is a real blessing when trying to use a more OO approach in a JS world
[ Parent
| on HN ]
> it doesn't really matter if it never makes it to the spec
I does matter as there is difference between introducing type support in a language and introducing features that completely are non standard. Now imagine TC39 introduces a decorator syntax that is not compatible with Typescript's implementation ( it happened in the past with previous Typescript module syntax and the language had to break compatibility )
Angular 2 is completely based on the use of decorators to inject almost anything. Sometimes the decorator definition itself is bigger than the class using it.
> it happened in the past with previous Typescript module syntax and the language had to break compatibility
Hmm. I thought that they just deprecated the old syntax while maintaining backwards compatibility.
It matters if the person who wrote the babel plugin stops supporting it. This is the problem I have with the babel culture, I don't think people realize that they are really inventing their own language which is a mismash of various language features they like; some of which is part of a real language, some of which is not.