Remix.run Logo
junon a day ago

Webcomponents are a pain in the ass to make, though. That is, sufficiently complex ones. I wish there was an easier way.

eric-p7 a day ago | parent | next [-]

I've built Solarite, a library that's made vanilla web components a lot more productive IMHO. It allows minimal DOM updates when the data changes. And other nice features like nested styles and passing constructor arguments to sub-components via attributes.

https://github.com/Vorticode/solarite

jeswin a day ago | parent | prev | next [-]

It's ok now, at least for me. There are still challenges around theming and styling because of styling boundaries (which makes Web Components powerful, but still). A part of it is about tooling, which can be easier to improve.

Try my tiny web components lib if you want to keep JSX but not the rest of React: https://github.com/webjsx/magic-loop

prisenco a day ago | parent | prev | next [-]

They could have better ergonomics and I hope a successor that does comes out but they're really not that bad.

brazukadev a day ago | parent [-]

web components need 2 things to be great without external libraries (like lit-html):

- signals, which is currently Stage 1 https://github.com/tc39/proposal-signals

- And this proposal: https://github.com/WICG/webcomponents/issues/1069 which is basically lit-html in the browser

junon 16 hours ago | parent [-]

It's a shame Surplus (Adam Haile's, not my succession of it) isn't cited nor is he mentioned, given that at least two of the listed frameworks were heavily and directly inspired by his work. S.js is probably one of the most incredible JavaScript libraries I've used that should be the reference for a signal API, in my opinion.

gedy 19 hours ago | parent | prev [-]

Svelte has a pretty nice support for this via https://svelte.dev/docs/svelte/custom-elements

It's not a no-build option though.