ModuleImport

Andreas Rossberg rossberg at google.com
Fri Jun 27 12:28:37 PDT 2014


On 27 June 2014 17:32, Kevin Smith <zenparsing at gmail.com> wrote:
> So to me the path forward is clear:  we keep real modules, axe the default
> feature, and take a temporary hit of dissatisfaction from existing users so
> that we can expand the JS user base.

Note that the other half of my argument was that "real" modules are
only worth the complexity when they provide checking _consistently_.
That is, it shouldn't matter whether I write

  import {f, g, h} from "url"
  f(); g(); h()

or

  module M from "url"
  M.f(); M.g(); M.h()

These should be freely interchangeable -- the programmer shouldn't
need to pick between getting import checking but polluting the scope
and making uses less readable, or the other way round. The current
semantics falls short on that, it doesn't check in the latter case.

So from my perspective, that would need to be fixed as well. Which
would be fairly easy.

/Andreas


More information about the es-discuss mailing list