| > It's a fallacy to denigrate anything on the basis of scale, because not everything has to be at "scale". Scale is "anything beyond the simplest of components". > That doesn't have to be the job of web APIs. These tools exist to render things on web pages Yes, that is exactly the job of Web APIs, and they are horrible even at rendering things on web pages. You'd have to search really far and really wide to find APIs that are as slow and as inefficient at putting pixels on screen like Web APIs. But even beyond that, web components are a horrendously bad, overly verbose API that is unsuitable for, you guessed it, scale. Write a few of them by hand, and off you are looking for a framework or library. > > Google's own AMP has switched to using Preact to author their components because they couldn't bear it anymore. > This seems like speculation. It's not speculation, but an overexaggeration. AMP project is pretty tight-lipped on the reasons why, but here's a big one: https://twitter.com/cramforce/status/1181927980467138560 --- start quote --- The main issue was that handling attribute/children mutation got too complex when implemented manually instead of relying on diffing. --- end quote --- This is what I mean when I'm talking about scale. > Again, not necessarily anyone's problem. It is, ultimately, the problem of the people who will be using this tech. > All of those arguments come from the premise that separate APIs are supposed to form something coherent. No. All those arguments come from the fact that Web Components break all those things, are broken for all those things, and keep breaking a lot of other things despite everything that's poured into them. And you can't just hand waive and dismiss all concerns with "who cares". You have your project and someone brings a Web Component into it? Oops, your project can no longer be SSR'ed. You have your project and someone brings a custom field into it implemented with Shadow DOM? Ooops, suddently your project has an inaccessible field. And so on, and so on. > The use of ARIA attributes is pretty common for elements that are not custom. ARIA attributes do not cross shadow dom boundary. Web Components will break accessibility instantly just by virtue of existing (if they use shadow DOM). > If SSR is a problem then don't use shadow DOMs. Ah yes. "You're holding it wrong". That's the problem with web components: they break in so many common scenarios, that any other tech would be laughed out of the room. And yet, here we are, with people valiantly defending them. > What exactly is the argument against that? HTML is crap, and for good reason. HTML is crap, so let's add even more crap to it and be content with this crap? > Likewise, whatever "web components" are supposed to be, they add a few niche features to an existing system. That's the problem. The only features they add are "some niche features". The cost of developing, supporting and integrating these features has far surpassed any potential usefulness of these features. And their primary use case, still, is "yeah, maybe as some small dumb components if you don't use shadow dom, if you don't care about SSR, if you don't care about <a dozen other things that developers do care about>". So what exactly is the idea of web component that everyone misunderstands? |