Post

Super excited to announce the experimental release of asynchronous SSR in Svelte! github.com/sveltejs/sve... `await` expressions in your Svelte components can now be rendered on the server, meaning you don't need to render them inside boundaries with a `pending` snippet. Next up, streaming SSR!

github.comAsync SSR · sveltejs svelte · Discussion #16784The Svelte team has been hard at work on asynchronous rendering, with client-side support and remote functions as our first two efforts. It’s time for the third: SSR. Background There are three cor...

21 reposts91 likes

Nope! renderAsync is a goofy name for what should be the default; better to just get rid of sync rendering altogether. Of course, that would be a breaking change, so... voila 😎 const sync_output = render(Component); const async_output = await render(Component);

So what exactly changed then in 5.39.0? 😅 I'm using `render` to generate emails. I've updated to the latest version but the function (at least according to TypeScript) still seems to be sync, not async. Is this just an under-the-hood change that won't be visible until kit makes use of it?

Great question! Your approach is interesting and worth testing. For my part, I try never to break the stream and always produce valid HTML output with the error displayed in the placeholder with more or less information depending on the configuration (prod/dev).

Thanks! I would like to avoid CDNs caching the response, so responding normally is not an option. The specs linked in that code say that you’re not supposed to end the http/1.1 stream with a zero-length chunk in that case. But ReadableStream.from does that no matter what Uint8Array I pass it.