ModuleImport

John Barton johnjbarton at google.com
Wed Jun 25 13:37:51 PDT 2014


// I have a module named `foo`.
// I don't care what `foo` is.
// Including whether or not its a namespace.
// I need make no promises about identifier `foo`.
import {bar} from './foo';


On Wed, Jun 25, 2014 at 12:52 PM, C. Scott Ananian <ecmascript at cscott.net>
wrote:

> On Wed, Jun 25, 2014 at 2:59 PM, Kevin Smith <zenparsing at gmail.com> wrote:
>
>> Correct me if I'm wrong, but the perspective says: "why would I need to
>> import the multiple-exports if I'm specifically overriding the exports with
>> a default?  Having a way to import both the default and multiple-exports is
>> silly and confusing."
>>
>
> For my part, my personal perspective is, "I have a module named `foo`.  I
> want to write `foo.bar` to get the export named bar.  I don't care *what*
> `foo` is.  Perhaps its a function object for backwards-compatibility.
>  Perhaps it's a module object because of some circular dependency.  Perhaps
> it's a plain object.  To me it's just a namespace.  Please let me use the
> same import syntax regardless.  In exchange, I promise never to use bare
> `foo` in my code."
>
> There are a couple of different solutions; default-default is one of those.
>  --scott
>
> _______________________________________________
> 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/20140625/8f36ad2d/attachment.html>


More information about the es-discuss mailing list