News for hackers. Stuff that matters.
Re:Show HN: Esperanto – Convert ES6 modules to AMD, CommonJS by jbish on Tuesday August 19, 2014 @12:30PM (#8198224)
Nice work. Just going through the example conversions is helpful in understanding some of the syntax differences.

I'm a bit confused by the Named imports example though. What is the signifance of the __imports_0 variable in both the AMD and CommonJS conversions?

Re:Show HN: Esperanto – Convert ES6 modules to AMD, CommonJS by rich_harris on Tuesday August 19, 2014 @12:49PM (#8198358)
Thanks. In the Named imports example, the `import { later } from 'asap'` line means 'load the contents of 'asap.js', and make its 'later' export available to this module as 'later'. In 2014 terms, that means 'assume that asap.js exports an object with a 'later' property, and map that to the 'later' variable' - so '__imports_0' just refers to the object that asap.js exports.

I plan to make this a bit friendlier in a future version of Esperanto: https://github.com/Rich-Harris/esperanto/issues/3