Re: [WICG/webcomponents] without .html in link rel="import" and href in web component (Issue #971)

@codehangen, take the analog for import JS with some object inside ( i.e. custom element with associated tag ).
If you `import "some.js"` its content meant to be anonymous to prevent names pollution and collision. 

Same with import HTML as custom elements. The tags inside should not pollute the caller namespace.

In order to be consumed by caller `import MyComponent from "some.js"` would define what name to be used for exported from `some.js` object. 

For import of custom element it would need similar possibility:
`<link rel="import" href="some.html" tag="imported-component" />`

That way you are assured that whatever Custom Element tag chosen within `some.html` , it would not be trashing caller HTML.

What about more than one Custom Element and tags are served by `some.html`?

It would need the syntax siminal to ESM 
```js
import { MyComponent as ImportedComponent, AnotherComponent as Imported2} from "some.js";
```
Of course in HTML syntax.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/971#issuecomment-1301635890
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/971/1301635890@github.com>

Received on Thursday, 3 November 2022 04:48:42 UTC