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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Axel Rauschmayer
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



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Sam Tobin-Hochstadt
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 <[hidden email]> 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
> [hidden email]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Axel Rauschmayer
HTML imports are importing HTML, not JS.  Coordination is always good,
but I don't know what that would entail here.

They import a mix of HTML, CSS and JavaScript. So it isn’t entirely clear to me, either, what an integrated solution would look like (or if it would even make sense). But apart from the content, they are very similar to ES6 modules: you would also want to load on demand, they have dependencies that need to be fulfilledd, etc.

Axel

-- 
Dr. Axel Rauschmayer



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Guy Bedford
In reply to this post by Sam Tobin-Hochstadt
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 <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Yehuda Katz
In reply to this post by Sam Tobin-Hochstadt
I started a conversation with Rafael Weinstein last week about the possibility of integrating these systems. I believe that it is possible and desirable, but there are many open questions to answer still.

It will be easier to begin the discussion seriously once the Loader API is entirely specified, imho.

Yehuda Katz
(ph) 718.877.1325


On Sat, Jun 8, 2013 at 7:33 AM, Sam Tobin-Hochstadt <[hidden email]> 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 <[hidden email]> 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
> [hidden email]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss