Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Have Web Components solved any of these issues that don't exist in any of the "tired" frameworks https://twitter.com/Rich_Harris/status/1198332398561353728 ?


That tweet is 3 years old. Web Components weren't ready for prime time a few years ago. Google has the Lit framework is using it in Angular. Web Components are here to stay. I'd like to know what Rich Harris thinks about Web Components today. Microsoft just released their Web Component frame work:

The adaptive interface system for modern web experiences. Interfaces built with FAST adapt to your design system and can be used with any modern UI Framework by leveraging industry standard Web Components. Standards-based Web Components are the foundation of each FAST component, making them compatible with almost any modern web framework, including those listed below.

https://www.fast.design/


> That tweet is 3 years old. Web Components weren't ready for prime time a few years ago.

So. Have they solved any of the issues listed?

> Google has the Lit framework is using it in Angular.

You've missed a few words in there.

yes, Google has Lit. And yes, Angular can be twisted to use them (but doesn't use them by default).

> Web Components are here to stay. I'd like to know what Rich Harris thinks about Web Components today.

Literally nothing you wrote answers my question.

And the answer is: no, despite the tweet being 3 years old and web components "not being ready for prime time then", none of those issues have been solved in the three years since.

---

Edit. As to what Rich Harris thinks about them now?

https://twitter.com/Rich_Harris/status/1518912939876618242

They're the past. Specifically, they took our best ideas circa 2010 and ossified them into the platform

https://twitter.com/Rich_Harris/status/1513638143584518154

I don't see any evidence of [fameworks will be transpilers to native web components in the next 5 years]. if anything, i think we'll see frameworks begin to explore the notion that 'component' is a purely author-time concept

etc.


Not only is Rich Harris is a fast talker, he expresses more strong opinions per minute than most, except perhaps Richard Feldman about Elm. I like Harris' passion. He believes his way is the best. More power to him, but I'm not going to argue with you after coming across this quote recently:

Too much gaslighting from a parent as a child turns you into an argumentative person desperate to prove your version of event's because you're used to being dismissed in an unfair power structure (tinybuddha.com)

I will say I've been building Web Components lately and think they are elegant and beautiful and solve some problems in a neat way, but of course don't solve all problems.

Also this: Angular elements are Angular components packaged as custom elements (also called Web Components), a web standard for defining new HTML elements in a framework-agnostic way. https://angular.io/guide/elements


It's funny how you keep ignoring the original question and trying to talk your way out of it.

So. Have web components solved any of the problems listed? Yes. Or no. No buddha quotes.


What I hear you saying is you want me to do research for you. Ok, I'll bite, I'm retired with nothing better to do.

The Guide to Accessible Web Components

https://www.erikkroes.nl/blog/accessibility/the-guide-to-acc...

Server Side Render Web Components: It's a common myth that you can't server side render Web Components.

https://dev.to/steveblue/server-side-rendering-web-component...

Using SVGs in Lightning Web Components

https://developer.salesforce.com/blogs/2020/07/using-svgs-in...

There are various work around for global namespace problems

You're welcome


> What I hear you saying is you want me to do research for you.

What you hear is me asking a direct question and expecting a direct answer. All I hear in response is non-answers.

> to do research for you.

I wish it were research and not a couple of links you just grabbed from a quick Google search.

> The Guide to Accessible Web Components

Translation: the problem is not solved because Shadow DOM isn't accessible. Relevant quotes:

"""

Building proper UI Web Components can be quite a task though, especially if you want them to be accessible.

As the shadow DOM is completely encapsulated and isolated, it is also completely disconnected. It's almost like it's a completely different document like an iframe.

When one of both (the label or the input) is in the shadow DOM, they're in a completely different context. This makes it impossible to refer to eachother. This same dillema also goes for WAI-ARIA attributes like aria-labelledby, aria-describedby and other that reference an ID. You need either both elements in the shadow DOM, or both of them in the light DOM.

"""

I'll let you do the research further. The only "solution" on the horizon is manually adding more boilerplate Javascript to your components when Acessibility Object Model becomes available in the browser.

> Server Side Render Web Components: It's a common myth that you can't server side render Web Components.

It's not a myth. It's pure reality. Which you'd know about if you bothered to read the links you provide.

The link even states this clearly: you can't render them. You have to use a very specific set of third-party tools that jump through hoops to provide the DOM object on the server. This is not a generic solution provided by the platform, you have to buy in to specific frameworks for this to work.

> Using SVGs in Lightning Web Components

And here we see that you didn't even understand the question. No one said you couldn't render SVG from custom components. However, you cannot do this:

   <svg>
     <x-axis min="2000" max="2019"/>
     <y-axis min="0" max="100"/>
     <scatter-plot points="..."/>
   </svg>
because custom elements are HTML by definition (they extend HTMLElement). Totally incompatible with SVG.

You'd know that if you had done actual research, and not spent your time attacking Rich Harris, or gushing how Google invests oney in some framework.


For the record, I didn't attack Rich Harris. I admire him. I said he was a fast talker with strong opinions and then "I like Harris' passion. He believes his way is the best. More power to him."

It sounds to me like you went down the Web Components path and became very disillusioned. That's good to know. Maybe my enthusiasm is misplaced. My goal is to keep things simple. That's why I refuse to use React, Redux, Node, Gulp, Babel, blah, blah, build pipeline. I'm not building a Facebook clone. That's not simple. We have different goals then. That's fine. Thanks for the info.


> It sounds to me like you went down the Web Components path and became very disillusioned.

It sounds to me that all you can offer is demagoguery

> My goal is to keep things simple. That's why I refuse to use React, Redux, Node, Gulp, Babel, blah, blah, build pipeline.

Does it have anything to do with the question I asked? No.


> Does it have anything to do with the question I asked? No.

This thread is on a post about React. I'm not even sure what you want from me at this point. To prove that Web Components are better than React because I said React is tired and Web Components are wired? The "The self-fulfilling prophecy of React" article says React is tired.

> It sounds to me that all you can offer is demagoguery

I'm not trying to persuade anyone of anything. I'm saying I like Web Components. I haven't built a start up around them. I'm sure they fall short in many use cases.


> This thread is on a post about React.

This particular thread started when I replied to your claim about Web Components. I posited a simple question: have the problems listed at the link been solved?

You spent an inordinate mount of time and words to avoid giving an answer. Hint: the anser is "no".

> I'm not even sure what you want from me at this point.

At this point? Nothing. About three replies ago I was still expected a clear honest answer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: