Live data from Hacker News

HTML Web Components

blog.jim-nielsen.com

1–10 of 247 posts

Re: HTML Web Components

#2
Also read these articles for more on the idea of "HTML Web Components":

https://meyerweb.com/eric/thoughts/2023/11/01/blinded-by-the... - "So there you have it: a few thousand words on my journey through coming to understand and work with these fully-Light-DOM web components, otherwise known as custom elements. Now all they need is a catchy name, so we can draw more people to the Light Side of the Web."

https://adactio.com/journal/20618 then suggests the catchy name.

Re: HTML Web Components

#3
> React components cannot do this — full stop.

Render your react components on the server and send them over the wire as plain html. no client side javascript required — full stop.

Re: HTML Web Components

#4
Doesn't this create some nasty coupling since your web components look like a div but can actually require an arbitrarily complex HTML schema underneath? Can I write that down somewhere?

Re: HTML Web Components

#5
> they can render before JavaScript. React components cannot do this — full stop

Not a full stop; SSR means they could render before client-side JS.

The example is a bit too simple to make the author's point IMO. A web component that handles changes to state would be a better comparison, and make for a better argument.

Re: HTML Web Components

#6

> React components cannot do this — full stop. Render your react components on the server and send them over the wire as plain html. no client side javascript required — full stop.

So just run javascript before your components render so you don't have to run javascript before your components render.

Re: HTML Web Components

#7
post #6

> React components cannot do this — full stop. Render your react components on the server and send them over the wire as plain html. no client side javascript required — full stop.

So just run javascript before your components render so you don't have to run javascript before your components render.

If you find a way to deliver a website without running any code, let me know!

Re: HTML Web Components

#8
It's a nice idea and I'm glad we can expand the language to differentiate between html web components and javascript web components. That's important because the vast majority of use of web components are in the form of javascript web components. The only time I've ever seen HTML web components are on blog posts talking about how you can use web components. Never on an actual website about something besides web components.

I want to believe... but reality is stacked against HTML web components. I'm just going to stick to HTML and leave the HTML with dashes to others.

Re: HTML Web Components

#9
post #6

Earlier quoted context omitted.

So just run javascript before your components render so you don't have to run javascript before your components render.

If you find a way to deliver a website without running any code, let me know!

I just think SSR is kind of missing it because web components allow a static frontend bundle to have a power that was previously reserved for SSR or HTML-only apps.

Moving the render off the client is nice, but removing the prerender altogether is something much cooler.

Re: HTML Web Components

#10
React Component is a function.

HTML web component is NOT a function.

You don't just compare those things, they work and compose differently.

I would rather combine them: A html web component renderer for React.

Post reply on HN