Rebuilt the Blog Again AGAIN
Howdy howdy howdy!
Every year or so I find a new thing I like and try building the blog in it. I do not know why I suffer this particular compulsion, but I simply get the itch when I find something that looks neat.
Previously On Rebuilt the Blog
This Week on Rebuilding the Blog
I started exploring Svelte a few years ago, and did a couple of projects with it. Svelte has a lot of good going for it. In a lot of ways it is similar to React, but in a few very key ways it is better. For instance, I was still making SPAs with Svelte, and I still had those same issues with routing requests to my application. The bundle size was much smaller, but still relatively large when compared to a vanilla html/css/js setup. Generally, I really like a lot of the way Svelte does things. The bindings are similar to React, but there is no shadow-DOM involved, so really hefty front-ends do not incur as much lag.
I took a look at Sapper when it first came out, but I did not want to run an actual server (NodeJS -> gross). However, Rich Harris made the announcement around Sapper being rebranded as SvelteKit and supporting static site adapters, and I sat up and listened. This was the announcement I had been waiting for. So, I rewrote the blog using SvelteKit and it’s exactly what I wanted. I get everything I want from Svelte (components are isolated, agnostic of one another, and fully encapsulated in a single file; the application is composed of those components; and all those components are reusable), I write all my posts in vanilla markdown, and then all my pages are built into static html/css/js and served from vanilla directories. I throw it up on S3 and terminate SSL via CloudFront - ezpz.
So far, it’s much better than Gatsby. There is no magic via GraphQL or anything like that. It is
just Svelte that builds into a static site. Also, there are MANY fewer files to dig through.
Prior to rewriting the blog, I had not looked at the code that generates the blog since I first
wrote it using Gatsby - there were a bunch of files I did not remember, let alone what they did.
With SvelteKit, there is a single configuration file that seems to align with the