Skip to content

React Router v8 upgrade POC (AI-assisted)#12191

Draft
slorber wants to merge 1 commit into
mainfrom
slorber/codex/react-router-v8-poc
Draft

React Router v8 upgrade POC (AI-assisted)#12191
slorber wants to merge 1 commit into
mainfrom
slorber/codex/react-router-v8-poc

Conversation

@slorber

@slorber slorber commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

POC upgrade of Docusaurus from React Router v5 to React Router v8, with history@5.

This intentionally focuses on proving that the current Docusaurus website can build with the latest React Router stack. It does not attempt to complete the full migration, update all tests, or fully polish public types yet.

This PR was prepared with AI assistance. (AI-assisted)

What changed:

  • Upgraded React Router dependencies to react-router@8.0.1.
  • Upgraded history to 5.3.0.
  • Updated React and React DOM to 19.2.7, matching React Router v8 requirements.
  • Removed direct usage of react-router-dom and react-router-config from the runtime path.
  • Added a small compatibility layer for Docusaurus’ existing generated route config shape.
  • Added a local history context so existing @docusaurus/router consumers can still access a useHistory-style API during the POC.
  • Updated client/server entries, link handling, route matching, preloading, and broken-link route checks accordingly.

Important caveats:

  • This is a compatibility bridge, not a full idiomatic React Router v8 rewrite.
  • PendingNavigation was simplified because the previous React Router v5 controlled <Route location> pattern does not map cleanly to v8.
  • Some tests, docs, and type surfaces may still reference older React Router concepts and should be handled in follow-up work.
  • The dependency install required bypassing the repo minimumReleaseAge setting because React Router v8 is very recent.

Test Plan

Validated locally:

pnpm --filter @docusaurus/core build
pnpm build:packages
pnpm build:website:fast

Test links

Deploy preview: https://deploy-preview-12191--docusaurus-2.netlify.app/

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Jun 19, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedreact-router@​8.0.1731007998100
Addedhistory@​5.3.01001008280100
Addedreact@​19.2.71001008497100
Addedreact-dom@​19.2.71001009298100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant