Hacker News new | ask | show | jobs
by BeefySwain 1097 days ago
I would love to see a more fleshed out rebuttal of it. Is it a scale issue?
2 comments

Web components were invented to make components more reusable independently of frameworks, nice, but turns out frameworks kept improving and now code is much more reusable between any modern framework (react/svelte/vue) than with web components. They are fully enapsulated and a pain to style, so if you don't need that encapsulation for some reason, you should not use them.

Lit is a framework for using web components, managing state and routing, it adds lots of boilerplate and uses OOP hierarchies to couple abstractions that could be otherwise separate. Lit uses object properties to detect changes and provides rerendering of the changed parts of the app.

This combo makes it work so terrible, you're orcestrating encapsulated components within inheritance chains and each part has a lot of boiler plate code and a lot of mutation. Its separating encapsulation by technology instead of concern, and enforcing this really hard. The end result is code terrible to read and very hard to change, full of mutation bugs and broken flows that don't properly update.

it's the frontend equivalent of bad microservices