Modularity: ES6 modules vs. HTML imports vs. asm.js

Guy Bedford guybedford at googlemail.com
Sat Jun 8 12:49:04 PDT 2013


Will it be possible to ensure that HTML imports can allow the specific ES6
loader to be specified (just as I asked about script tags in my previous
post)?

HTML imports using ES6 modules makes a lot of sense, because script tag
duplication causes unnecessary script re-execution otherwise (imagine
jquery being a <script> tag on many imports - if it is an imported module
its code is executed only once).

So the main issue I'm worried about is that there needs to be some way to
indicate that a custom loader should be used all the way down the import
tree.

<script>
  window['my-es6-loader'] = new Loader( ... );
</script>
<link rel="import" loader="my-es6-loader" href="/imports/something.html">

is not enough because imports within the imported document would then
revert to the system loader. Not sure how this gets solved.

In terms of the build tooling, these will now need to include the scope of
both systems, but this seems rather inevitable at this point.

On 8 June 2013 07:33, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:

> HTML imports are importing HTML, not JS.  Coordination is always good,
> but I don't know what that would entail here.
>
> asm.js modules have some specific needs, and it may or may not be able
> to use ES6 modules. I'll let Dave speak to that.
>
> Sam
>
> On Sat, Jun 8, 2013 at 9:56 AM, Axel Rauschmayer <axel at rauschma.de> wrote:
> > With Web Components, we also get HTML Imports [1]. This seems like yet
> > another modularity construct on the web. Would it make sense to
> coordinate
> > this with ES6 modules? I’m also hoping/assuming that asm.js will
> eventually
> > use ES6 modules(?)
> >
> > [1] http://www.w3.org/TR/2013/WD-html-imports-20130514/
> >
> > --
> > Dr. Axel Rauschmayer
> > axel at rauschma.de
> >
> > home: rauschma.de
> > twitter: twitter.com/rauschma
> > blog: 2ality.com
> >
> >
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >
> _______________________________________________
> 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/20130608/ffbb2156/attachment.html>


More information about the es-discuss mailing list