2 ms·
When using stencil prerendering or SSR, you absolutely can write a component with shadow dom and have it prerendered. For example, most of ionic's components (h
by elliemae88 6y ago
When using stencil prerendering or SSR, you absolutely can write a component with shadow dom and have it prerendered. For example, most of ionic's components (https://ionicframework.com/docs https://ionicframework.com/docs) are shadow dom, and you can prerendering an Ionic app. The prerendered html generates a flat dom tree, and when the clientside JS hydrates each component it'll update the component to use shadow dom, all without a flicker, and it reuses the same original dom nodes.
- chrismorgan 6y agoI should have been more specific: I was speaking of SSR working and being interactive without JavaScript, based upon my interpretation of the significance of jiofih’s comment. Hence also my reference to my other comment, which goes into more technically precise detail (concerning the shadow DOM not being serialisable, hence JavaScript being required to make any faking of that work again). I used the word “prerendering” because the parent comment did, but I should have been more careful with my terminology, because I didn’t quite mean that.