←back to thread

367 points lemonberry | 1 comments | | HN request time: 0.439s | source
Show context
tarkin2 ◴[] No.24645234[source]
The death of HTML imports killed web components for me.

With HTML imports, you would import a HTML file. In that file would be css, html and the js to make the component. Then you’d use HTML as usual in your main file.

Finally you could create custom components easily while keeping yourself dealing primarily with HTML.

Instead, you were forced to use bizarre js import systems. And at that point you were in JS land. Firefox’s decision not to support HTMLImports in favour of waiting to see what happens with JS killed it.

replies(2): >>24647628 #>>24648177 #
flowerlad ◴[] No.24647628[source]
> In that file would be css, html and the js to make the component.

You can do that. Here's an example Web Component that contains the css, html and javascript:

https://github.com/wisercoder/uibuilder/blob/master/WebCompo...

replies(1): >>24649278 #
1. tarkin2 ◴[] No.24649278[source]
I'm talking about how you import that into your main HTML file.