Remix.run Logo
jazzypants 7 days ago

It should not be the default. This is almost certainly Lit's biggest flaw.

I am currently working on a web components framework, and I scrapped everything halfway through after I realized that you very rarely want that much encapsulation. Now, you can turn it on if you really need it, and I even made a way where you can pass references to DOM elements and stylesheets and such into each component so you can pierce the shadow veil easily. I have one demo to show it off, but I'm really having trouble imagining when someone would actually want to use it. The only time I can imagine it being useful would be building component libraries inside of large organizations.

I'm not ready to show off my framework yet, but I'm very certain that this leads to a better DX.

Muromec 7 days ago | parent | next [-]

>The only time I can imagine it being useful would be building component libraries inside of large organizations.

That was our use case and we are migrating away from custom elements to a more conservative approach.

kubb 7 days ago | parent | prev [-]

Good luck with your better framework, but if this is the biggest flaw… then there’s really not much to complain about.

jazzypants 7 days ago | parent [-]

Thanks! That's hardly the biggest difference to Lit. I think Lit is a fantastic framework, and I'm not trying to replace it or anything. However, it's really unopinionated which is fantastic for flexibility, but it leads to every deployment looking and feeling very different.

Basically, I'm just curious what a full-stack web component framework with strong defaults could look like. This is primarily a learning exercise, and a way to experiment with integrating web components into modern framework concepts like streaming server components, resumability, automatic serialization, and type-safe RPCs. I don't know if it will ever be production-ready, but I've learned a lot and it's been a ton of fun.

__oh_es 6 days ago | parent [-]

Have you seen https://brisa.build/? Its not web-components first but it looks really well designed and may give you some inspo