Rationale for dropping ModuleImport syntax?

Karolis Narkevičius karolis.n at gmail.com
Mon Jun 9 10:40:55 PDT 2014


Why can't we have both with the same syntax?

```js
// imports a function which is the default export
import mkdirp from "mkdirp";
```

and

```js
// imports all named exports, like module used to
import fs from "fs";
```


On Mon, Jun 9, 2014 at 5:50 PM, Matthew Robb <matthewwrobb at gmail.com> wrote:

> Gah.. Phone. Side-effects*
> On Jun 9, 2014 9:47 AM, matthewwrobb at gmail.com wrote:
>
> And the as portion can be optional if all you want is import dude effects.
> On Jun 9, 2014 9:42 AM, "Caridy Patino" <caridy at gmail.com> wrote:
>
> `import "./foo" as foo;` certainly looks nice.
>
>
> On Mon, Jun 9, 2014 at 12:36 PM, Kevin Smith <zenparsing at gmail.com> wrote:
>
>> IIUC, the motivation for dropping the form is that it's confusing to have
>> this other syntactic option which uses a different (contextual) keyword.
>>
>> Well, we already have this:
>>
>>     import "./foo";
>>
>> which you can use when you want to load+execute but not import anything.
>>  Is that going away?  If not, then it makes sense to just add a renaming
>> clause:
>>
>>     import "./foo" as foo;
>>
>> Does that help with the confusion?
>>
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> 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/20140609/fdc010a8/attachment-0001.html>


More information about the es-discuss mailing list