News for hackers. Stuff that matters.
Re:Promisees – JavaScript Promises Visualization by iyn on Sunday September 20, 2015 @08:26PM (#10249765)
Promises are better than being stuck in callback hell, but ES7 async functions (async/await) are way better: http://www.sitepoint.com/simplifying-asynchronous-coding-es7...

The best part: you can use it today with babel (I'm using it in browser and on node thanks to the power of webpack, babel and hot reloading).

Re:Promisees – JavaScript Promises Visualization by iamstef on Sunday September 20, 2015 @10:33PM (#10250067)
I agree, async/await is very nice. Though it is worth pointing out async/await is quite literally syntactic sugar on top of promises. Essentially adding language syntax for common promise idioms.
Re:Promisees – JavaScript Promises Visualization by bluepnume on Sunday September 20, 2015 @10:35PM (#10250076)
More than just syntactic sugar. async/await changes the whole control flow of a method.
Re:Promisees – JavaScript Promises Visualization by callahad on Monday September 21, 2015 @12:02AM (#10250305)
You can actually get identical semantics, and almost identical syntax, by abusing ES6 generators, so it is just syntactic sugar: https://gist.github.com/callahad/b99c83d6d9fd675137b7
Re:Promisees – JavaScript Promises Visualization by conical on Monday September 21, 2015 @12:37AM (#10250402)
Does the phrase "syntactic sugar" have any meaning? Name a new language feature that "it is just syntactic sugar" can't be applied to.
Re:Promisees – JavaScript Promises Visualization by callahad on Monday September 21, 2015 @12:45AM (#10250426)
Sure, ES6 WeakMap and WeakSet can't be implemented without native support in the runtime.

Or, for that matter, const. Though perhaps const is just syntatic sugar for not reassigning to the same darn name? ;)

Re:Promisees – JavaScript Promises Visualization by conical on Monday September 21, 2015 @01:30AM (#10250527)
Const is a pretty good example, the closest I can think to emulating it in es5 is something like:

Object.defineProperty(this, 'five', { enumerable: true, writable: false, value: 5, configurable: false });

If in global scope, 'five' will look like a const.

WeakMap and WeakSet have polyfills with minor caveats.

I guess you're defining language features as not "syntactic sugar" if they can't be absolutely 100% polyfilled.

Re:Promisees – JavaScript Promises Visualization by bluepnume on Monday September 21, 2015 @09:20PM (#10256142)
Agreed, it's syntactic sugar over es6 generators. But I don't agree that it's just syntactic sugar over promises, which is what the parent comment asserted.
Re:Promisees – JavaScript Promises Visualization by iamstef on Monday September 21, 2015 @12:07AM (#10250314)
Yes, by introducing (extremely handy) syntactic sugar ;)
Re:Promisees – JavaScript Promises Visualization by AgentME on Sunday September 20, 2015 @11:51PM (#10250264)
async/await works with promises, it doesn't replace them.
Re:Promisees – JavaScript Promises Visualization by tracker1 on Monday September 21, 2015 @09:14AM (#10251973)
I think it's important to understand this, as when you are interacting with other modules that return promises, you need to know that you can await those, as well as that async functions return promises that can be used as them without being inside another async function.
Re:Promisees – JavaScript Promises Visualization by finalight on Sunday September 20, 2015 @10:12PM (#10250031)
can someone explain to me is ES7 tied to the browser version/type, or usually all the popular browsers support it out of the box?

because I couldn't find any information on that

Re:Promisees – JavaScript Promises Visualization by curun1r on Sunday September 20, 2015 @10:18PM (#10250042)
It's complicated. ES6/7 support isn't binary. But sites like this help: http://caniuse.com/
Re:Promisees – JavaScript Promises Visualization by asutherland on Sunday September 20, 2015 @10:25PM (#10250054)
http://kangax.github.io/compat-table/es6/ and http://kangax.github.io/compat-table/es7/ are particularly good for ES since it breaks out things into the nitty gritty features, providing the code samples that are tested.
Re:Promisees – JavaScript Promises Visualization by callahad on Monday September 21, 2015 @12:13AM (#10250328)
Like other web standards, these things tend to get implemented in a piecemeal fashion according to consensus and demand. By the time the standards are published, much of their content is already implemented in modern browsers.

For example, the ES6 spec was just published a few months ago, so it will still be a year before we see ES7. In spite of that, the async / await capabilities are sufficiently compelling and agreed upon that patches are already being reviewed for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1185106

Kangax's tables, linked in another reply, are a great way to check what the support situation is like across browsers.