News for hackers. Stuff that matters.
Re:HTML Web Components by continuational on Monday November 13, 2023 @12:33PM (#38252775)
> I was interested to see this article explain what `user-avatar` actually did/provided but it never did.

Yeah, the lack of concrete examples makes this feel a bit too much like a shower thought to me.

Re:HTML Web Components by yohannparis on Monday November 13, 2023 @03:29PM (#38254957)
This is a purpose of a blog.

This was not a tutorial or an article on how to use Web Components.

Re:HTML Web Components by continuational on Monday November 13, 2023 @03:59PM (#38255313)
I mean, anybody is free to write how they like on their blog. I just don't find arguments like these convincing without realistic non-trivial examples.
Re:HTML Web Components by hasanhaja on Tuesday November 14, 2023 @10:08AM (#38264151)
What would a non-trivial example look like to you?

I'm working on building exactly this resource alongside a series of posts on web components.

Re:HTML Web Components by continuational on Tuesday November 14, 2023 @10:51AM (#38264781)
One example would be a search field that shows suggestions from the server while typing.
Re:HTML Web Components by hasanhaja on Tuesday November 14, 2023 @11:47AM (#38265791)
Here's a pre-built one that I found that even lets you customize the debounce amount: https://ionicframework.com/docs/api/searchbar#debounce

The Stackblitz example is quite good too.

I'll give it shot to build a super simple one with just vanilla JS without helper libraries like Lit or Stencil. I think I'd take the same approach as I would with React, and I think the biggest difference would be where the fetch gets executed. In React you'd expose a prop like "submitHandler", but here I would emit an event from the component (after whatever debounce amount) and expect the caller to attach an event listener to my custom event to perform the fetch.

Re:HTML Web Components by davedx on Tuesday November 14, 2023 @07:26AM (#38262462)
Lack of substantial concrete examples is an issue with many of these anti-react technologies. Even svelte doesn’t seem to have many (any?) examples of large scale commercial projects using it.

In the last 10 years the only new web tech I’ve seen get traction outside of tech communities - so actual job postings etc - is vue.