{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/344","labels_url":"https://api.github.com/repos/w3c/webcomponents/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webcomponents/issues/344/comments","events_url":"https://api.github.com/repos/w3c/webcomponents/issues/344/events","html_url":"https://github.com/w3c/webcomponents/issues/344","id":111993652,"number":344,"title":"Support renaming, aliasing, or namespacing imported elements","user":{"login":"philipwalton","id":326742,"avatar_url":"https://avatars.githubusercontent.com/u/326742?v=3","gravatar_id":"","url":"https://api.github.com/users/philipwalton","html_url":"https://github.com/philipwalton","followers_url":"https://api.github.com/users/philipwalton/followers","following_url":"https://api.github.com/users/philipwalton/following{/other_user}","gists_url":"https://api.github.com/users/philipwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/philipwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipwalton/subscriptions","organizations_url":"https://api.github.com/users/philipwalton/orgs","repos_url":"https://api.github.com/users/philipwalton/repos","events_url":"https://api.github.com/users/philipwalton/events{/privacy}","received_events_url":"https://api.github.com/users/philipwalton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/webcomponents/labels/custom-elements","name":"custom-elements","color":"5319e7"},{"url":"https://api.github.com/repos/w3c/webcomponents/labels/html-imports","name":"html-imports","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-18T01:07:43Z","updated_at":"2015-12-23T00:17:13Z","closed_at":null,"body":"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.\r\n\r\nOne 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:\r\n\r\n* 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.\r\n* 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>`.\r\n\r\nES2015 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.\r\n\r\nIt seems like Custom Elements could (and arguably should) operate in a similar manner.\r\n\r\nI'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."},"comment":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/comments/166766914","html_url":"https://github.com/w3c/webcomponents/issues/344#issuecomment-166766914","issue_url":"https://api.github.com/repos/w3c/webcomponents/issues/344","id":166766914,"user":{"login":"bedeoverend","id":594822,"avatar_url":"https://avatars.githubusercontent.com/u/594822?v=3","gravatar_id":"","url":"https://api.github.com/users/bedeoverend","html_url":"https://github.com/bedeoverend","followers_url":"https://api.github.com/users/bedeoverend/followers","following_url":"https://api.github.com/users/bedeoverend/following{/other_user}","gists_url":"https://api.github.com/users/bedeoverend/gists{/gist_id}","starred_url":"https://api.github.com/users/bedeoverend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bedeoverend/subscriptions","organizations_url":"https://api.github.com/users/bedeoverend/orgs","repos_url":"https://api.github.com/users/bedeoverend/repos","events_url":"https://api.github.com/users/bedeoverend/events{/privacy}","received_events_url":"https://api.github.com/users/bedeoverend/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T00:17:13Z","updated_at":"2015-12-23T00:17:13Z","body":"It would be great if could use separate registries. I mocked up a [JSBin of it in action](https://jsbin.com/demujugixa/edit?html,output), where there are two `my-element` with different prototypes, though as you've said, innerHTML and CSS is still an issue. Should this even work, or is it just a hack that may break in the future?\r\n\r\nAlso, and perhaps this is a discussion for another thread, but in the above example I was forced to use an iframe, rather than something like `document.implementation.createHTMLDocument` as only in the iframe did the registry appear unique. Should creating a new HTMLDocument have a unique registry?"}}