Re: [HTML Imports]: what scope to run in

2013-12-04 Thread Jonas Sicking
On Sat, Nov 23, 2013 at 1:51 AM, Jonas Sicking jo...@sicking.cc wrote: One thing that we did discuss but that I think we never reached a conclusion on was if imported HTML documents need to block module tags in the main document. Otherwise there's a risk that named modules introduced by the

Re: [HTML Imports]: what scope to run in

2013-11-23 Thread Jonas Sicking
On Mon, Nov 18, 2013 at 4:14 PM, Jonas Sicking jo...@sicking.cc wrote: At the very least, I would like to see a way to write your HTML-importable document as a module. So that it runs in a separate global and that the caller can access exported symbols and grab the ones that it wants. We had

Re: [HTML Imports]: what scope to run in

2013-11-23 Thread John J Barton
On Sat, Nov 23, 2013 at 1:51 AM, Jonas Sicking jo...@sicking.cc wrote: It would technically be possible to define that script elements inside the imported documents also run inside a scope object the same way that modules do. This way imported documents would be less likely to pollute the

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread Brian Di Palma
On Tue, Nov 19, 2013 at 10:16 PM, Rick Waldron waldron.r...@gmail.com wrote: On Mon, Nov 18, 2013 at 11:26 PM, Ryosuke Niwa rn...@apple.com wrote: We share the concern Jonas expressed here as I've repeatedly mentioned on another threads. On Nov 18, 2013, at 4:14 PM, Jonas Sicking

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread Rick Waldron
On Wed, Nov 20, 2013 at 12:38 PM, Brian Di Palma off...@gmail.com wrote: On Tue, Nov 19, 2013 at 10:16 PM, Rick Waldron waldron.r...@gmail.com wrote: On Mon, Nov 18, 2013 at 11:26 PM, Ryosuke Niwa rn...@apple.com wrote: We share the concern Jonas expressed here as I've repeatedly

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread Hajime Morrita
I'd frame the problem in a slightly different way. Seems like almost everyone agrees that we need better way to modularize JavaScript, and ES6 modules are one of the most promising way to go. And we also agree (I think) that we need a way to connect ES6 modules and the browser. What we don't

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread Ryosuke Niwa
On Nov 21, 2013, at 10:41 AM, Hajime Morrita morr...@google.com wrote: Seems like almost everyone agrees that we need better way to modularize JavaScript, and ES6 modules are one of the most promising way to go. And we also agree (I think) that we need a way to connect ES6 modules and the

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread John J Barton
On Wed, Nov 20, 2013 at 7:34 PM, Ryosuke Niwa rn...@apple.com wrote: On Nov 21, 2013, at 10:41 AM, Hajime Morrita morr...@google.com wrote: Seems like almost everyone agrees that we need better way to modularize JavaScript, and ES6 modules are one of the most promising way to go. And we

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread Brian Kardell
On Nov 19, 2013 2:22 AM, Ryosuke Niwa rn...@apple.com wrote: On Nov 19, 2013, at 2:10 PM, Dimitri Glazkov dglaz...@chromium.org wrote: On Mon, Nov 18, 2013 at 8:26 PM, Ryosuke Niwa rn...@apple.com wrote: We share the concern Jonas expressed here as I've repeatedly mentioned on another

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread Erik Arvidsson
There seems to be some idea that HTML imports are supposed to do everything. The primary use case for HTML imports is a way to import DOM trees. Since HTML already have ways to embed CSS and script, HTML imports can act as a container format. But do not let perfect be the enemy of good. Lets not

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread Rick Waldron
On Mon, Nov 18, 2013 at 7:14 PM, Jonas Sicking jo...@sicking.cc wrote: Hi All, Largely independently from the thread that Dimitri just started on the sync/async/-ish nature of HTML imports I have a problem with how script execution in the imported document works. Right now it's defined

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread John J Barton
On Tue, Nov 19, 2013 at 2:07 PM, Rick Waldron waldron.r...@gmail.comwrote: On Mon, Nov 18, 2013 at 7:14 PM, Jonas Sicking jo...@sicking.cc wrote: Hi All, Largely independently from the thread that Dimitri just started on the sync/async/-ish nature of HTML imports I have a problem with

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread Rick Waldron
On Tue, Nov 19, 2013 at 5:27 PM, John J Barton johnjbar...@johnjbarton.comwrote: (snip) This isn't how node modules or ES6 modules work. A module designed for use with node can define properties on the `global` (ie. the object whose bound identifier is the word global) and this is the

[HTML Imports]: what scope to run in

2013-11-18 Thread Jonas Sicking
Hi All, Largely independently from the thread that Dimitri just started on the sync/async/-ish nature of HTML imports I have a problem with how script execution in the imported document works. Right now it's defined that any script elements in the imported document are run in the scope of the

Re: [HTML Imports]: what scope to run in

2013-11-18 Thread Scott Miles
I've made similar comments on various threads, so sorry if you've heard this song before, but here are some basic comments: The HTMLImports we've been working with so far is not primarily about JS, it's about HTML. There are already various ways to modularize JS, including requirejs, other libs,

Re: [HTML Imports]: what scope to run in

2013-11-18 Thread Ryosuke Niwa
We share the concern Jonas expressed here as I've repeatedly mentioned on another threads. On Nov 18, 2013, at 4:14 PM, Jonas Sicking jo...@sicking.cc wrote: This has several downsides: * Libraries can easily collide with each other by trying to insert themselves into the global using the

Re: [HTML Imports]: what scope to run in

2013-11-18 Thread Dimitri Glazkov
On Mon, Nov 18, 2013 at 8:26 PM, Ryosuke Niwa rn...@apple.com wrote: We share the concern Jonas expressed here as I've repeatedly mentioned on another threads. On Nov 18, 2013, at 4:14 PM, Jonas Sicking jo...@sicking.cc wrote: This has several downsides: * Libraries can easily collide with

Re: [HTML Imports]: what scope to run in

2013-11-18 Thread Jonas Sicking
On Mon, Nov 18, 2013 at 9:10 PM, Dimitri Glazkov dglaz...@chromium.org wrote: In fact, the list of concerns that Jonas listed is specifically addressed by modules. So, my thinking is that why don't we leave imports alone and let the modules solve these problems? HTML Imports is a higher-layer

Re: [HTML Imports]: what scope to run in

2013-11-18 Thread Ryosuke Niwa
On Nov 19, 2013, at 2:10 PM, Dimitri Glazkov dglaz...@chromium.org wrote: On Mon, Nov 18, 2013 at 8:26 PM, Ryosuke Niwa rn...@apple.com wrote: We share the concern Jonas expressed here as I've repeatedly mentioned on another threads. On Nov 18, 2013, at 4:14 PM, Jonas Sicking