←back to thread

367 points lemonberry | 2 comments | | HN request time: 0.566s | 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 #
1. tannhaeuser ◴[] No.24648177[source]
What's the point though to bake that into HTML if you need tons of JavaScript to make it happen anyway? You can just as well use the flexibility of JavaScript to build up component graphs. HTML, or rather SGML, has an established method of syntactically composing fragments using SGML entities that is well integrated into the process of editing HTML using plain text editors, not to speak of extending the vocabulary with new elements and their content models in powerful ways. Introducing elements into markup using script rather than declarative means only serves to complicate parsing, with questionable benefits.
replies(1): >>24649310 #
2. tarkin2 ◴[] No.24649310[source]
Because with HTML you would use HTML to structure your elements. Javascript was never designed to structure element s we get things like JSX, to compensate, adding further complexity. HTML Imports was an attempt to keep with the existing platform.