Skip to content

feat(docs): migrate from Remix 2 to React Router 7#2468

Merged
joshuaellis merged 2 commits into
nextfrom
003-remix-to-react-router-7
May 22, 2026
Merged

feat(docs): migrate from Remix 2 to React Router 7#2468
joshuaellis merged 2 commits into
nextfrom
003-remix-to-react-router-7

Conversation

@joshuaellis
Copy link
Copy Markdown
Member

@joshuaellis joshuaellis commented May 22, 2026

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 /examples page used to fetch sandbox metadata from codesandbox.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 in demo/src/sandboxes/, so the page now reads each demo's package.json and thumbnail.png at build time via Vite's import.meta.glob. Adding a new demo folder auto-flows into docs.

Three small fixes were unavoidable along the way: scripts:watch was 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 root package.json carried a stale @remix-run/dev devDep plus a deprecated postinstall no-op.

Caveats

@vercel/analytics lists @remix-run/react as 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. A pnpm.packageExtensions override would close this if you want strict-zero.

One pre-existing pnpm test:ts error in AccessibleIcon.tsx (React 19 cloneElement typing tightening) is not fixed here — it exists on next and isn't migration-related.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 6749937

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-spring Error Error May 22, 2026 6:58am

Request Review

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).
@joshuaellis joshuaellis force-pushed the 003-remix-to-react-router-7 branch from 185433b to 6749937 Compare May 22, 2026 06:58
@joshuaellis joshuaellis merged commit f1448dd into next May 22, 2026
17 of 18 checks passed
@joshuaellis joshuaellis deleted the 003-remix-to-react-router-7 branch May 22, 2026 07:44
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.

1 participant