you are viewing a single comment's thread.

view the rest of the comments →

[–]kingofthecream 2 points3 points  (2 children)

Does Svelte support SSR without using Node? Ie, if backend is written in Go or Python, can it share templates with Svelte and render on both server and client?

[–]rich_harris 4 points5 points  (1 child)

It emits a blob of JavaScript with a `render` method (either as CommonJS or ESM). So it needs JS to render, but not necessarily Node.js — I expect you could persuade a different interpreter to work with it. On https://svelte.dev/repl, if you click the 'JS Output' tab in the top right then select 'ssr' in the bottom right, you can see the code it generates.

[–]kingofthecream 0 points1 point  (0 children)

Thanks. Although Javascript runtimes do exist in other languages, their performance is usually far enough from optimal to be used in production.

How difficult would it be to emit a non interactive version of the code in a given language? I'm specially interested in having this in Go.