Skip to content

feat(core): upgrade React Router v5 → v8 (and history v5)#12190

Draft
slorber wants to merge 2 commits into
mainfrom
slorber/react-router-v8
Draft

feat(core): upgrade React Router v5 → v8 (and history v5)#12190
slorber wants to merge 2 commits into
mainfrom
slorber/react-router-v8

Conversation

@slorber

@slorber slorber commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Warning

Draft / proof-of-concept. The goal of this PR is to prove that Docusaurus can build on the latest React Router (v8) and history (v5). It deliberately skips full type-safety polish for now — see the unchecked items below.

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. (POC — existing tests/dogfooding pages were used; the brokenLinks test suite was updated for the new matcher.)
  • 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

Docusaurus is still on React Router v5 (and history v4), both unmaintained for years. This PR is a proof-of-concept upgrade all the way to the latest releases:

Package Before After
react-router ^5.3.4 ^8.0.1
react-router-dom ^5.3.4 removed
react-router-config ^5.1.1 removed
history v4 (transitive) ^5.3.0

Reading the three release posts and their migration guides (v6, v7, v8), the work breaks down as:

  • v5 → v6 is the real migration — react-router-config, <Switch>, the controlled <Route location>, NavLink's isActive/activeClassName, <Redirect>, useHistory, and the mutable history object are all gone, and matchPath changed signature.
  • v6 → v7 mostly merges react-router-dom into react-router.
  • v7 → v8 drops the react-router-dom mirror entirely (use react-router) and makes the package ESM-only, targeting Node 22+ / React 19+ (we already ship React 19).

Because Docusaurus uses React Router in declarative/library mode (not framework/data mode), almost none of the v7/v8 framework future-flags apply — the challenge is keeping the v5-era primitives Docusaurus depends on working, while reusing React Router's own APIs as much as possible.

Key changes

1. react-router-config is gone → reuse React Router's matchPath.
renderRoutes/matchRoutes/RouteConfig no longer exist in v6+. Docusaurus' route config is string-based, recursive (routes), and order-based (first-match-wins), so:

  • @docusaurus/renderRoutes is reimplemented as a small <Switch>-like component (no v8 equivalent for this pattern), preserving the existing absolute-path, first-match-wins recursion (renderRoutes(route.routes)).
  • A thin v5-compatible matchPath/matchRoutes is kept (the public @docusaurus/router API uses the v5 signature), but built on top of React Router's own matchPath rather than hand-rolling path matching. The only extra logic is re-enforcing trailing-slash sensitivity for strict routes (v6's matchPath has no strict option).
  • React Router v8 is ESM-only, and the broken-links checker runs as CommonJS, so it loads matchPath via a dynamic import('react-router').

2. No more history object / useHistory in v6+ → drive RR with our own history.
v6 hides history behind the router. Docusaurus instead creates a history-package instance (browser/hash on the client, memory on the server) and drives React Router with the low-level <Router navigator={history}> — exactly what BrowserRouter and the removed unstable_HistoryRouter do internally. @docusaurus/router's useHistory() returns it via context, keeping historyUtils (navigation blocking, listen, querystring helpers) working. This also lets us drop <StaticRouter> (SSR uses a memory history → useHistory() is uniform on client & server).

3. Controlled <Route location> is gone → location-override context.
PendingNavigation used <Route location={...}> to keep rendering the previous route until the next one finished preloading. Replaced with a small location-override React context that @docusaurus/router's useLocation() and renderRoutes read.

4. NavLink lost isActive/activeClassName/activeStyle.
These are heavily used by navbar items with the v5 isActive(match, location) signature. Docusaurus' <Link> now reimplements the active-state computation on top of React Router's <Link> + useLocation/matchPath, preserving the existing public API. Also: innerRefref (React 19), and a <Redirect><Navigate> compatibility shim.

5. history v5 API tweaks.
History is no longer generic, and block() now receives a transition object (block-until-retry()); historyUtils was adapted accordingly.

Temporary: pnpm-workspace.yaml adds a minimumReleaseAgeExclude entry for react-router@8.0.x because v8 was published only days ago (under the repo's 7-day install gate). This can be removed once v8 ages past the threshold.

Note

Known follow-ups before this is merge-ready: type-safety cleanup, and two runtime behaviors not exercised by a production build — navigation blocking now re-arms after each allowed navigation (history v5 retry semantics), and useLocation() is now called in every <Link> (links re-render on navigation; worth optimizing for large pages).

Test Plan

Local build of the Docusaurus website on the upgraded stack:

pnpm install
pnpm build:packages          # all 36 packages compile with tsc ✅
pnpm build:website:fast      # ✅ [SUCCESS] Generated static files in "build"
pnpm vitest run brokenLinks  # ✅ 35/35 (updated for react-router's matchPath)
  • pnpm build:website:fast succeeds: 982 HTML pages generated, and the broken-links checker passes (validates the new matchPath-based matching for both routing and link validation).
  • The brokenLinks test suite (incl. exact/strict trailing-slash cases and the perf/optimization test from After updating to v3.1, large repo build takes 3 hours #9754) passes after being repointed to spy on react-router's matchPath.
  • Spot-checked rendered output: homepage renders the hero, /docs/introduction renders the doc markdown with navbar__link--active (NavLink active-state works during SSG), and blog posts render via nested routes. Only 404.html contains "Page Not Found" (the * catch-all), confirming routes resolve to real components.

Test links

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

Relevant pages to review in the preview:

  • Home: /
  • Docs (sidebar + active navbar/sidebar links): /docs
  • Blog (nested routes): /blog
  • 404 (catch-all route): any non-existent path
  • Querystring/history features (e.g. theme Tabs with queryString, version dropdown)
  • Hash router: /tests/ hash-router pages

Related issues/PRs

  • Upgrade React Router v5 → v8 and history → v5.

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

socket-security Bot commented Jun 19, 2026

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

View full report

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Size Change: +154 kB (+1.28%)

Total Size: 12.2 MB

📦 View Changed
Filename Size Change
website/build/assets/js/main.********.js 744 kB +14.3 kB (+1.95%)
website/build/blog.html 79 kB +1.44 kB (+1.86%)
website/build/blog/2017/12/14/introducing-docusaurus.html 66.7 kB +970 B (+1.48%)
website/build/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus.html 46 kB +932 B (+2.07%)
website/build/blog/2018/09/11/Towards-Docusaurus-2.html 50.3 kB +937 B (+1.9%)
website/build/blog/2018/12/14/Happy-First-Birthday-Slash.html 30.2 kB +951 B (+3.25%)
website/build/blog/2019/12/30/docusaurus-2019-recap.html 41.2 kB +951 B (+2.37%)
website/build/blog/2020/01/07/tribute-to-endi.html 33.8 kB +970 B (+2.96%)
website/build/blog/2021/01/19/docusaurus-2020-recap.html 52.6 kB +951 B (+1.84%)
website/build/blog/2021/03/09/releasing-docusaurus-i18n.html 48.5 kB +970 B (+2.04%)
website/build/blog/2021/05/12/announcing-docusaurus-two-beta.html 49.3 kB +1.08 kB (+2.25%)
website/build/blog/2021/11/21/algolia-docsearch-migration.html 55.4 kB +951 B (+1.75%)
website/build/blog/2022/01/24/docusaurus-2021-recap.html 44.6 kB +1.06 kB (+2.45%)
website/build/blog/2022/08/01/announcing-docusaurus-2.0.html 135 kB +1.35 kB (+1.01%)
website/build/blog/2022/09/01/docusaurus-2.1.html 51.3 kB +989 B (+1.97%)
website/build/blog/archive.html 24.7 kB +855 B (+3.59%)
website/build/blog/authors.html 51.6 kB +1.08 kB (+2.15%)
website/build/blog/authors/j-marcey.html 72.1 kB +1.77 kB (+2.51%)
website/build/blog/authors/josh-cena.html 48.3 kB +1.33 kB (+2.83%)
website/build/blog/authors/lex-111.html 57.2 kB +1.43 kB (+2.56%)
website/build/blog/authors/slorber.html 82.6 kB +1.5 kB (+1.85%)
website/build/blog/authors/slorber/page/2.html 81.8 kB +1.52 kB (+1.89%)
website/build/blog/authors/slorber/page/3.html 85.3 kB +1.48 kB (+1.77%)
website/build/blog/authors/slorber/page/4.html 98 kB +1.79 kB (+1.86%)
website/build/blog/authors/slorber/page/5.html 54.6 kB +1.14 kB (+2.13%)
website/build/blog/authors/yangshun.html 67.9 kB +1.52 kB (+2.29%)
website/build/blog/authors/zpao.html 48.6 kB +1.2 kB (+2.52%)
website/build/blog/page/2.html 78.2 kB +1.46 kB (+1.91%)
website/build/blog/page/3.html 82.6 kB +1.43 kB (+1.76%)
website/build/blog/page/4.html 87.1 kB +1.63 kB (+1.91%)
website/build/blog/page/5.html 74.4 kB +1.54 kB (+2.11%)
website/build/blog/page/6.html 42 kB +1.25 kB (+3.08%)
website/build/blog/preparing-your-site-for-docusaurus-v3.html 127 kB +1.08 kB (+0.86%)
website/build/blog/releases/2.2.html 51.5 kB +1.03 kB (+2.03%)
website/build/blog/releases/2.3.html 62 kB +1.1 kB (+1.81%)
website/build/blog/releases/2.4.html 65.3 kB +1.01 kB (+1.57%)
website/build/blog/releases/3.0.html 107 kB +1.24 kB (+1.17%)
website/build/blog/releases/3.1.html 54.4 kB +1.08 kB (+2.03%)
website/build/blog/releases/3.2.html 50.1 kB +1.01 kB (+2.05%)
website/build/blog/releases/3.3.html 57.2 kB +1.01 kB (+1.79%)
website/build/blog/releases/3.4.html 56.3 kB +989 B (+1.79%)
website/build/blog/releases/3.5.html 59.2 kB +1.18 kB (+2.03%)
website/build/blog/releases/3.6.html 77.3 kB +1.05 kB (+1.37%)
website/build/blog/releases/3.7.html 51.8 kB +1.01 kB (+1.98%)
website/build/blog/releases/3.8.html 86.7 kB +1.05 kB (+1.23%)
website/build/blog/releases/3.9.html 61.8 kB +1.03 kB (+1.69%)
website/build/blog/releases/3.10.html 91.5 kB +989 B (+1.09%)
website/build/blog/tags.html 28.6 kB +1.14 kB (+4.16%)
website/build/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing.html 124 kB +951 B (+0.77%)
website/build/docs.html 51.4 kB +627 B (+1.23%)
website/build/docs/advanced.html 31.3 kB +760 B (+2.49%)
website/build/docs/advanced/architecture.html 29.9 kB +688 B (+2.36%)
website/build/docs/advanced/client.html 69 kB +780 B (+1.14%)
website/build/docs/advanced/plugins.html 54.5 kB +799 B (+1.49%)
website/build/docs/advanced/routing.html 69.5 kB +799 B (+1.16%)
website/build/docs/advanced/ssg.html 73.6 kB +780 B (+1.07%)
website/build/docs/api/docusaurus-config.html 231 kB +836 B (+0.36%)
website/build/docs/api/misc/@docusaurus/eslint-plugin.html 50.3 kB +741 B (+1.5%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/no-html-links.html 36.1 kB +704 B (+1.99%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/no-untranslated-text.html 35.2 kB +723 B (+2.1%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading.html 36.4 kB +704 B (+1.97%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/string-literal-i18n-messages.html 40 kB +723 B (+1.84%)
website/build/docs/api/misc/@docusaurus/logger.html 38.6 kB +571 B (+1.5%)
website/build/docs/api/misc/create-docusaurus.html 37.5 kB +597 B (+1.62%)
website/build/docs/api/plugin-methods.html 61.6 kB +655 B (+1.07%)
website/build/docs/api/plugin-methods/extend-infrastructure.html 58.5 kB +609 B (+1.05%)
website/build/docs/api/plugin-methods/i18n-lifecycles.html 56.9 kB +628 B (+1.12%)
website/build/docs/api/plugin-methods/lifecycle-apis.html 158 kB +666 B (+0.42%)
website/build/docs/api/plugin-methods/static-methods.html 44.3 kB +609 B (+1.39%)
website/build/docs/api/plugins.html 32.5 kB +1.03 kB (+3.26%)
website/build/docs/api/plugins/@docusaurus/plugin-client-redirects.html 58.9 kB +818 B (+1.41%)
website/build/docs/api/plugins/@docusaurus/plugin-content-blog.html 182 kB +973 B (+0.54%)
website/build/docs/api/plugins/@docusaurus/plugin-content-docs.html 189 kB +1.06 kB (+0.57%)
website/build/docs/api/plugins/@docusaurus/plugin-content-pages.html 73.5 kB +913 B (+1.26%)
website/build/docs/api/plugins/@docusaurus/plugin-css-cascade-layers.html 46.8 kB +837 B (+1.82%)
website/build/docs/api/plugins/@docusaurus/plugin-debug.html 47.4 kB +856 B (+1.84%)
website/build/docs/api/plugins/@docusaurus/plugin-google-gtag.html 48.4 kB +837 B (+1.76%)
website/build/docs/api/plugins/@docusaurus/plugin-google-tag-manager.html 47.2 kB +856 B (+1.85%)
website/build/docs/api/plugins/@docusaurus/plugin-ideal-image.html 56.5 kB +802 B (+1.44%)
website/build/docs/api/plugins/@docusaurus/plugin-pwa.html 115 kB +818 B (+0.72%)
website/build/docs/api/plugins/@docusaurus/plugin-rsdoctor.html 40 kB +799 B (+2.04%)
website/build/docs/api/plugins/@docusaurus/plugin-sitemap.html 64.8 kB +894 B (+1.4%)
website/build/docs/api/plugins/@docusaurus/plugin-svgr.html 45 kB +837 B (+1.89%)
website/build/docs/api/plugins/@docusaurus/plugin-vercel-analytics.html 40.3 kB +799 B (+2.02%)
website/build/docs/api/themes.html 29.9 kB +723 B (+2.48%)
website/build/docs/api/themes/@docusaurus/theme-classic.html 43.1 kB +704 B (+1.66%)
website/build/docs/api/themes/@docusaurus/theme-live-codeblock.html 36.2 kB +647 B (+1.82%)
website/build/docs/api/themes/@docusaurus/theme-mermaid.html 35 kB +647 B (+1.88%)
website/build/docs/api/themes/@docusaurus/theme-search-algolia.html 32.9 kB +646 B (+2%)
website/build/docs/api/themes/configuration.html 247 kB +837 B (+0.34%)
website/build/docs/blog.html 199 kB +1.03 kB (+0.52%)
website/build/docs/browser-support.html 47.5 kB +842 B (+1.81%)
website/build/docs/category/getting-started.html 28.1 kB +646 B (+2.35%)
website/build/docs/category/guides.html 38.9 kB +1.1 kB (+2.92%)
website/build/docs/category/miscellaneous.html 27.9 kB +646 B (+2.37%)
website/build/docs/cli.html 65.8 kB +608 B (+0.93%)
website/build/docs/configuration.html 90.6 kB +722 B (+0.8%)
website/build/docs/create-doc.html 61.1 kB +1.08 kB (+1.81%)
website/build/docs/creating-pages.html 56.7 kB +913 B (+1.64%)
website/build/docs/deployment.html 66 kB +1.12 kB (+1.73%)
website/build/docs/deployment/github-pages.html 117 kB +912 B (+0.79%)
website/build/docs/deployment/netlify.html 38.8 kB +912 B (+2.41%)
website/build/docs/deployment/vercel.html 33 kB +912 B (+2.84%)
website/build/docs/docs-introduction.html 50.3 kB +1.03 kB (+2.08%)
website/build/docs/docs-multi-instance.html 72.8 kB +1.05 kB (+1.46%)
website/build/docs/docusaurus-core.html 220 kB +590 B (+0.27%)
website/build/docs/guides/whats-next.html 33.2 kB +1.16 kB (+3.61%)
website/build/docs/i18n/crowdin.html 144 kB +939 B (+0.66%)
website/build/docs/i18n/git.html 78.4 kB +977 B (+1.26%)
website/build/docs/i18n/introduction.html 49.2 kB +1.04 kB (+2.17%)
website/build/docs/i18n/tutorial.html 165 kB +1.2 kB (+0.73%)
website/build/docs/installation.html 68.6 kB +779 B (+1.15%)
website/build/docs/markdown-features.html 84.3 kB +1.22 kB (+1.47%)
website/build/docs/markdown-features/admonitions.html 115 kB +1.1 kB (+0.97%)
website/build/docs/markdown-features/assets.html 85.6 kB +1.1 kB (+1.31%)
website/build/docs/markdown-features/code-blocks.html 214 kB +1.16 kB (+0.54%)
website/build/docs/markdown-features/diagrams.html 54.4 kB +1.06 kB (+2%)
website/build/docs/markdown-features/head-metadata.html 50.9 kB +1.1 kB (+2.22%)
website/build/docs/markdown-features/links.html 41 kB +1.12 kB (+2.81%)
website/build/docs/markdown-features/math-equations.html 90.1 kB +1.06 kB (+1.2%)
website/build/docs/markdown-features/plugins.html 94.5 kB +1.1 kB (+1.18%)
website/build/docs/markdown-features/react.html 131 kB +1.2 kB (+0.92%)
website/build/docs/markdown-features/tabs.html 137 kB +1.08 kB (+0.79%)
website/build/docs/markdown-features/toc.html 85.9 kB +1.16 kB (+1.37%)
website/build/docs/migration.html 38.9 kB +628 B (+1.64%)
website/build/docs/migration/v2.html 39.3 kB +742 B (+1.93%)
website/build/docs/migration/v2/automated.html 39.6 kB +704 B (+1.81%)
website/build/docs/migration/v2/manual.html 186 kB +837 B (+0.45%)
website/build/docs/migration/v2/translated-sites.html 50.5 kB +742 B (+1.49%)
website/build/docs/migration/v2/versioned-sites.html 59.3 kB +723 B (+1.23%)
website/build/docs/migration/v3.html 187 kB +838 B (+0.45%)
website/build/docs/playground.html 31.5 kB +570 B (+1.85%)
website/build/docs/search.html 122 kB +894 B (+0.74%)
website/build/docs/seo.html 87.3 kB +1.18 kB (+1.37%)
website/build/docs/sidebar.html 137 kB +1.08 kB (+0.8%)
website/build/docs/sidebar/autogenerated.html 144 kB +1.05 kB (+0.73%)
website/build/docs/sidebar/items.html 172 kB +1.22 kB (+0.71%)
website/build/docs/sidebar/multiple-sidebars.html 61.5 kB +1.06 kB (+1.76%)
website/build/docs/static-assets.html 51.5 kB +856 B (+1.69%)
website/build/docs/styling-layout.html 137 kB +878 B (+0.64%)
website/build/docs/swizzling.html 109 kB +1.01 kB (+0.93%)
website/build/docs/typescript-support.html 66.3 kB +674 B (+1.03%)
website/build/docs/using-plugins.html 104 kB +1.33 kB (+1.3%)
website/build/docs/versioning.html 91 kB +1.1 kB (+1.23%)
website/build/index.html 36.2 kB +342 B (+0.95%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 29 kB
website/.docusaurus/globalData.json 38.9 kB
website/.docusaurus/i18n.json 1.36 kB
website/.docusaurus/registry.js 179 kB
website/.docusaurus/routes.js 89.3 kB
website/.docusaurus/routesChunkNames.json 93.5 kB
website/.docusaurus/site-metadata.json 2.55 kB
website/build/assets/css/styles.********.css 146 kB
website/build/assets/js/runtime~main.********.js 39.9 kB
website/build/docs/api/misc/docusaurus-init/index.html 361 B
website/build/docs/introduction/index.html 280 B
website/build/docs/resources/index.html 325 B
website/build/docs/support/index.html 319 B
website/build/docs/team/index.html 310 B

compressed-size-action::DOCUSAURUS_INFRA_FASTER

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 45 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🟠 55 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 64 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 66 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 66 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 66 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 63 🟢 100 🟢 100 🟠 86 Report

@netlify

netlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

[V2]

Name Link
🔨 Latest commit cff34fa
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a357789b489a40008019ce4
😎 Deploy Preview https://deploy-preview-12190--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

[V2]

Name Link
🔨 Latest commit 26c51a7
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a35889ec647010008b48c34
😎 Deploy Preview https://deploy-preview-12190--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Size Change: +169 kB (+1.36%)

Total Size: 12.6 MB

📦 View Changed
Filename Size Change
website/build/assets/js/main.********.js 749 kB +14.5 kB (+1.98%)
website/build/blog.html 81.9 kB +1.6 kB (+1.99%)
website/build/blog/2017/12/14/introducing-docusaurus.html 68.9 kB +1.07 kB (+1.58%)
website/build/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus.html 48 kB +1.03 kB (+2.19%)
website/build/blog/2018/09/11/Towards-Docusaurus-2.html 52.5 kB +1.03 kB (+2.01%)
website/build/blog/2018/12/14/Happy-First-Birthday-Slash.html 31.9 kB +1.05 kB (+3.4%)
website/build/blog/2019/12/30/docusaurus-2019-recap.html 43.2 kB +1.05 kB (+2.5%)
website/build/blog/2020/01/07/tribute-to-endi.html 35.5 kB +1.07 kB (+3.11%)
website/build/blog/2021/01/19/docusaurus-2020-recap.html 54.8 kB +1.05 kB (+1.96%)
website/build/blog/2021/03/09/releasing-docusaurus-i18n.html 50.7 kB +1.07 kB (+2.16%)
website/build/blog/2021/05/12/announcing-docusaurus-two-beta.html 51.5 kB +1.2 kB (+2.38%)
website/build/blog/2021/11/21/algolia-docsearch-migration.html 57.8 kB +1.05 kB (+1.85%)
website/build/blog/2022/01/24/docusaurus-2021-recap.html 46.7 kB +1.18 kB (+2.58%)
website/build/blog/2022/08/01/announcing-docusaurus-2.0.html 139 kB +1.49 kB (+1.08%)
website/build/blog/2022/09/01/docusaurus-2.1.html 53.7 kB +1.09 kB (+2.08%)
website/build/blog/archive.html 26.2 kB +945 B (+3.75%)
website/build/blog/authors.html 53.9 kB +1.2 kB (+2.27%)
website/build/blog/authors/j-marcey.html 75 kB +1.95 kB (+2.67%)
website/build/blog/authors/josh-cena.html 50.5 kB +1.47 kB (+3%)
website/build/blog/authors/lex-111.html 59.7 kB +1.57 kB (+2.71%)
website/build/blog/authors/slorber.html 85.6 kB +1.66 kB (+1.98%)
website/build/blog/authors/slorber/page/2.html 84.9 kB +1.68 kB (+2.02%)
website/build/blog/authors/slorber/page/3.html 88.5 kB +1.64 kB (+1.89%)
website/build/blog/authors/slorber/page/4.html 102 kB +1.97 kB (+1.98%)
website/build/blog/authors/slorber/page/5.html 56.9 kB +1.26 kB (+2.27%)
website/build/blog/authors/yangshun.html 70.7 kB +1.68 kB (+2.43%)
website/build/blog/authors/zpao.html 50.8 kB +1.32 kB (+2.67%)
website/build/blog/page/2.html 81.1 kB +1.62 kB (+2.03%)
website/build/blog/page/3.html 85.5 kB +1.57 kB (+1.88%)
website/build/blog/page/4.html 90.2 kB +1.81 kB (+2.04%)
website/build/blog/page/5.html 77.2 kB +1.7 kB (+2.25%)
website/build/blog/page/6.html 44 kB +1.39 kB (+3.25%)
website/build/blog/preparing-your-site-for-docusaurus-v3.html 132 kB +1.2 kB (+0.92%)
website/build/blog/releases/2.2.html 53.9 kB +1.14 kB (+2.15%)
website/build/blog/releases/2.3.html 64.6 kB +1.22 kB (+1.92%)
website/build/blog/releases/2.4.html 68.2 kB +1.11 kB (+1.66%)
website/build/blog/releases/3.0.html 111 kB +1.37 kB (+1.24%)
website/build/blog/releases/3.1.html 56.7 kB +1.2 kB (+2.16%)
website/build/blog/releases/3.2.html 52.4 kB +1.11 kB (+2.17%)
website/build/blog/releases/3.3.html 59.6 kB +1.11 kB (+1.9%)
website/build/blog/releases/3.4.html 58.8 kB +1.09 kB (+1.9%)
website/build/blog/releases/3.5.html 61.7 kB +1.3 kB (+2.16%)
website/build/blog/releases/3.6.html 80.4 kB +1.16 kB (+1.46%)
website/build/blog/releases/3.7.html 54.3 kB +1.11 kB (+2.1%)
website/build/blog/releases/3.8.html 90 kB +1.16 kB (+1.31%)
website/build/blog/releases/3.9.html 64.4 kB +1.14 kB (+1.79%)
website/build/blog/releases/3.10.html 94.9 kB +1.09 kB (+1.16%)
website/build/blog/tags.html 30.4 kB +1.26 kB (+4.32%)
website/build/blog/upgrading-frontend-dependencies-with-confidence-using-visual-regression-testing.html 128 kB +1.05 kB (+0.83%)
website/build/docs.html 53.5 kB +693 B (+1.31%)
website/build/docs/advanced.html 32.9 kB +840 B (+2.62%)
website/build/docs/advanced/architecture.html 31.5 kB +760 B (+2.48%)
website/build/docs/advanced/client.html 71.8 kB +862 B (+1.22%)
website/build/docs/advanced/plugins.html 56.7 kB +883 B (+1.58%)
website/build/docs/advanced/routing.html 72.2 kB +883 B (+1.24%)
website/build/docs/advanced/ssg.html 76.8 kB +862 B (+1.14%)
website/build/docs/api/docusaurus-config.html 240 kB +924 B (+0.39%)
website/build/docs/api/misc/@docusaurus/eslint-plugin.html 52.7 kB +819 B (+1.58%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/no-html-links.html 38.1 kB +778 B (+2.09%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/no-untranslated-text.html 37 kB +799 B (+2.2%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading.html 38.3 kB +778 B (+2.08%)
website/build/docs/api/misc/@docusaurus/eslint-plugin/string-literal-i18n-messages.html 42 kB +799 B (+1.94%)
website/build/docs/api/misc/@docusaurus/logger.html 40.3 kB +631 B (+1.59%)
website/build/docs/api/misc/create-docusaurus.html 39.3 kB +659 B (+1.7%)
website/build/docs/api/plugin-methods.html 64.1 kB +723 B (+1.14%)
website/build/docs/api/plugin-methods/extend-infrastructure.html 60.9 kB +673 B (+1.12%)
website/build/docs/api/plugin-methods/i18n-lifecycles.html 59.1 kB +694 B (+1.19%)
website/build/docs/api/plugin-methods/lifecycle-apis.html 163 kB +736 B (+0.45%)
website/build/docs/api/plugin-methods/static-methods.html 46.3 kB +673 B (+1.48%)
website/build/docs/api/plugins.html 34.2 kB +1.13 kB (+3.43%)
website/build/docs/api/plugins/@docusaurus/plugin-client-redirects.html 61.7 kB +904 B (+1.49%)
website/build/docs/api/plugins/@docusaurus/plugin-content-blog.html 190 kB +1.07 kB (+0.57%)
website/build/docs/api/plugins/@docusaurus/plugin-content-docs.html 197 kB +1.18 kB (+0.6%)
website/build/docs/api/plugins/@docusaurus/plugin-content-pages.html 77.3 kB +1.01 kB (+1.32%)
website/build/docs/api/plugins/@docusaurus/plugin-css-cascade-layers.html 49 kB +925 B (+1.92%)
website/build/docs/api/plugins/@docusaurus/plugin-debug.html 49.6 kB +946 B (+1.94%)
website/build/docs/api/plugins/@docusaurus/plugin-google-gtag.html 50.7 kB +925 B (+1.86%)
website/build/docs/api/plugins/@docusaurus/plugin-google-tag-manager.html 49.5 kB +946 B (+1.95%)
website/build/docs/api/plugins/@docusaurus/plugin-ideal-image.html 59.2 kB +886 B (+1.52%)
website/build/docs/api/plugins/@docusaurus/plugin-pwa.html 120 kB +904 B (+0.76%)
website/build/docs/api/plugins/@docusaurus/plugin-rsdoctor.html 42.1 kB +883 B (+2.14%)
website/build/docs/api/plugins/@docusaurus/plugin-sitemap.html 67.7 kB +988 B (+1.48%)
website/build/docs/api/plugins/@docusaurus/plugin-svgr.html 47.2 kB +925 B (+2%)
website/build/docs/api/plugins/@docusaurus/plugin-vercel-analytics.html 42.4 kB +883 B (+2.12%)
website/build/docs/api/themes.html 31.4 kB +799 B (+2.61%)
website/build/docs/api/themes/@docusaurus/theme-classic.html 45.2 kB +778 B (+1.75%)
website/build/docs/api/themes/@docusaurus/theme-live-codeblock.html 38 kB +715 B (+1.92%)
website/build/docs/api/themes/@docusaurus/theme-mermaid.html 36.8 kB +715 B (+1.98%)
website/build/docs/api/themes/@docusaurus/theme-search-algolia.html 34.6 kB +714 B (+2.11%)
website/build/docs/api/themes/configuration.html 259 kB +925 B (+0.36%)
website/build/docs/blog.html 205 kB +1.14 kB (+0.56%)
website/build/docs/browser-support.html 49.8 kB +930 B (+1.9%)
website/build/docs/category/getting-started.html 29.6 kB +714 B (+2.47%)
website/build/docs/category/guides.html 40.7 kB +1.22 kB (+3.08%)
website/build/docs/category/miscellaneous.html 29.4 kB +714 B (+2.49%)
website/build/docs/cli.html 69.7 kB +672 B (+0.97%)
website/build/docs/configuration.html 94.2 kB +798 B (+0.85%)
website/build/docs/create-doc.html 63.7 kB +1.2 kB (+1.92%)
website/build/docs/creating-pages.html 59.2 kB +1.01 kB (+1.73%)
website/build/docs/deployment.html 68.8 kB +1.24 kB (+1.83%)
website/build/docs/deployment/github-pages.html 121 kB +1.01 kB (+0.84%)
website/build/docs/deployment/netlify.html 40.8 kB +1.01 kB (+2.53%)
website/build/docs/deployment/vercel.html 34.9 kB +1.01 kB (+2.98%)
website/build/docs/docs-introduction.html 52.7 kB +1.14 kB (+2.2%)
website/build/docs/docs-multi-instance.html 76.1 kB +1.16 kB (+1.54%)
website/build/docs/docusaurus-core.html 228 kB +652 B (+0.29%)
website/build/docs/guides/whats-next.html 35.1 kB +1.28 kB (+3.79%)
website/build/docs/i18n/crowdin.html 149 kB +1.04 kB (+0.7%)
website/build/docs/i18n/git.html 81.8 kB +1.08 kB (+1.34%)
website/build/docs/i18n/introduction.html 51.5 kB +1.16 kB (+2.3%)
website/build/docs/i18n/tutorial.html 172 kB +1.32 kB (+0.78%)
website/build/docs/installation.html 71.6 kB +861 B (+1.22%)
website/build/docs/markdown-features.html 87.5 kB +1.35 kB (+1.56%)
website/build/docs/markdown-features/admonitions.html 120 kB +1.22 kB (+1.03%)
website/build/docs/markdown-features/assets.html 89.6 kB +1.22 kB (+1.38%)
website/build/docs/markdown-features/code-blocks.html 223 kB +1.28 kB (+0.58%)
website/build/docs/markdown-features/diagrams.html 57 kB +1.18 kB (+2.11%)
website/build/docs/markdown-features/head-metadata.html 53.3 kB +1.22 kB (+2.34%)
website/build/docs/markdown-features/links.html 43.1 kB +1.24 kB (+2.96%)
website/build/docs/markdown-features/math-equations.html 94.1 kB +1.18 kB (+1.27%)
website/build/docs/markdown-features/plugins.html 98.3 kB +1.22 kB (+1.26%)
website/build/docs/markdown-features/react.html 137 kB +1.32 kB (+0.98%)
website/build/docs/markdown-features/tabs.html 144 kB +1.2 kB (+0.84%)
website/build/docs/markdown-features/toc.html 89.6 kB +1.28 kB (+1.45%)
website/build/docs/migration.html 40.9 kB +694 B (+1.73%)
website/build/docs/migration/v2.html 41.2 kB +820 B (+2.03%)
website/build/docs/migration/v2/automated.html 41.6 kB +778 B (+1.9%)
website/build/docs/migration/v2/manual.html 193 kB +925 B (+0.48%)
website/build/docs/migration/v2/translated-sites.html 52.8 kB +820 B (+1.58%)
website/build/docs/migration/v2/versioned-sites.html 61.7 kB +799 B (+1.31%)
website/build/docs/migration/v3.html 194 kB +926 B (+0.48%)
website/build/docs/playground.html 33.1 kB +630 B (+1.94%)
website/build/docs/search.html 126 kB +988 B (+0.79%)
website/build/docs/seo.html 91.2 kB +1.3 kB (+1.45%)
website/build/docs/sidebar.html 143 kB +1.2 kB (+0.84%)
website/build/docs/sidebar/autogenerated.html 149 kB +1.16 kB (+0.78%)
website/build/docs/sidebar/items.html 178 kB +1.34 kB (+0.76%)
website/build/docs/sidebar/multiple-sidebars.html 64.5 kB +1.18 kB (+1.86%)
website/build/docs/static-assets.html 54 kB +946 B (+1.78%)
website/build/docs/styling-layout.html 143 kB +970 B (+0.68%)
website/build/docs/swizzling.html 114 kB +1.11 kB (+0.99%)
website/build/docs/typescript-support.html 69.1 kB +744 B (+1.09%)
website/build/docs/using-plugins.html 108 kB +1.47 kB (+1.38%)
website/build/docs/versioning.html 94.8 kB +1.22 kB (+1.3%)
website/build/index.html 37.9 kB +378 B (+1.01%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 29 kB
website/.docusaurus/globalData.json 38.9 kB
website/.docusaurus/i18n.json 1.36 kB
website/.docusaurus/registry.js 179 kB
website/.docusaurus/routes.js 89.3 kB
website/.docusaurus/routesChunkNames.json 93.5 kB
website/.docusaurus/site-metadata.json 2.4 kB
website/build/assets/css/styles.********.css 138 kB
website/build/assets/js/runtime~main.********.js 39.7 kB
website/build/docs/api/misc/docusaurus-init/index.html 361 B
website/build/docs/introduction/index.html 280 B
website/build/docs/resources/index.html 325 B
website/build/docs/support/index.html 319 B
website/build/docs/team/index.html 310 B

compressed-size-action::DOCUSAURUS_INFRA_SLOWER

POC migrating Docusaurus from react-router v5 to react-router v8, and from
the bundled history v4 to the standalone history package v5 (latest versions).

The bulk of the work is the v5 → v6 jump (react-router-config removed,
controlled `<Route location>` removed, `NavLink` `isActive`/`activeClassName`
removed, no more exposed `history` object / `useHistory`). v6 → v7 → v8 are
mostly package consolidation (`react-router-dom` merged into `react-router`,
then dropped) plus ESM-only / Node 22+ / React 19+ requirements.

Key changes:
- Reimplement `react-router-config`'s `renderRoutes` as a small `<Switch>`-like
  component (string-based, recursive, first-match-wins route config), and keep
  a thin v5-compatible `matchPath`/`matchRoutes` built on top of React Router's
  own `matchPath` (so we don't hand-roll path matching). React Router v8 is
  ESM-only, so the CommonJS broken-links checker loads `matchPath` via a dynamic
  `import('react-router')`.
- Drive react-router with a `history`-package instance through the low-level
  `<Router navigator={history}>` (replaces `BrowserRouter`/`HashRouter`/
  `StaticRouter` and the removed `unstable_HistoryRouter`); `@docusaurus/router`
  `useHistory()` returns it so history blocking/listening/querystring helpers
  keep working.
- Replace the controlled `<Route location>` trick used by `PendingNavigation`
  with a location-override React context.
- Reimplement Docusaurus `<Link>`/NavLink active behavior
  (`isActive`/`activeClassName`/`activeStyle`) on top of react-router's
  `<Link>` + `useLocation`/`matchPath`.
- `Redirect` → `Navigate` compatibility shim; adapt `historyUtils` to
  history v5's new `block()` transition API.

Not done (POC scope): full type-safety polish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@slorber slorber force-pushed the slorber/react-router-v8 branch from 111b179 to eb15b22 Compare June 19, 2026 18:17
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