4 ms·
Evolution of the Heroku CLI: 2008-2017
- Rapzid 9y agoI predict they will come to the conclusion that they backed the wrong horse with Flow over TypeScript; v7 will be written in Scala or Scala.js . There is the odd sense of randomness to the choices in all these CLI upgrades. Can't quite put my finger on it. It brings to mind the saga of Wasabi.
- z3t4 9y agoI think the idea with Flow is you just have JSDoc type annotations, so you get strong typing without transpiration.
- frou_dh 9y agoThere is a comment convention where you can add Flow type annotations and definitions to vanilla JS: x /*: T*/ /*:: type T = { ... } */ But in practice I don't think it's pushed as being preferable to the invasive syntax.
- styfle 9y agoI believe TypeScript has the JSDoc feature as well, although it's much more recent.
- styfle 9y agohttps://code.visualstudio.com/Docs/languages/javascript#_type-checking-and-quick-fixes-for-javascript-files https://code.visualstudio.com/Docs/languages/javascript#_typ...
- z3t4 9y agoInstead of awaiting IO in CLI tools I just use the sync version
- petepete 9y agoInstead of using Promise.all, wouldn't an approach like this work? const a = taskA(); const b = taskB(); const c = taskC(); const result = [await a, await b, await c];
- cropsieboss 9y agoI believe `await` is sequential in the scope. `Promise.all` would be truly parallel. edit: just checked and your version is indeed parallel. Interesting.
- dvlsg 9y agoYup - all promises are "started" before you await them. I still typically prefer Promise.all though. It's a bit more obvious what's going on (IMO) and you can skip the additional lines for assigning the promises to variables.
- styfle 9y agoVery cool, I never thought about doing it this way!
- itwy 9y agoThese are not the same. Promise.all guarantees a is executed then b then c. Your version guarantees the three are executed before moving forward. The order may differ on each run.