3 ms·
I will read those links you referenced later. But what I think about the Shadow DOM is that that is for me actually the killer feature. That prevents a lot of w
by gitaarik 3y ago
I will read those links you referenced later. But what I think about the Shadow DOM is that that is for me actually the killer feature. That prevents a lot of weird issues. But it also brings limitations to methods of how web developers are used to do things, like applying styles globally, or having some sort of dependency between deeply nested elements, crossing the Shadow DOM when using Web Components.
What people usually try to do is to somehow open up the Shadow DOM for certain things, to make some things allowed to pass, or global. But I think might be a bit holding on to an old familiar habit. And I think there are better ways of structuring a project with Web Component in mind.
For example, you can create a base class from which all your components extend, and put the base style in that base class, and have your components add style on top of that. I implemented this method in a tiny library which makes it easy to use [0].
But yeah it is hard for most developers to adopt a new way of thinking. And as long as the new way doesn't provide that much improvement over the old way, it won't get adopted. But I think the idea of Web Components still needs to be integrated more in the web dev community. And maybe they will manage to make some changes to make the adoption easier.
And besides that, of course Web Components still have lots of other issues. But for me it has reached a point where I don't feel the need for React anymore. I rather live with some quirks in Lit than doing things with React, which just feels clumsy to me now.
[0]: https://github.com/gitaarik/lit-style https://github.com/gitaarik/lit-style
- troupo 3y ago> But yeah it is hard for most developers to adopt a new way of thinking. It's not "a new way of thinking". Things like functioning inputs, buttons, and ARIA are basic browser functionality. > And as long as the new way doesn't provide that much improvement over the old way, it won't get adopted. Not only it doesn't provide improvment, it needs 20+ new web standards to fix the issues that literally nothing else has. I've gone ahead and quoted directly from the report made by people who keep developing these specs. And yet you've ignored literally everything I wrote and keep answering something entirely else. > of course Web Components still have lots of other issues. Indeed, they do. I listed a bunch of them. And yet you keep pretending that I'm talking about "React workflows" or something. This is pointless until your read what I write, and not what you think that I write. Until then, adieu.
- gitaarik 3y agoAny technology has issues and limitations. Many basic browser functionalties also don't work with the React workflow, and Lit brings those things back again, making it more native, and less need for framework code. It seems you are only focussing and zooming in on the issues and limitations. And there are issues and limitations in any technology. I think it has to do with adopting a different way of thinking and structuring. All those issues you listed are either non-issues with the correct workflow, or are easy to work around. And hey, I'm not saying you or anyone should use web components; if you like React better then just keep using that. But I don't see why you would critizice this technology so much. Remember that creating new web specs and standards takes a lot more time than to build an independent framework like React. So yeah the development and adoption is slow, and that might frustrate you. And as long as you think it's not good enough yet, you can just keep using React. But I personally find that it is mature enough for me to use it in combination with Lit instead of React. And I'm very satisfied about it. It does take some investment to learn a bit about how Web Components work.
- troupo 3y ago> It seems you are only focussing and zooming in on the issues and limitations. The question literally was: "Can you elaborate further on why web components are a half-baked solution". Did I say anything about React? No. Did I say anything about lit? No. Stop making up what you think people are saying and start reading and understanding what people are saying. > And there are issues and limitations in any technology. Yes. Yes they are. And web components are literally the only technology that after 12 years in development needs 20+ web specs to not break basic functionality that literally no other technology breaks. This has nothing to do with react. This has nothing to do with lit. Read what I wrote and not what I think I wrote. > if you like React > framework like React. > keep using React. > combination with Lit instead of React. Jesus Christ. Literally nowhere was I talking about React or lit. Not a single one of my comments in this thread had anything to do with either. And yet you keep arguing with the voices in your head that are telling you that I'm talking about React. > It does take some investment to learn a bit about how Web Components work. So go ahead and learn about how they work, why don't you? Or, rather, about how they don't work, and why after 12 years they still need 20+ new web specs to to the most basic things. Edit: from now on I will disengage from this conversation and sibling ones, because it is useless and pointless.