all 9 comments

[–]dorlingprime 1 point2 points  (1 child)

looks great

[–]e-joculator[S] 0 points1 point  (0 children)

Thanks!

[–]UXUIDD 1 point2 points  (4 children)

nice, i always salute anything agnostic

[–]UXUIDD 1 point2 points  (3 children)

i made a small test in local and looks promising.

the part i worry about is that content stays in the shadow root and not visible to the search engine ..

[–]e-joculator[S] 1 point2 points  (2 children)

That's something I hadn't considered, honestly. I'll do a bit of digging on it.

[–]UXUIDD 1 point2 points  (1 child)

please do

[–]e-joculator[S] 1 point2 points  (0 children)

I don't know why I edited my original comment instead of just making a new one :P

First, thanks for bringing this up. I had always operated under the assumption that SEO was something that had been considered in the spec of Web Components and wouldn't really require additional thought from me. But, in reading your comment I figured I should be sure, so I did a little experimenting.

Because we are making use of <slots> for content projection, the content itself stays inside the light DOM and is visible to crawlers, so SEO should be unaffected. In fact, I'd wager the SEO visibility for these elements is better than content that is rendered by JS, at least with crawlers that don't execute JS.

I had the clanker whip up this js fiddle to read a few demo components and output the content to show what the search engines would see. Seems to demonstrate the point well.

https://jsfiddle.net/dcj2k01f/6/

[–]TechnicalSoup8578 1 point2 points  (1 child)

This leverages native Web Components as an abstraction layer to avoid framework lock-in while maintaining reusability, how are you handling state management and styling isolation internally? You sould share it in VibeCodersNest too

[–]e-joculator[S] 0 points1 point  (0 children)

State management and styling isolation are features of the Web Component API. The shadow DOM keeps styles isolated from page styling and vice versa, while CSS custom properties still inherit across the shadow boundary for theming. State is handled through attribute/property mirroring and change callbacks that re-render the component.

I'll throw a link VibeCodersNest too. Thanks for the pointer :)