Skip to content

[codex] Migrate website SSG to React Router#99

Merged
nedtwigg merged 5 commits into
mainfrom
react-router-ssg
May 27, 2026
Merged

[codex] Migrate website SSG to React Router#99
nedtwigg merged 5 commits into
mainfrom
react-router-ssg

Conversation

@nedtwigg
Copy link
Copy Markdown
Member

Summary

Migrate the website static build from vite-react-ssg to React Router Framework Mode with ssr: false, including React Router route modules, client/server entries, and the build flattening step needed for Cloudflare Pages.

The branch also keeps the changelog filter route client-side: /changelog/after/* is rewritten to React Router's generated SPA fallback so the browser URL is preserved without generating HTML for every release version.

Impact

  • Website builds now use react-router build and prerender the stable static routes.
  • Changelog filter URLs continue to work through client-side route params.
  • The website no longer prerenders a separate static HTML file for every changelog version.

Validation

  • pnpm --filter dormouse-website build
  • pnpm --filter dormouse-website test
  • Confirmed dist/_redirects points /changelog/after/* at __spa-fallback.html.
  • Confirmed dist/changelog only contains the stable changelog HTML, not per-version filter pages.

nedtwigg and others added 5 commits May 26, 2026 15:45
The React Router migration's boilerplate entry.client.tsx wrapped the app
in <React.StrictMode>, which the prior vite-react-ssg setup never did. In
dev, StrictMode double-invokes mount: dockview's onReady fires and
use-dockview-ready.ts destructively consumes initialPaneIds, then StrictMode
disposes and recreates dockview. The second onReady no longer sees the
'tut-main' pane id and generates a random one instead, so
PlaygroundDesktop.handleApiReady's addPanel({ referencePanel: 'tut-main' })
throws "referencePanel 'tut-main' does not exist" and the page crashes.

Production builds don't double-invoke, so this was a dev-only crash, but it
makes the desktop playground unusable under `react-router dev`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 876a414
Status: ✅  Deploy successful!
Preview URL: https://50b9dcc9.mouseterm.pages.dev
Branch Preview URL: https://react-router-ssg.mouseterm.pages.dev

View logs

@nedtwigg nedtwigg marked this pull request as ready for review May 27, 2026 00:08
@nedtwigg
Copy link
Copy Markdown
Member Author

@nedtwigg nedtwigg merged commit 3a631c3 into main May 27, 2026
10 checks passed
@nedtwigg nedtwigg deleted the react-router-ssg branch May 27, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants