Support for ES6 Promise?


#1

I’m not sure how the Chromium fork and Node are packaged into Atom, so I don’t know how easy this is, but:

In Chrome 36 on my desktop, I have Enable Experimental JavaScript set under chrome://flags/, and so in the console, I can see that Promise is present just like other abstractions new in ES6 such as Set. In Atom, I see Set but not Promise.

Is it hard to get Promise in Atom and/or is there some way that I can already do this today?


#2

I’m not an expert on Promises, but it is my understanding that the Q library is commonly used in Atom for Promise functionality. Perhaps @abe or @mark_hahn can elaborate.


#4

Thanks for that. That’s a pretty good article.


#5

The native Promise will be available in Atom 0.121.0 since Atom has been upgraded to Chrome 36


#6

I built from HEAD and see it there now: thanks @kevinsawicki!


#7

@kevinsawicki What’s the minimum version of Node that I need to use Promises? And what flags do I need to pass? I have v0.10.29 and am passing --harmony, but no dice.


#8

@bolinfest: I’m not sure I understand why you need Promise in node if ultimately you intend to run you code in Atom, but anyway, you won’t get Promise in node with a version < 0.11.13, see:


#9

Atom is 99% sync since multiple users aren’t typing at the same time. (grin)


#10

@abe I was putting together a demo/repro case for an async/await transpiler, so I needed to use a Promise and was hoping to avoid require('promise'), if possible. Once this bug is fixed in regenerator, I’ll put together some steps on how best to write in futuristic JS for Atom today.