2 ms·
I really like it. Replaced Vue with Svelte and things have been great so far. Smaller bundles, and much lighter components. Built-in state management is very ha
by SubGenius 6y ago
I really like it. Replaced Vue with Svelte and things have been great so far. Smaller bundles, and much lighter components. Built-in state management is very handy.
The initial pages are Go templates which are hydrated with Svelte components. It took a bit of trial and error to get the flow right so that I don't have to write double the code.
I don't know if it's the next big thing or not but it works really well for me.
- IceWreck 6y ago> The initial pages are Go templates which are hydrated with Svelte components. It took a bit of trial and error to get the flow right so that I don't have to write double the code. 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?
- SubGenius 6y agoI 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 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.
- edoceo 6y agoI like this way too
- throwaway894345 6y agoThat's a really neat site. Is it open source (can I peruse the source code)?
- SubGenius 6y agoNot 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!