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

Actually, circling back to HTML modules, a custom importer could define:

```js
import doc from "./module.html" as HTMLModule;
```

The HTMLModule importer could be implemented in a library and do the following:

- fetch module.html as a document
- find `link[rel="stylesheet"]` elements and apply them to the main document
- find `script[type="module"]` elements and `import()` them
- find a custom element e.g. `<html-module src="submodule.html">` and recurse in to that

This moves almost the entire HTML imports functionality in to a library, rooted on the JavaScript module system. IMO this is the ideal situation - there's no need to specify HTML modules at all, it just becomes a framework built on top of generic imports.

-- 
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-310840488

Received on Saturday, 24 June 2017 14:06:36 UTC