patricknelson / svelte-retag

Light DOM custom element wrapper for Svelte 3 and 4 with slots, context and Vite HMR support
https://www.npmjs.com/package/svelte-retag
MIT License
39 stars 0 forks source link

Enable hydration of pre-rendered Svelte custom elements #17

Closed patricknelson closed 11 months ago

patricknelson commented 12 months ago

Facilitates SSR of Svelte-based web components (custom elements) using the light DOM via a new hydratable option which will include special markers to slots. These markers allow svelte-retag to recover slots from a pre-rendered Svelte web component which then in turn allows it to initialize the provided/embedded Svelte component and make it interactive again on the client-side.

Note: While this allows pre-rendering of the component, it doesn't restore complete state unless that state is already encoded in via the custom element attributes or light DOM slots (both named and default slots).

vercel[bot] commented 12 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-retag ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2023 3:22am