4 ms·
this is awesome, been looking forward to using async/await in production node.js without transpilers!
by che_shirecat 9y ago
this is awesome, been looking forward to using async/await in production node.js without transpilers!
- always_good 9y agoYou've been able to for a while now.
- wcarron 9y agoServer side at least. Not exactly confident that say, a vue-webpack site with no transpilation will play nicely with everyone's browsers.
- ssijak 9y agoIs it that hard to add one step in webpack build?
- wcarron 9y agoNo, it is not. But my point was that client-side javascript environments are not congruent in their support for all language features. Writing a boatload of async/await, object-spread, etc. code on the client and not transpiling is asking for trouble.
- floatboth 9y agoThe original comment was about "production node.js", not browsers. But actually https://caniuse.com/#feat=async-functions https://caniuse.com/#feat=async-functions looks very very good.
- wcarron 9y agoMy mistake, you are correct.
- che_shirecat 9y agono you haven't, 6.x LTS does not support async functions.
- always_good 9y agoThat you're stuck on LTS doesn't matter to everyone who's not and has been able to use async/await natively for a while now. In other words, you've been able to for a while now, you've just chosen constraints that don't let you, so your response isn't very honest.
- hammeiam 9y agowhat's your experience been writing tests for async/await code?
- always_good 9y agoNight and day. Just compare Koa's abstraction to Express'. In Koa, you're inside one big top-level async function so all of your business code is as well. Any errors you have are async and bubble up. Async/await is something that made Javascript concurrency not just bearable but better than the day-to-day code of other languages I use.