4 ms·
With `--target=es6` I'm not sure if the TypeScript compiler does any code transformation other than removing type annotations. So the chance of a 'transpiler er
by wereHamster 11y ago
With `--target=es6` I'm not sure if the TypeScript compiler does any code transformation other than removing type annotations. So the chance of a 'transpiler error' is basically zero.
- emodendroket 11y agoWell the classes are converted into functions and it adds members to the prototypes, right? Or is that ES5 only?
- boredpudding 11y agoWhat you mean is indeed ES5 only. ES6 has classes so it doesn't need to convert anything.
- emodendroket 11y agoOh. Cool. I didn't know that.
- bd82 11y agoThere are a few small things that still require conversion. But that is because Typescript also includes capabilities from ES7 (ES2016). For example - currently in Typescript but only planned for ES7: https://github.com/jeffmo/es-class-fields-and-static-properties https://github.com/jeffmo/es-class-fields-and-static-propert... or Support ES7: exponentiation operator https://github.com/Microsoft/TypeScript/issues/4812 https://github.com/Microsoft/TypeScript/issues/4812 Typescript seems to be more like ECMAScript.next + types rather than ES6 + types.
- ascetone 11y agoMy favourite thing they brought over from ES7 is async/await support via ES6 generators.
- joshuacc 11y agoFYI, those are not ES2016 features. ES2016 only includes two small feature enhancements. They might make it into 2017, but if TC39 decides they're not ready, they'll just keep not including the feature in the annual spec revision.