Module Interop

Kevin Smith khs4473 at gmail.com
Thu Mar 21 13:40:02 PDT 2013


> - look for a special comment at the beginning
>

For backward compat, you'd have to put the comment in new ES6 modules.
 That's a spank-belt worse than "use strict" ; )


> - look at the module name
>
    import "npm/moment" as moment;
>

This is a good option, but it's not transparent.  If you upgrade "moment"
to ES6 modules, you have to change the line above.  Not bad, though.

- look at package metadata etc. that is available to your custom module
> loader
>

Again, for backward compat the flag would have to go in new ES6 modules.
 We want the tax to be paid by legacy modules, not new modules.

All good ideas.  #2 has the most promise, I think.

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130321/f9fce156/attachment.html>


More information about the es-discuss mailing list