6 ms·
Is this (async/await) not just a feature of ES7? Personally I would love to see the decoupling of TypeScript's type checker from its transpiler. The ability to
by mixonic 11y ago
Is this (async/await) not just a feature of ES7?
Personally I would love to see the decoupling of TypeScript's type checker from its transpiler. The ability to use TS with Babel, or Flow with MS's transpiler, would be liberating and spur further innovation.
- egeozcan 11y agoI think they're going in the opposite direction as they've implemented JSX support as a part of TypeScript. I mean, I love what they are doing but sometimes I wish we could have all these features as macros/plugins to something like sweet.js. By the way, IIRC, Babel also supports plugins so in theory, type-checking could be implemented as a Babel plugin as well.
- spion 11y agoIIRC JSX support is only implemented as parsing and type-checking. There is no JS generation. The output will contain the same JSX, which means you'll have to use a JSX compiler on it.
- interlocutor 11y agoYou can use jsxtyper to generate TypeScript interfaces: https://github.com/fuselabs/jsxtyper https://github.com/fuselabs/jsxtyper
- adidahiya 11y agoThe Typescript compiler can emit JS for use with React from JSX. This is a good blog post about it: http://www.jbrantly.com/typescript-and-jsx/ http://www.jbrantly.com/typescript-and-jsx/
- iso8859-1 11y agoYou can do it in current JavaScript implementations already: https://github.com/bjouhier/galaxy#asyncawait-in-javascript https://github.com/bjouhier/galaxy#asyncawait-in-javascript
- kylepdavis 11y agoYou can decouple now. Set the TypeScript output target to ES6 and then pass it all through BabelJS. It works really well for me and the TypeScript tooling is really good (VS Code or Atom).
- davidjnelson 11y agoHow do you integrate this into a webpack build? Run the typescript plugin first, then the babel plugin? Is there issues using es7 babel stage 0 features like async/await and decorators if you do this? Thanks :-)
- CmonDev 11y agoYes, but who has the patience to wait another 5+ years to get ES7?