←back to thread

277 points merqurio | 3 comments | | HN request time: 0.409s | source
Show context
jfagnani ◴[] No.45113365[source]
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 :)

replies(11): >>45113424 #>>45113441 #>>45113454 #>>45113460 #>>45113948 #>>45113980 #>>45114324 #>>45115284 #>>45115810 #>>45115985 #>>45117006 #
akmittal ◴[] No.45113424[source]
Curious which web platform features are missing that are preventing Web components to complete with React(for application development not widgets)?
replies(3): >>45113473 #>>45114450 #>>45117663 #
jfagnani ◴[] No.45113473[source]
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

replies(4): >>45113731 #>>45114341 #>>45115411 #>>45117764 #
brazukadev ◴[] No.45114341[source]
> - Open styleable shadow roots

What people using web components want is to get rid of shadowDOM and not feel like they are deviating from the correct path. shadowDOM sucks, stop trying to convince the world that we are using it wrong. shadowDOM is the whole reason web components did not become mainstream (yet?).

replies(3): >>45115372 #>>45116150 #>>45117075 #
1. mock-possum ◴[] No.45117075[source]
What about shadow dom sucks?

How else do you achieve that level of encapsulation to enable portable components?

replies(2): >>45117471 #>>45117603 #
2. brazukadev ◴[] No.45117471[source]
You don't want to enable portable components all the time. If most of the components you use to create your app is made by yourself, those boundaries are annoying, not helpful.
3. Muromec ◴[] No.45117603[source]
The point is you mostly don't want this level of encapsulation