[webcomponents] Support renaming, aliasing, or namespacing imported elements (#344)

I've heard this topic mentioned in external discussions, but I don't see any issues about it here, so I'm posting this to get it on the record.

One major complaint I've heard in regards to HTML Imports and Custom Elements as they're currently spec'ed is that they're global and can't be renamed on a per-project basis. I see two relatively common cases where this will be an issue:

* An app is using an `<x-foo>` component and wants to switch to a different component, also named `<x-foo>`, without upgrading their entire codebase all at once.
* An app wants to use the components `<x-foo>` and `<x-bar>`, yet both of them (somewhere in their dependency tree) import different components named `<x-qux>`.

ES2015 modules have a really good way of handling this -- the module definition is essentially anonymous until it's given a name at import time and module imports are local to the module importing them.

It seems like Custom Elements could (and arguably should) operate in a similar manner.

I'm aware Mozilla has expressed that they [do not plan to implement HTML Imports](https://hacks.mozilla.org/2014/12/mozilla-and-web-components/), though I'm unaware if an alternate proposal has been presented.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/344

Received on Sunday, 18 October 2015 01:08:18 UTC