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

The core feature for me here is getting a tree constructed from HTML by the browser, so either would be satisfying for me. However, if this is posed as a mutually exclusive choice, I would prefer the first option: "just an HTML snippet that cannot have any sub dependencies in terms of module dependency tree". It seems likely, to me, that the non-inert document-with-dependencies module type would take more time to define, more time to implement, and result in new or inconsistent behavior for elements in that module's document compared to the main document ([example](https://crbug.com/523952)). I don't want to prevent 'HTML as a complete container format' from being implemented - there's clearly lots of value in it - but I also don't want the ability to import a pre-constructed tree by referencing HTML to be blocked on reaching consensus for the behavior of that container format. Although, given the amount of time HTML Imports have existed, the shape of this container might be clearer now than it was before?

With regards to writing templates directly in JS: if these templates are defined in strings, it doesn't seem very different when compared to the current state of the world, from a development perspective:

```js
import template from module `
<div>hello, world</div>
` as HTMLTemplateElement;
```

vs.

```js
const template = document.createElement('template');
template.innerHTML = `<div>hello, world</div>`;
```

But they could be a useful step towards modules as a build target, especially if this could be used with data that wasn't HTML. I suppose the value here depends on how adoption speed of HTTP/2 (how expensive it continues to be to split files) compares with the implementation of this feature. 

However, if the idea there is instead to introduce a better, not-strings syntax for constructing trees in JS then that's a different story and I think that could be valuable on its own. It would be less related to the concept of generically customizable modules but would reduce some of the specific need for *HTML* modules.

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

Received on Thursday, 29 June 2017 22:11:02 UTC