Module Comments

Axel Rauschmayer axel at rauschma.de
Thu Dec 6 07:31:54 PST 2012


+1

Compared to Node.js, I love ES6 exports, but Node.js module imports are easier to understand.

Claus’ suggestion would make `import` similar to `let` and people could basically think of modules as objects.


On Dec 6, 2012, at 10:41 , Claus Reinke <claus.reinke at talk21.com> wrote:

>> Well, the thing is it isn't consistent with the destructuring meaning: dropping the curlies here means extracting a single export (aka property), which is not what it means in destructuring assignment/binding anywhere else.
>> 
>> But that said, the convenience may well still trump the inconsistency.
> 
> I think I'd prefer consistency here, as it also allows to get rid of
> 
>   import "foo" as foo;
> 
> and replace it with
> 
>   import foo from "foo";
> 
> which keeps the order of
> 
>   import {x,y} from foo
> 
> and it is all just module-level destructuring (fewer new concepts).

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121206/0549feab/attachment.html>


More information about the es-discuss mailing list