Ali Kehel

Rebuilding this site with TanStack Start

How I moved my personal site from Next.js to TanStack Start on Cloudflare Workers, and got it to load with no JavaScript.

This site used to be a Next.js app, deployed through OpenNext on Cloudflare Workers. It worked, but it shipped a lot of JavaScript for what is basically one page of text and a few images. I rebuilt it with TanStack Start, and the home page now loads without any JavaScript at all.

What changed

No JavaScript in production

TanStack Start can prerender routes at build time. With that on, the build writes static HTML for every page, and the CSS is inlined into it. The home page is one response of about 20 KB.

tanstackStart({
    prerender: { enabled: true },
});

The dev server still loads React for hot reload, so I only leave the <Scripts /> tag out of the production build.

Results

Lighthouse scores 100 in all four categories on mobile and desktop. Total blocking time is 0 ms, because there is nothing to block.

This blog is written in MDX and rendered the same way, so this page is static HTML too.

All posts
Jinx Monkey