Convert to static export for free hosting#21
Open
chanind wants to merge 2 commits into
Open
Conversation
Replace Vercel SSR (fallback: "blocking") with Next.js static export (`output: 'export'`), enabling deployment to any static host (Cloudflare Pages, Netlify, etc.) for free. Approach: - Changelog pagination pages (~970) are fully statically generated - Commit/item detail pages use client-side rendering with pre-built JSON data chunks fetched at runtime - Data is chunked by SHA prefix (256 buckets) for efficient loading - _redirects provides SPA fallback for client-rendered routes New files: - scripts/buildStaticData.ts: pre-builds JSON data chunks - data/clientDatabase.ts: browser-side data fetching - components/ClientCommitPage.tsx, ClientItemPage.tsx: shared UI Build produces ~3000 files in ~35 seconds (vs. 50k+ pages that previously timed out). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add shell index.tsx pages alongside [sha].tsx/[name].tsx dynamic routes. The shell pages generate HTML for _redirects SPA fallback (direct URL access), while the dynamic routes register in Next.js's client-side router (so <Link> navigation works correctly). Reverts the <Link> → <a> changes since proper dynamic routes make client-side navigation work as expected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
fallback: "blocking") with Next.jsoutput: 'export'for static hosting_redirectsfile for SPA fallback on Cloudflare Pages / NetlifyHow it works
scripts/buildStaticData.tspre-builds JSON data chunks:data/clientDatabase.tsfetches chunks in the browser using react-queryClientCommitPage/ClientItemPagerender the same UI as before, but client-side_redirectshandles SPA fallback + legacy URL redirectsTest plan
yarn buildcompletes successfully (~35s)_redirects🤖 Generated with Claude Code