Open
Conversation
Coded with Claude Sonnet 4.5
Coded with Claude Sonnet 4.5
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR switches away from SvelteKit and rewrites the site in Fresh.
Background
Content updates are one of the biggest architectural factors of Blips. The data is stored in a remote CMS rather than a folder inside the repo, which complicates things significantly.
My initial strategy was to make Blips fetch and render all content at runtime on the client side. This had the advantage of being portable and very simple, but it came at the cost of long page load times.
Then, in #3, I re-architected Blips to use SSG and a webhook. This approach involved zero runtime logic and allowed for very very fast page load times, but it necessitated a complex webhook (with a GH PAT) and required rebuilding the entire site on each content update, which is complex.
I prototyped a solution in #8 using SvelteKit's
adapter-autofor SSR, meaning the site would fetch and render the blip data on each request at runtime, but it would do so on the server-side. This approach isn't compatible with GitHub Pages, so I had to switch to Vercel. This solution worked well on paper and in testing, but eventually it became apparent that it had a significant drawback: cold starts. After periods of inactivity, Vercel would shut down the server to save resources and quickly spin up a new one once a new request was received. Unfortunately, "quickly" still meant that it took >5 seconds, which is far more than I'm ever willing to tolerate for load times of my sites.So the things that I was unwilling to tolerate were:
Fresh & Deno Deploy
The solution that I found that fulfilled all three of these criteria was using the Fresh web framework and Deno Deploy.
Fresh is the SSR framework for Deno (as opposed to Node.js). I'd really enjoyed using Lume (the SSG framework for Deno) for ethmarks/posts, so I figured that Fresh was likely to also be good.
Deno Deploy is Deno Land Inc's hosting service. It has native support for the Deno runtime and Fresh (Vercel supports neither). Critically, Deno Deploy uses v8 isolates which can cold start in tens of milliseconds, whereas Vercel uses full VMs which take multiple seconds to spin up.
However, Fresh is not SvelteKit (citation needed), so I needed to rewrite the whole site from scratch. And that's what this PR does.
Notable Changes
This wasn't just a note-for-note translation of framework boilerplate, however. Here are a few specific changes I made.
deploy.ymlGitHub Action. Fresh is fundamentally incompatible with GitHub Pages, so there's no reason to have any logic pertaining to it as a deployment target. This means that the Sanity Webhook is no longer used and can be disabled.