You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just seen that the TypeScript 2.0 milestone was added to support transpiling generators to ES5: do you have any estimate when it will be released?
Reacted by Wolfgang Steiner, Martin Kasban Tange, Paul Ryan, Piotr Witek, Eric Devine, Tully H, Alex Fil, Joy George Kunjikkuru, Patrick Oswald, Daniel Gerlag and 61 more
Vitor Buzinaro (@buzinas) I don't know when to expect it but until then the workaround is to get TypeScript code with async/await transpiled to ES6 and then in a second build step use Babel to transpile that to ES5.
Omid K. Rad (@omidkrad) Yeah, I know that, did this for one project, but for the others, I'm trying to keep things dry, so, I'm using only TypeScript as transpiler.
For bigger projects, the build time of two transformations doesn't compensate for us. Also, the sourcemaps don't work well when transpiling two times, unfortunately (they work, but poorly sometimes).
At the moment, we're sticking with promises, and it's good enough for 90% of the cases.
Reacted by Bohdan Moskalevskyi, Sergio Morchón Poveda, david karapetyan and Jens Vanderhaeghe
I think we'll have a beta ready to use towards late May/early July, though no promises on dates.
Reacted by Wolfgang Steiner, Piotr Witek, Felix Itzenplitz, Andrew Harper, Timofey Kachalov, Umed Khudoiberdiev, Omid K. Rad, Serhii Sol, Marius Schulz, Alex Disler and 7 more
Omid K. Rad (@omidkrad) For me using Babel just for transpiling async/await to ES5 was a a little bit of overkill, so for that workaround in my projects I'm currently using https://github.com/facebook/regenerator, works fine, but I cannot wait to finally have it possible by only using TS
Omid K. Rad (@omidkrad) yes "target": "es5", then I'm running regenerator -r app.ts-es5.js > app.es5.js, I needed this mainly because of IE10+ support and it's working fine, just need to include ES6 shim for Promises
Reacted by Guilherme Duarte, Omid K. Rad, chanhee, Edoardo Tassinari and Tuomas Tanner
Piotr Witek (@piotrwitek) I'm missing something - how do you get tsc to compile your code to es5 in the first place if you have async/await syntax in there?
Adam Stankiewicz (@sheerun) This issue it not about async/await. It is about generator functions. AFAIK async/await -> ES5 is already implemented in ts@next. Async/await is great if you are taking a imperative approach but IMO not useful if you are using a functional approach to side-effects such as redux-saga.
Reacted by kdalgaard, Adam Stankiewicz, Piotr Witek, Mohamed Hegazy, hi, soerenBoisen and Jonathan Reem
Activity
DanielRosenwasser commentedon Dec 27, 2014
We have basic parser support (#1268). As our roadmap specifies, 1.5 is the target for emit, though I'm not sure if that includes the ES3/ES5 polyfill.
Since I don't see an official issue tracking it, I think this might be a good candidate!
JsonFreeman commentedon Apr 27, 2015
Please take a look at #2873 and let me know if this addresses your needs.
buzinas commentedon Apr 4, 2016
I've just seen that the TypeScript 2.0 milestone was added to support transpiling generators to ES5: do you have any estimate when it will be released?
omidkrad commentedon May 13, 2016
Vitor Buzinaro (@buzinas) I don't know when to expect it but until then the workaround is to get TypeScript code with async/await transpiled to ES6 and then in a second build step use Babel to transpile that to ES5.
buzinas commentedon May 13, 2016
Omid K. Rad (@omidkrad) Yeah, I know that, did this for one project, but for the others, I'm trying to keep things dry, so, I'm using only TypeScript as transpiler.
For bigger projects, the build time of two transformations doesn't compensate for us. Also, the sourcemaps don't work well when transpiling two times, unfortunately (they work, but poorly sometimes).
At the moment, we're sticking with promises, and it's good enough for 90% of the cases.
DanielRosenwasser commentedon May 13, 2016
I think we'll have a beta ready to use towards late May/early July, though no promises on dates.
piotrwitek commentedon May 13, 2016
Omid K. Rad (@omidkrad) For me using Babel just for transpiling async/await to ES5 was a a little bit of overkill, so for that workaround in my projects I'm currently using https://github.com/facebook/regenerator, works fine, but I cannot wait to finally have it possible by only using TS
omidkrad commentedon May 13, 2016
Piotr Witek (@piotrwitek) Nice tip! Do you run generator on tsc's ES5 output?
piotrwitek commentedon May 15, 2016
Omid K. Rad (@omidkrad) yes
"target": "es5", then I'm runningregenerator -r app.ts-es5.js > app.es5.js, I needed this mainly because of IE10+ support and it's working fine, just need to include ES6 shim for Promisesvigie commentedon May 18, 2016
Piotr Witek (@piotrwitek) I'm missing something - how do you get tsc to compile your code to es5 in the first place if you have async/await syntax in there?
58 remaining items
kdalgaard commentedon Oct 12, 2016
Jonas Kello (@jonaskello) Thanks for the explanation. I would expect Webpack to continue being fast due to hot module replacement, but I don't know...
sheerun commentedon Oct 19, 2016
Daniel Rosenwasser (@DanielRosenwasser) Jonas Kello (@jonaskello) As demonstrated by fast-async you don't need generators to support async/await, promises are enough. Please don't despair and implement async/await for es5 in typescript.. The the only thing that is blocking me to switch.
jonaskello commentedon Oct 19, 2016
Adam Stankiewicz (@sheerun) This issue it not about async/await. It is about generator functions. AFAIK async/await -> ES5 is already implemented in ts@next. Async/await is great if you are taking a imperative approach but IMO not useful if you are using a functional approach to side-effects such as redux-saga.
kdalgaard commentedon Oct 19, 2016
Adam Stankiewicz (@sheerun) What Jonas Kello (@jonaskello) said.
jonaskello commentedon Nov 9, 2016
Now that #5595 has landed, is there any chance this issue can make it back onto the roadmap?
normalser commentedon Nov 18, 2016
Looks like there is a chance: #12346