How this blog was born
Why Svelte tho?
Our focus was always on pushing performance as far as possible, and we were hitting limits with React, especially when server rendering.
At the time we had a very custom SSR configuration, and decided to evaluate whether it was worthwhile migrating to Next.js, or whether we should give Svelte (and specifically Sapper) a spin. This was, of course, a risk. Though Svelte had already been around for a while, we'd not yet hit the rapid swell in popularity that occurred around the beginning of 2020. We decided to take the risk.
Sapper was (and still is, though now it is superseded by SvelteKit) in beta, and we ended up frequently contributing to the framework in order to fix bugs that we encountered while we were building what would become the groundwork for the Crown ecommerce framework. The first ecommerce store we launched on Svelte/Sapper was Johnells, which was recently named the fastest ecommerce website in Sweden.
Apart from being significantly more performant than React, Svelte is simply a pleasure to work with. All engineers at Hyperlab were able to pick it up very quickly and become productive with it. The official tutorial is a masterclass in documentation, and the core abstractions (reactive assignment, stores) are easy to grok and fast to work with.
So, that’s why I chose Svelte, and will likely choose Svelte for anything I do outside of my day job. (My day job is all React everywhere). I do mention Svelte at least once a week at my day job though, just to make sure my colleagues are prepared for the day I rewrite the entire banking app.
This blog is built with SvelteKit and hosted on Vercel.
The source is here, so go ahead and peruse it. I'm basically just grabbing a dir of markdown files, converting them to markdown and then using the
static SvelteKit adapter to output a static site for hosting on Vercel. The cool thing about Vercel is that it runs the build every time I push to Github, so deploying changes is just a matter of pushing.
That's fine for now, although it would be kinda neat to have a CMS hosted somewhere. Since all of my markdown is in Github, I could edit them there and commit directly from Github's UI, but the flow is a little bit clumsy.