4 ms·
Decorators, and class fields, are pre-stage-4 ES proposals. That means they are not part of JavaScript. Moreover, what ends up eventually landing, especially in
by bakkoting 9y ago
Decorators, and class fields, are pre-stage-4 ES proposals. That means they are not part of JavaScript. Moreover, what ends up eventually landing, especially in the case of decorators, is unlikely to work quite the same as what TypeScript implements.
So "Typescript has no additional features over (ES6+) JavaScript that are not part of the type system." is just false.
(Babel has plugins for all kinds of things that aren't part of JavaScript. The team is working on expressing more clearly which plugins are for experimental features and which are settled.)
- johnfn 9y agoYou're moving the goalposts. GP was concerned about MS nefariously introducing vendor lock-in by implementing a bunch of their own proprietary features. I've demonstrated pretty clearly that 1. It's not MS's implementation - it's an implementation of an ES proposal. 2. For the one example you could find, MS didn't even want to do it - it was requested by Google for Angular and done as essentially a compromise. If you browse the TS repository, you can find issue after issue of the TS team refusing to add features that aren't part of the ES standard. I think this shows fairly definitively that this is not a case of MS trying to lock you in to their product.
- bakkoting 9y agoI'm not making a case for or against TypeScript; I'm just concerned that people be aware what is and is not part of JavaScript. You said that TypeScript had no additional features except types. That's all I'm responding to: I'm pointing out this isn't the case. Class fields are, currently, not part of JavaScript. Neither are decorators. (We're working on it - but actually a concern which has come up is that we might end up with something which breaks TypeScript, because the proposals are still in the early stages and therefore subject to radical changes.)