5 June 2014 TC39 Meeting Notes

David Bruant bruant.d at gmail.com
Thu Jun 12 02:22:53 PDT 2014


Le 11/06/2014 18:21, Ben Newman a écrit :
> ## 7.1 <script type=module> status update (from DH)
>
> DH: Would really rather have <module>import { foo } from "bar"; 
> ...</module>, which is like <script> but async, strict mode, has its 
> own top-level scope, and can import declaratively (using ES6 module 
> import syntax) from other (named) modules.
Just to be sure I understand, with <module> (or <script type="module">), 
the module has to be named? So <module> never really makes sense on its 
own and should always have a "name" attribute?

> DH: <module name="qux"> creates race conditions with HTML imports 
> (part of WebComponents).
>
> YK: People who saw named HTML module tags though you should mix html 
> imports w named module imports
> YK: When you have packaging solution (SPDY, etc), you no longer need 
> named modules
+1

> MM: <script type="module"> would inherit the special termination rules 
> of </script>, whereas old browsers might not handle <module> the same 
> way, since that tag name doesn't mean anything special in old browsers
>
> AR: <script type="module"> means the browser won't even try to parse 
> it as JS, which is what we want [so that we can execute the script 
> contents as a module, via some sort of polyfill]
>
> DH: <script type="worker"> might also need to have the <script 
> type="module"> semantics, and type= attribute syntax makes it hard to 
> mix and match those attributes; maybe <script worker module> would be 
> better? (i.e. the type attribute values become optional value-less 
> attribute names)
>
> DH: The difference between <script type="module"> and <module> is that 
> as long as there's … you always have the option of writing 
> <script>System.import("main.js")</script>
> TODO: Get DH to clarify this point when we edit the notes.
cc'ing Dave Herman for this part.

> AR: [note taker (BN) may be misinterpreting] The JS API remains 
> important even when we have HTML sugar.
Was this part edited after the "misinterpretation" or is it the original 
note?

David


More information about the es-discuss mailing list