wobsoriano/svelte-sonner

Support for server-side rendering toasts

Closed this issue · 1 comments

Describe the feature

I'm using sveltekit-flash-message to show messages generated server-side (after redirecting POST requests). It would be great to be able to combine this with svelte-sonner, which I use to show messages that are generated client-side.

I imagine we could do something like

// src/routes/+layout.svelte
<Toaster>
  <Toast>
    This message was generated server-side.
  </Toast>
</Toaster>

And then the server-side rendered toast would be hydrated on page load to behave just like the client-side rendered toasts. What do you think? With this approach, the SSR toasts will be shown even without javascript enabled.

Same as this issue on the original sonner repo. I want to keep it as close as the original implementation... and hydrating it during SSR could introduce unnecessary overhead.

Sorry but I'll not support this for now! peace