feat(frontend): migrate react-router-dom v7 → react-router v8 - #494
Conversation
Resolves GHSA-qwww-vcr4-c8h2 (HIGH), which kept the dependency-graph security gate red on every PR. The advisory is an RSC-mode CSRF bypass; Checkstack runs a client-side SPA (<BrowserRouter>) and never uses RSC mode, so it was not exploitable here - but the fix ships only in the 8.x line, which the security auto-remediation deliberately refuses to reach (no major bumps), so it could never self-resolve. react-router-dom has no v8 (it was folded into react-router in v7), so this is a package swap, not a range bump: - 31 packages depend on react-router@^8.3.0 instead of react-router-dom@^7.16.0; 97 source files import from "react-router". - Module Federation host share + optimizeDeps + dedupe move to react-router (shared singleton requiredVersion ^8.0.0). Remotes never shared the router, so the remote contract is unchanged. - syncpack's unified-range group tracks react-router. - Docs code examples + the generated docs index updated. Every API Checkstack uses (BrowserRouter, MemoryRouter, Routes, Route, Link, NavLink, useLocation, useNavigate, useParams, useSearchParams) is exported by v8 unchanged, so no routing logic changed beyond the import specifier. v8 needs React >= 19.2.7, already pinned. Verified: typecheck, lint, syncpack, full unit suite (10,256 pass / 0 fail), frontend MF build, and a Trivy rescan confirming react-router is gone from the fixable set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hccsjzvqr6xfhGicNBjRgB
🦋 Changeset detectedLatest commit: 966e51e The changes in this PR will be included in the next version bump. This PR includes changesets to release 68 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Changeset Coverage IncompleteThe following packages have code changes but are not included in any changeset:
|
❌ PR Checks Failed
❌ Security Audit Failures (dependency graph)How to fix: This gate scans the whole dependency graph (incl. devDependencies) and fails only on findings with an upgrade path (a fixed version exists); unfixed findings are warnings, not gated. Run @enyineer The above code quality issues were found in this PR. Please fix them before merging. |
Unblocks the Security (dependency graph) gate, which is currently failing on every PR (#489, #490, #491, #492, #493).
Why #493 (and everything else) was failing
pr-checksonly runson: pull_request, so main is never scanned and three fixable vulns accumulated on it invisibly. Every PR then inherits them. I verified with Trivy that #493 introduces nothing — it actually fixestar.react-router 7.18.1 → 8.3.0(HIGH)pickInMajorFixdeliberately refuses major bumps, so it could never auto-resolve.tar 7.5.20 → 7.5.21(MEDIUM)brace-expansion 5.0.7 → 5.0.8(HIGH)minimumReleaseAge = 3 days(published 07-23 11:39Z). Self-heals; the daily security-maintenance job will pick it up.The advisory
GHSA-qwww-vcr4-c8h2 — "RSC Mode CSRF Bypass Allows Action Execution Before 400 Response". Checkstack runs a client-side SPA (
<BrowserRouter>) and does not use RSC mode, so it was not exploitable here — but it kept the gate permanently red.What changed
react-router-domhas no v8 (folded intoreact-routerin v7), so this is a package swap, not a range bump:react-router@^8.3.0; 97 source files import fromreact-router.shared/optimizeDeps/dedupemove toreact-router(singletonrequiredVersion: ^8.0.0). Remotes never shared the router → remote contract unchanged.react-router(preserving the single-range guarantee a past four-range regression motivated).dependency-linter.mdis left intact as history.Every API we use —
BrowserRouter,MemoryRouter,Routes,Route,Link,NavLink,useLocation,useNavigate,useParams,useSearchParams— is exported by v8 unchanged, so no routing logic changed beyond the import specifier. v8 requires React >= 19.2.7, already pinned.Verification
typecheck✓ ·lint✓ ·deps:check(syncpack) ✓ · docs-index ✓/checkstack/path returns the docs 404, not the SPA shell"), sidebarNavLinktargets, and the MF remote loading on the public status page.build:public-remotes(announcement remote) ✓react-routeris gone from the fixable setNot run: the
CHECKSTACK_ITintegration lane — this change is frontend-only (the sole backend edit is a code comment), so it is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01Hccsjzvqr6xfhGicNBjRgB