Rebuilding my website on the Fresh framework

I gave a talk earlier this week about how much I liked working with Fresh, but I ran a bit short on time and didn't talk about what brought me to Fresh in the first place. This seems like a good place to go into it, because the motivation for trying out Fresh was building this website!

This website is in part an attempt to explore technology solutions for data-rich blogging and journalism on the web.

I have found that neither traditional server-side nor today's most popular client-side rendering solutions are a good fit for this task. The JavaScript libraries that couple well with server-rendered HTML are not up to the task of providing the level of interactivity I want, and websites built entirely in JavaScript are error-prone and reject the principles of progressive enhancement. Without the testing resources that only very large companies have access to, they usually provide a frustrating experience for users.

JAM stack frameworks are currently the best idea the community has to bridge this gap, but they fall short of server-side frameworks in terms of programming HTTP responses in a flexible way. For a website that requests data and graphs it, dynamically rendered pages and a flexible API should be strict requirements.

In my opinion, Fresh is one of the best things to happen to the web in a long time. The vast majority of the content on this side is rendered on the server. Where interactivity is needed, JavaScript and data are delivered and hydrated to existing components. Data graphics can be rendered server-side as SVG and seemlessly re-animated as canvas. Additional data can be requested from an API and appended to the graphic, or entire new pages rendered from the same template.

Fresh is also written in Deno, so it provides TypeScript, JSX, linting, testing and package management with very little configuration. It uses Preact rather than React, drastically decreasing the amount of JavaScript delivered and improving time-to-glass performance.

Other tech choices:

Despite these growing pains, I think Fresh's approach to unifying server-side and client-side rendering is the future. Building this site was a pleasure and I hope to create more like it.

Like this post? Start a conversation, browse my other writing, or view my portfolio.