Re: [w3c/webcomponents] Scripts in HTML Imports should be scoped to the import (treat imports as script modules) (bugzilla: 27836) (#157)

I don't think that's what this bug is about. I think the author is suggesting a way for an imported document to define exports, so that instead of calling `customElements.define` in a script within the import, you might instead export a custom element class that the consumer could then call `customElements.define` with.

Skipping past the hard parts of integrating the HTML import and ES module systems, let's say that was figured out, it would be nice if you could do something like:

```js
import tabsDocument from './tabs.html';

const Tabs = tabsDocument.exports.default;

customElements.define('my-tabs', Tabs);
```

---
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/157#issuecomment-236569964

Received on Monday, 1 August 2016 12:43:39 UTC