Rationale for dropping ModuleImport syntax?

Kevin Smith zenparsing at gmail.com
Mon Jun 9 08:15:37 PDT 2014

I agree with Alex.

We can tolerate this syntactic form being dropped for now, but that doesn't
eliminate the semantic need.  If the "module" contextual keyword is a
problem, then we should be able to come up with another color for the
bikeshed, e.g.:

    import "foo" as foo;

As an aside, it is yet to be seen whether the "default" export thing is the
best way, or the bad part itself.  We don't have the real world experience
yet to answer that.

On Mon, Jun 9, 2014 at 2:39 AM, Axel Rauschmayer <axel at rauschma.de> wrote:

> Context:
> https://gist.github.com/caridy/eefb9b104874465d4e1c#1-moduleimport-syntax-importdeclaration
> ```js
> module foo from "foo"; // drop this
> import bar from "bar";
> ```
> I’m seeing the following contra against dropping ModuleImport syntax:
> > Contra: without a way to access the module object, it is difficult to
> deal with modules with many exports (e.g.: underscore), but we could fix
> this by using a reflective API to access imported modules
> Isn’t this a frequent use case? Which would lead to ugly and very
> inconsistent code, especially if multiple imports are involved. I also
> don’t see how CommonJS-style modules could be neatly migrated to ES6
> modules if this feature was dropped.
> I do agree that the ModuleImport reads a bit strange, but that could be
> fixed, e.g. via a suggestion I’ve seen somewhere:
> ```js
> import module foo from "foo";
> ```
> --
> 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/20140609/ffc12f0b/attachment-0001.html>

More information about the es-discuss mailing list