Rationale for dropping ModuleImport syntax?
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
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:
> 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:
> import module foo from "foo";
> Dr. Axel Rauschmayer
> axel at rauschma.de
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss