feat(docs): migrate from Remix 2 to React Router 7#2468
Merged
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds the speckit planning artefacts for migrating the docs site off Remix 2 onto React Router 7 in framework mode. Covers the framework swap, the in-place removal of the Feedback module (FR-019), and the verification surface that proves URL continuity, SSR, theme handling, analytics, and zero leak of server-only modules into the client bundle. Scope is strictly the docs/ workspace; no library packages are touched.
Replaces Remix 2 with React Router 7 in framework mode — the supported successor — across the docs workspace. URL surface, MDX content, Vanilla Extract styling, theme + client-hints cookie handling, search, Sandpack, and analytics all preserved. Notable changes beyond the framework swap: - Removes the in-page Feedback module (FR-019): per-page widget, Supabase API route, and the `@supabase/supabase-js` runtime dep. GitHub Discussions remains the canonical feedback channel. - Sources /examples sandboxes from the demo workspace at build time via Vite's `import.meta.glob`. Each demo's package.json (name, description, keywords) and thumbnail.png is the source of truth; adding a sandbox folder under demo/src/sandboxes auto-flows into docs with no generator step. Drops the old CodeSandbox API fetch path (which is Cloudflare-blocked from server contexts). - Repairs scripts:watch / scripts:build under Node 22+ and chokidar 4: switches from esbuild-register to tsx, fixes ESM __dirname, and replaces the deprecated glob-as-path with chokidar 4's ignored callback idiom. - Resolves a hydration mismatch in the GTM widgets — replaces the inverted `typeof window` SSR guard with a root-loader-driven flag so server and client agree on whether to render. - Cleans up `@remix-run/dev` from the root package.json and the associated deprecated `postinstall: "remix setup node"` no-op. Deployment continues via Vercel using the `@vercel/react-router` preset wired in `react-router.config.ts`. Build output moves from `build/` (Remix shape) to `build/client/` + `build/server/` (the RR7 shape, with the Vercel preset producing per-runtime server artefacts).
185433b to
6749937
Compare
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.
Remix 2 is no longer the active framework — its successor is React Router 7 in framework mode. This swaps the docs site over so it sits on a supported, maintained foundation. The URL surface, MDX content, theme + cookie handling, search, Sandpack, and analytics are unchanged.
Notable deviations from a pure framework swap
The in-page Feedback module (per-page widget + Supabase action) is removed. It was an unmaintained dependency on Supabase that nobody is monitoring; GitHub Discussions remains the canonical feedback channel.
The
/examplespage used to fetch sandbox metadata fromcodesandbox.io/api/*at request time. Those endpoints are now Cloudflare-bot-challenged and 403 every server-side request — the page has been broken in production. The data is already maintained alongside the source indemo/src/sandboxes/, so the page now reads each demo'spackage.jsonandthumbnail.pngat build time via Vite'simport.meta.glob. Adding a new demo folder auto-flows into docs.Three small fixes were unavoidable along the way:
scripts:watchwas already broken under Node 22+ (esbuild-register + chokidar 4); a Google Tag Manager widget had an inverted SSR guard that caused hydration mismatches the moment we exercised SSR end-to-end; and the rootpackage.jsoncarried a stale@remix-run/devdevDep plus a deprecatedpostinstallno-op.Caveats
@vercel/analyticslists@remix-run/reactas an optional peer, which pnpm 9 still auto-installs as a ghost transitive even though nothing imports it. Functionally inert, but technically leaves the@remix-run/*scope in the lockfile. Apnpm.packageExtensionsoverride would close this if you want strict-zero.One pre-existing
pnpm test:tserror inAccessibleIcon.tsx(React 19cloneElementtyping tightening) is not fixed here — it exists onnextand isn't migration-related.