Re: [w3c/webcomponents] HTML Modules (#645)

Question for all: if you write `import doc from "./template.html"`, `template.html` is...?
1. just an HTML snippet that cannot have any sub dependencies in terms of module dependency tree
2. it can have further dependency graph which may be a mix of html and JS modules

As far as I read in the discussions above, most people seem to assume 1, and importing JS script just consumes the HTML as an inert DOM tree.  What I presented in [the polyfill](https://gist.github.com/TakayoshiKochi/f6ea51947f2616c81920d545230695b2) had capability to contain a JS module script in the imported HTML, which can import further modules, or export something to the importer.

The capability HTML Imports have had is that any import can have subimports, to form a dependency tree, and within an import, `<script>` is executed (though global, not scoped like ES6 module) in deterministic order. Also, during loading imports is processed, Custom Elements upgrades are done accordingly within  imports (I wrote [doc](https://gist.github.com/TakayoshiKochi/93a46a10c056d2a3d70495c6fc025310) about it).

The current Polymer depends on this capabilities, to realize almost-declarative element definition ([`<dom-module>`](https://www.polymer-project.org/2.0/docs/api/elements/Polymer.DomModule)), which are so powerful.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/645#issuecomment-312001680

Received on Thursday, 29 June 2017 15:26:29 UTC