Kinda fun, so you’re tagging HTML elements with JS traits the same way you’d tag them with CSS classes. Very much a shame it explicitly does not work with the ShadowDOM though.
nymanjon•6mo ago
So, what use case would you see with ShadowDOM?
I see this more as a way to progressively enhance an element. But in my own use of web components I haven't seen a need for ShadowDOM, but I'm usually just progressively enhancing my page and adding behaviors to my elements. I can see a use case for ShadowDOM when completely creating a new element, but at that point it makes sense to just use a regular web component. Maybe I'm wrong. But that is the reasoning I'm using.
cdaringe•6mo ago
I kinda see it. As a non HTMX user, it kind of feels like a “build your own” HTMX substrate
nymanjon•6mo ago
I could see it used for something like that. But it is more general as it can act upon any HTML element. So, you could use it for masking an input element or any other local state based element. Granted, it doesn't need to be limited to local, but at that point HTMX, Datastar, html-form, etc might make more sense.
html-form is the one I made out of those and it is more single focus using the native platform.
mock-possum•6mo ago
nymanjon•6mo ago
I see this more as a way to progressively enhance an element. But in my own use of web components I haven't seen a need for ShadowDOM, but I'm usually just progressively enhancing my page and adding behaviors to my elements. I can see a use case for ShadowDOM when completely creating a new element, but at that point it makes sense to just use a regular web component. Maybe I'm wrong. But that is the reasoning I'm using.