Module naming and declarations

Claus Reinke claus.reinke at
Sun Apr 28 13:31:45 PDT 2013

>> users are going to rewrite their code bases twice just because modules
>> are going to be delivered in two stages?
> What are you talking about?
> People are not going to rewrite more than once. Current NPM/AMD 
> modules do not nest, so there's no basis for asserting they'll be rewritten 
> twice, first to ES6-as-proposed modules, then to add lexical naming and 
> nesting.

Talking for myself, I've been using node modules, AMD modules, my
own module loader, and have even tried, on occasion, to make my
code loadable in two module systems (though I've shied away from
the full complexity of UMD). I'm tired of that needless complexity - I
want to build on modules, not fight with them (and I don't want tool
builders having to guess what kind of module system a given code
base might be using and what its configuration rules might be).

I have high hopes for getting to use ES6 modules early, via transpilers,
but that cannot happen until that spec settles down - we have users
of implementations that are waiting for that spec to tell them what
to converge on.

As soon as the dust settles, I'll try to stop using legacy modules 
directly, switching to ES6 modules, transpiled to whatever (until the
engines catch up).

But what I really want are lexical modules as the base case. The
use cases that led to the new design are important, so a design
not covering them would be incomplete, but if ES6 modules are
not lexical, I'll be rewriting my code again once ES7 true modules 
come out. That is twice for me, and I doubt there is anything 
untypical about me in this situation.

I understand that David is snowed under (he has an unfortunate
habit of taking on too much interesting work?-) but given the
importance of this particular feature, perhaps more of tc39 could
give a helping hand? The earlier and the more complete that
spec is, the earlier there will be user feedback, and the greater
the chance that ES6, or at least ES6.1, will have a module system
that works in practice.


More information about the es-discuss mailing list