3 ms·
Where does the data come from, if not JS? How then do HTML Web Components start rendering, without data?
by winter_blue 3y ago
Where does the data come from, if not JS? How then do HTML Web Components start rendering, without data?
- iteratethis 3y agoThe data would come as part of the server response in most cases. A variation could be the rendering of a partial UI whilst you then fetch data client-side. Even in this case the web component has the advantage as no JS is needed to render the initial UI.
- micromacrofoot 3y agoAs long as you're not shoving everything into the shadow dom, then you've got a fallback HTML element that can render before JS is read (and even if the JS is completely broken)... <special-image> <img src="/example.png" /> </special-image> This image will render before the JS is executed, so you've got no blockers and a perfectly fine fallback, then with the web component you enhance your image with whatever JS you want.
- deleted 3y ago[deleted]