I wanted the initial render to be fast, and Go templates really shine there. Since the site has a lot of moving parts, there are many components that get hydrated depending on the page. For instance, this page (https://gurlic.com) is generated by Go, but the actions such as like/dislike/share/respond are hydrated by their respective Svelte components. If you scroll all the way down, new posts are fetched and rendered with Svelte components too, and the great bit is that I can use the same action (like/dislike/etc) components there.
Maybe there's a better way to do it, but I like writing smaller components that can replace initial server-rendered HTML, and can then be imported into larger components.
Re:What's new in Svelte (Dec 2020)
by throwaway894345 on Thursday December 03, 2020 @11:08AM
(#25290280)
That's a really neat site. Is it open source (can I peruse the source code)?
Not yet, but it's on the roadmap. As soon as I've had time for better integration with Matrix, a bit of refactoring, and writing more tests!
What is the advantage of doing this over using http.FileServer to serve html which imports your svelte generated javascript directly ?
Are you using Svelte in a part of your application instead of the entire application?