Calvin Metcalf (2014-06-16T12:53:51.000Z)
They curly braces only look like destructuring if you keep the name the
same, when imported with a different name it's a slightly different syntax,
{oldname as newname} not {oldname: newname}, also as it currently stands
    // BAD
    import lib from 'library';
    lib.foo();
    lib.bar();

is not correct, this was the module syntax that was removed so you could
have done
    // ALSO BAD
    module lib from 'library';
    lib.foo();
    lib.bar();

now from what I understand the only way to do that is

    import 'library';
    let lib = this.get('library');

On Jun 15, 2014 11:33 PM, "Axel Rauschmayer" <axel at rauschma.de> wrote:

> I apologize for this email, but I still don’t understand the current
> module design.
>
> **Multi-export modules.** Modules made sense to me as long as they were
> maps from names to exported values:
>
> ```js
> // Module 'library'
> export function foo() {
> }
> export function bar() {
> }
>
> // Module 'client1'
> import { foo, bar } from 'library';
> foo();
> bar();
>
> // Module 'client2'
> import lib from 'library';
> lib.foo();
> lib.bar();
> ```
>
> Compared to CommonJS, the syntax is nicer and less redundant.
> Additionally, the curly braces for getting stuff out of a module work,
> because they look like destructuring. And you get load-time errors if
> imports don’t match exports.
>
>
> **Single-export modules.** Still missing is support for single-export
> modules, which could be added as follows (the keyword `default` instead of
> the asterisk works just as well, in my opinion).
>
> ```js
> // Module 'MyClass'
> export* class {
> };
>
> // Module 'client3'
> import* MyClass from 'MyClass';
> ```
>
> At the moment, it seems to me like multi-export modules and single-export
> modules are mixed in a way that makes things difficult to understand.
>
> Axel
>
>  --
> Dr. Axel Rauschmayer
> axel at rauschma.de
> rauschma.de
>
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140616/cd4c4726/attachment.html>
dignifiedquire at gmail.com (2014-06-17T15:08:28.935Z)
They curly braces only look like destructuring if you keep the name the
same, when imported with a different name it's a slightly different syntax,
`{oldname as newname}` not `{oldname: newname}`, also as it currently stands

    // BAD
    import lib from 'library';
    lib.foo();
    lib.bar();

is not correct, this was the module syntax that was removed so you could
have done

    // ALSO BAD
    module lib from 'library';
    lib.foo();
    lib.bar();

now from what I understand the only way to do that is

    import 'library';
    let lib = this.get('library');