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

> HTML Modules should be loaded by static imports so that they can be available when the importing module code needs them. That means we can't do this as pure user-land implementation.

@justinfagnani there's a way to do this in user-land with Service Workers. I put together [a small demo](https://github.com/trentmwillis/html-template-es-modules) that allows you to do stuff like `import template from './hello-world.html';` in actual ES modules.

My primary use case is just

> Import a template into an element definition in a JS file.

so that's all the demo covers, but  it should be possible to add additional behavior.

Now, this approach obviously has some drawbacks (chiefly, requiring an activated Service Worker to even function), but it could be a good way to explore some ideas.

Anyway, I'm excited to see this issue still getting attention as I feel it is a critical part of the Web Components story, so thanks to everyone who's been working on it! 😄

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

Received on Wednesday, 23 May 2018 17:01:28 UTC