Hacker News new | ask | show | jobs
by edwr 843 days ago
In my opinion, whether or not a website uses JS is orthogonal to this (though, I would argue websites shouldn't need JS just to repeat some elements). The issue is web has changed from JS enhancing a structure defined by HTML to JS subsuming the role of the web entirely (see HTML-in-JS, CSS-in-JS). Perhaps the greatest issue is that people don't realise that this is an issue.

It's a useful paradigm for people making highly dynamic websites like Google Maps but the vast majority of websites are not Google Maps. Since 2011, browser vendors and standards bodies have expended an astronomical amount of time, effort and resources into designing and implementing the Web Components spec. The resources used to develop Web Components came at the expense of other features that could have improved the web. More than a decade later, adoption into non-Google websites is a rounding error.

Web Components are designed as a behavior (JS) first standard, not a structure (HTML) first standard. This is not the way many websites are designed, it's evident in the popularity of structure-first frameworks like Vue and htmx. You can't force a website into a web application shaped hole.

1 comments

I think this is a good change. Even repeating some elements is an example of looping, a Turing behavior that should be left to JS. We're way past the point where some predefined markup can accommodate most sites. Even "brochureware" sites can be built and maintained easier with programmatic code rather than static definitions of page layouts and content.

I think the "purity" of HTML as a web language is a myth. HTML is an application of SGML, just like XML. It was designed to describe documents, not programs. Most people today would benefit from building a web application rather than a document.

I think you're right. It's a good change for people who want to build web applications. Maybe that's the right thing for future development ease. I feel it's a shame though, the de-emphasis of web documents leads to more content being centralized on large platforms like Facebook, Medium, etc. People at the small scale don't benefit as much from programmability. It leads to a less open and inclusive web.
Also true! The overhead of a custom site is now way more than it used to be and that limits adoption.