4 ms·
I have some medium/large projects using async-await. There are 2 ways to transpile async-await. a) Default, with regenerator, transpiles it to ES5 b) If your
by jeswin 10y ago
I have some medium/large projects using async-await.
There are 2 ways to transpile async-await.
a) Default, with regenerator, transpiles it to ES5
b) If your env supports generators (like Node, or newer browsers), you can use async-to-generator plugin.
Regenerator gives you unreadable code, but it will run everywhere. async-to-generator gives you (relatively) readable code.
Source maps support has improved a lot, and you can choose to see only your original code while debugging. You'd be setting breakpoints on your code instead of transpiled code. So you should be fine whether you're using regenerator or async-to-generator. There might be corner cases (very rare) depending on your env; in which case if you're using regenerator you might need to switch to async-to-generator to find the bug.
Source maps work well with node-inspector. If you'd like to see better stack traces in say "mocha" tests (or other test framework), use https://github.com/evanw/node-source-map-support https://github.com/evanw/node-source-map-support.
Overall, the developer experience is now pretty good. Thanks to all the work that's gone into the tooling.