←back to thread

277 points merqurio | 7 comments | | HN request time: 0.445s | source | bottom
1. o_m ◴[] No.45113665[source]
I don't see the need for Lit anymore. Lately I have just been raw dogging web components without any libraries. Having a nice templating system like JSX on the server makes it a breeze.

Part of using web components, for me, is that it is just javascript. There is no upgrades or deprecations to think about. Of course those things still exist on the server though, but it is easier to maintain it there.

replies(3): >>45113699 #>>45114073 #>>45116966 #
2. mariusor ◴[] No.45113699[source]
Personally I find that lit abstracts quite well some pieces of functionality that you're going to implement yourself anyway to not have to write manual <template> all over your code plus the plumbing to add it to the DOM.
replies(1): >>45114536 #
3. jfagnani ◴[] No.45114073[source]
The great thing about web components is that you can build them however works best for you.

Native web component APIs don't have the DX that many people expect though, because they are so low-level. Lit provides just that declarative reactivity on top.

4. o_m ◴[] No.45114536[source]
Yeah, it does require some more boilerplate. I abstract some of it JSX, and with LLMs writing boilerplate code isn't that annoying anymore.
5. rs186 ◴[] No.45116966[source]
I find that there is little practical difference between "html" tagged template literal and writing JSX. Not to mention there is a compilation step in JSX.
replies(2): >>45117368 #>>45119190 #
6. fkyoureadthedoc ◴[] No.45117368[source]
Don't know the current state of lit-html and similar, but Typescript support was the biggest thing missing for me when I used it several years ago.

In simple scenarios like just dropping it in an html page, codepen, or something like that I really enjoyed it though.

7. o_m ◴[] No.45119190[source]
I mean sure, as long as it runs on the server. Personally I feel JSX is way more expressive. The JSX I write runs on server side rendering to HTML. That way there will be no flash of unstyled content, cumulative layout shift, or any other jank. It looks correct even before the javascript has been downloaded, except it isn't interactive yet.