fix(ui): upgrade react-router 7 -> 8 (JEF-623) - #154
Merged
thejefflarson merged 1 commit intoJul 29, 2026
Merged
Conversation
Clears the repo's one HIGH Dependabot advisory (GHSA-qwww-vcr4-c8h2, a CSRF bypass in react-router, fixed >=8.3.0). The advisory fix is internal to react-router 8.3.0 -- no app-level CSRF handling is added here. v8 removes the `react-router-dom` package (all its exports were already re-exported unchanged from `react-router` since v7; only `RouterProvider`/`HydratedRouter`, which this app's declarative-mode router doesn't use, moved to `react-router/dom`). The only breaking change that touches this codebase is that import specifier, so the fix is a mechanical `react-router-dom` -> `react-router` swap across App.tsx, main.tsx, timerange.tsx, the route components (Alerts/LogView/MetricChart/MetricList/ServiceMap/Services/TraceList/ TraceWaterfall), and routes.a11y.test.tsx -- no source logic changed. `links.ts` doesn't import react-router at all, so its URL-building behavior (traceHref/logsHref) is untouched by construction. Closes JEF-623 Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
thejefflarson
deleted the
thejefflarson/jef-623-upgrade-react-router-78-to-clear-the-high-csrf-bypass
branch
July 29, 2026 02:31
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.
Summary
Clears the repo's one HIGH Dependabot advisory: react-router (GHSA-qwww-vcr4-c8h2), a CSRF bypass, vulnerable
>=7.12.0 <8.3.0and patched in8.3.0. The fix is internal to react-router 8.3.0 -- no app-level CSRF handling was added.What changed
ui/package.json/ui/package-lock.json:react-router-dom@^7.18.1->react-router@^8.3.0(react-router v8 drops thereact-router-dompackage entirely)."react-router-dom"->"react-router", acrossApp.tsx,main.tsx,timerange.tsx, the route components (Alerts,LogView,MetricChart,MetricList,ServiceMap,Services,TraceList,TraceWaterfall), androutes.a11y.test.tsx. No source logic changed.Why this is the only change needed
Checked the v8 upgrade guide/changelog against this app's actual usage:
react-router-dom. In v7,react-router-domwas justexport * from "react-router"plusRouterProvider/HydratedRouter(re-exported fromreact-router/dom) -- confirmed by inspecting the published package sources for both versions.BrowserRouter,MemoryRouter,Routes,Route,Navigate,NavLink,Link,useNavigate,useParams,useSearchParams) is exported directly fromreact-router@8.3.0's main entry point (verified against its published.d.ts).<BrowserRouter>/<Routes>/<Route>), not the data router (RouterProvider), so the one thing that actually moved toreact-router/domin v8 (RouterProvider/HydratedRouter) isn't used here.ui/src/links.ts(traceHref/logsHref) doesn't import react-router at all -- it's pure string building -- so deep-link URL behavior is untouched by construction, andlinks.test.tsstill passes unchanged.future.v8_*flag removal,@react-router/dev/Cloudflare-plugin/Architect changes) don't apply: this app already meets the React/Node baselines and doesn't use the dev-server/framework-mode tooling those flags gate.Test plan
npm ciresolves cleanly (updatedpackage-lock.jsoncommitted)npx tsc --noEmit-- cleannpm run build(tsc + vite build) -- cleannpx eslint .-- cleannpx vitest run-- 33/33 tests pass across 6 files, includinglinks.test.ts(byte-identicaltraceHref/logsHrefURLs, unmodified) androutes.a11y.test.tsx(all top-level routes render and pass the axe structural gate, unmodified)/simplifypass on all changed files: single-pass manual review (Agent tool unavailable in this subagent context) -- diff is a pure mechanical import-path swap, nothing to simplifypr-reviewgate: no Critical/High findings (this diff is the CSRF fix; no new logic was added)Closes JEF-623