Live data from Hacker News

Lit: a library for building fast, lightweight web components

lit.dev

21–30 of 180 posts

Re: Lit: a library for building fast, lightweight web components

#22

Lit maintainer here. I should be going to bed, but I'll answer any questions if people have any! Not sure why Lit showed up on the front page tonight :)

Curious which web platform features are missing that are preventing Web components to complete with React(for application development not widgets)?

I think web components already compete extremely well for application development, and you see very complex apps built with Lit out there: Photoshop, Firefox, Chrome OS, Chrome DevTools.

Apps are well served because they have more control about how components are used: they can import the same shared styles into every component, take are to not double-register elements, etc.

But I think there are some important standards still missing that would open things up even more in the design system and standalone components side:

- Scoped custom element registries. This moves away from a single global namespace of tag names. Seems like it's about to ship in Safari. Chrome next.

- Open styleable shadow roots. Would allow page styles to flow into shadow roots. This would make building components for use with existing stylesheets easier.

- CSS Modules. Import CSS into JS. Shipping in Chrome. About to land in Firefox.

- ARIA reference target: make idref-based reference work across shadow roots

Re: Lit: a library for building fast, lightweight web components

#23
I love Lit! I have been using it to develop a in-app widget for product updates here: https://supanotice.com (the in app-widget opens up if you click on the bubble in the bottom right corner)

Really love the abstraction that makes web components easy to use.

Re: Lit: a library for building fast, lightweight web components

#24
post #20

Lit maintainer here. I should be going to bed, but I'll answer any questions if people have any! Not sure why Lit showed up on the front page tonight :)

Is there a way to efficiently use Lit without using a bundler?

Lit's just a JavaScript library published as standard modules, so it doesn't require a bundler. Using Lit efficiently is the same as using any other library.

HTTP/3, import maps, and HTML preloads can make unbundled app deployment almost reasonable in some cases. You'd still miss out on minification and better compression form a bundle. Shared compression dictionaries will make this better though.

Re: Lit: a library for building fast, lightweight web components

#25
post #18

Lit maintainer here. I should be going to bed, but I'll answer any questions if people have any! Not sure why Lit showed up on the front page tonight :)

Any whispers of something like lit being made part of the webcomponents standard? Web components are nice because they're browser-native, but they don't support reactivity, which in hindisight, is a massive oversight, issue, whatever you want to call it - it's hindered adoption. Lit is nice because there's a very straightforward progression from web components.

Lit has always been designed partially as a prototype for where web component standards could go in the future. That's a big reason Lit is fairly conservative and un-opinionated. It doesn't try to undo or paper-over any of the DOM APIs, but add to them instead.

There is a proposal in TC39 for native signals, which I think would make a huge dent towards library-less reactivity.

I'm also working on a proposal for native reactive templating which would more-or-less obsolete lit-html. I wrote about the idea some on my blog:

- The time is right for a DOM templating API https://justinfagnani.com/2025/06/26/the-time-is-right-for-a...

- What should a native DOM templating API look like? https://justinfagnani.com/2025/06/30/what-should-a-dom-templ...

Re: Lit: a library for building fast, lightweight web components

#26
post #18

Earlier quoted context omitted.

Any whispers of something like lit being made part of the webcomponents standard? Web components are nice because they're browser-native, but they don't support reactivity, which in hindisight, is a massive oversight, issue, whatever you want to call it - it's hindered adoption. Lit is nice because there's a very straightforward progression from web components.

Lit has always been designed partially as a prototype for where web component standards could go in the future. That's a big reason Lit is fairly conservative and un-opinionated. It doesn't try to undo or paper-over any of the DOM APIs, but add to them instead. There is a proposal in TC39 for native signals, which I think would make a huge dent towards library-less reactivity. I'm also working on a proposal for nativ…

[deleted]

Re: Lit: a library for building fast, lightweight web components

#29
post #15

For the frontend work that I did, Lit was a godsend. It really helps you build components and apps without getting in the way. In comparison, Angular is a monster, and React is designed for the old browser capabilities, and is now staying around by inertia, not by inherent quality.

Which old browser capabilities are you referring to? Could you say more, or link to more details?

Re: Lit: a library for building fast, lightweight web components

#30
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.

Post reply on HN