If Web Components are so great, why am I not using them?
61–70 of 189 posts
Re: If Web Components are so great, why am I not using them?
#62Earlier quoted context omitted.
Web components are really only useful for stuff that's dynamic, like a sortable table that fetches data from an AJAX request. They require javascript and have no fallback or graceful degradation in functionality at all, which means using web components for all your bog standard buttons, text content, headers, etc. could be a very bad idea (not to mention it would trash the SEO and potentially accessibility of your si…
> They require javascript and have no fallback or graceful degradation in functionality at all This is false. Use and . First-class progressive enhancement.
Re: If Web Components are so great, why am I not using them?
#63IMO the main reason more people aren’t using Web Components is because React doesn’t support them. Preact does it just fine so I have to assume it’s possible but simply not in the interests of the React team. React feels like the enterprise lock-in of 2020s development: if you use it you’re using it top to bottom and it’s very difficult to mix and match with other frameworks. It’s a shame.
Re: If Web Components are so great, why am I not using them?
#64Web components fill an important niche: creating a library of components that can be easily used in react, angular, some other framework, no framework, or some framework that someone will invent next year. I expect their usage to increase over time.
Re: If Web Components are so great, why am I not using them?
#65Earlier quoted context omitted.
Web components are extremely useful even without customized built-ins. And Apple is open to alternatives.
I don't disagree about the first part, but it is nevertheless the reason I'm not using them, since I have a very general use case (c.f. https://github.com/hotwired/turbo/pull/131 ). As for representing Apple's state of mind w.r.t. alternatives; they've had the better part of a decade to shit or get off the pot, so I don't hold a shred of vendor sympathy. In that context, "open to alternatives" just sounds like produc…
From Apple's point-of-view they're probably waiting for someone to propose a solution that doesn't have the same perceived issues. They've been doing good work on declarative shadow DOM, selection, a11y, template instantiation, etc., in the mean time.
Re: If Web Components are so great, why am I not using them?
#66Re: If Web Components are so great, why am I not using them?
#67On one hand, there are some use cases for this new complexity. On the other hand, it's difficult to see how the vast majority of say, React users, would ever benefit from this complexity, given that a lot of them don't seem to have problems that are solved by web components.
If we were going to focus on adding even more new browser features, I think it'd be better to focus on stuff that helps close cross-site scripting vulnerabilities, or provide better approaches towards anti-SPAM/anti-abuse than lazy, harmful remote attestation. (I mean hell, I'd love to see some very basic hashcash functionality as part of the browser; Personally, I think that would be an interesting idea for anti-SPAM, and nowhere near as catastrophically harmful as WEI.)
Re: If Web Components are so great, why am I not using them?
#68Earlier quoted context omitted.
When you see this, it’s a sign that someone built their web components with React/Angular/Vue on the brain. The tech is fine. You can achieve amazing progressive enhancement with web components by understanding and effectively using and . However, many web component developers never learn this. The problem you’re describing is a training/marketing issue, as discussed in the post.
The browsers really need to make it possible to use templates and slots without javascript at all. There's no reason I shouldn't be able to define and use a custom element using HTML alone. Until then I don't know if template and slot will take off.
Re: If Web Components are so great, why am I not using them?
#69Earlier quoted context omitted.
I don't disagree about the first part, but it is nevertheless the reason I'm not using them, since I have a very general use case (c.f. https://github.com/hotwired/turbo/pull/131 ). As for representing Apple's state of mind w.r.t. alternatives; they've had the better part of a decade to shit or get off the pot, so I don't hold a shred of vendor sympathy. In that context, "open to alternatives" just sounds like produc…
I don't think Apple sees themselves as _needing_ to shit or get off the pot. They made their opposition to customized built-ins, and their reasoning, known from the beginning, and Chrome and Firefox proceeded anyway. From Apple's point-of-view they're probably waiting for someone to propose a solution that doesn't have the same perceived issues. They've been doing good work on declarative shadow DOM, selection, a11y,…
Indeed, judging from both words & (in)actions, I think we can safely conclude that they don't. There's likely no direct commercial pressure to implement this part of the standard, and I'd expect all members of WHATWG's steering group perceive the vast influence they consequently hold as a competitive advantage, not a social contract.
Re: If Web Components are so great, why am I not using them?
#70Earlier quoted context omitted.
> They require javascript and have no fallback or graceful degradation in functionality at all This is false. Use and . First-class progressive enhancement.
Have you ever seen an example of this in the wild?
Web components are superficially similar to React/Angular/Vue, but very different in practice. Different strengths. Different use cases. Different opportunities. Like the post says, the web components community has been terrible at articulating and marketing these differences.