Skip to content

perf(console-ui): refresh TanStack Router and Query - #2555

Open
malinskibeniamin wants to merge 3 commits into
masterfrom
ben-malinski/no-ticket/tanstack-router-query
Open

perf(console-ui): refresh TanStack Router and Query#2555
malinskibeniamin wants to merge 3 commits into
masterfrom
ben-malinski/no-ticket/tanstack-router-query

Conversation

@malinskibeniamin

@malinskibeniamin malinskibeniamin commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refresh the TanStack Router and Query stack to the latest stable versions allowed by the repository's 72-hour release-age gate.
  • Share one Router plugin configuration between Rsbuild and Vitest, ignore test/helper route files, and emit a stable async lib-tanstack vendor chunk.
  • Enable intent preloading with defaultPreloadStaleTime: 0, leaving TanStack Query responsible for cache freshness.
  • Wire the existing pending and error route boundaries into standalone and embedded routers; announce the pending state with native status semantics.
  • Adapt the only affected getMatchedRoutes call site to Router 1.170.22's tuple return and cover it with a regression test.

Proven impact

Metric Before (origin/master) After (d7a4b6bc7) Delta
Production JavaScript gzip 11,551,032 B 11,524,694 B -26,338 B (-0.23%)
Production JavaScript files 562 557 -5

Value proven: Router/Query now use a cacheable async TanStack chunk without increasing the production JavaScript payload.

Method: one paired bun run build-local-test build per ref on the same machine; gzip level 9 summed across emitted JavaScript files.

Why

This keeps Router responsible for navigation and route boundaries while Query owns server-cache freshness. It also restores compatibility with the current Router API and refreshes the original PR on current master.

Out of scope: unrelated TanStack packages, existing repository-wide audit findings, and visible design changes.

Commits

  • 06613049d build(console-ui): upgrade tanstack query to 5.101.2
  • 1ba4ca9fd perf(console-ui): tune tanstack router integration
  • d7a4b6bc7 chore(console-ui): refresh tanstack router and query

Reviewer guide

  1. Start with frontend/tanstack-router.config.ts and frontend/rsbuild.config.ts.
  2. Review runtime defaults in frontend/src/router-defaults.ts, then both router entrypoints.
  3. Review the Router 1.170.22 migration in frontend/src/components/layout/header.tsx.
  4. Treat frontend/src/routeTree.gen.ts as generated churn: all 128 route IDs, paths, and full paths are unchanged.

Screenshots / surface review

View Before After Notes
Route pending state Existing spinner and “Loading...” copy Visually unchanged Screenshot skipped: copy, classes, and layout are unchanged; only native status semantics changed.

Dogfood evidence

  • Verdict: PASS
  • Entrypoint: bun run preview -- --host 127.0.0.1 --port 4173
  • Actions: Opened Overview and SQL through the production build, rapidly navigated Topics → Overview, then reloaded.
  • Observations: SQL rendered its own title bar without a duplicate app title; Overview recovered after rapid navigation and reload; expected missing-backend 504 errors stayed contained to unavailable data.
  • Repairs and replay: Updated getMatchedRoutes tuple handling, added a red-green regression test, rebuilt, and replayed successfully.
  • Limits: No live Redpanda backend was attached; API-dependent data remained unavailable.

Dependency upgrade path

  • Packages: @tanstack/react-query 5.99.2 → 5.101.4; @tanstack/react-query-devtools 5.90.2 → 5.101.4; @tanstack/react-router 1.170.7 (1.170.17 locked) → 1.170.22; @tanstack/react-router-devtools 1.167.0 → 1.167.1; @tanstack/router-plugin 1.168.19 → 1.168.27.
  • Upgrade evidence: Query 5.101.3–5.101.4 are dependency-only patches. Router 1.170.19 rewrote match loading and changed getMatchedRoutes; the repository's single affected call site was migrated.
  • SemVer confidence: Same-major updates. Official Query and Router changelogs reviewed; full type, test, build, and entrypoint verification passed.
  • Risk gate: Applied the newest versions published before the 72-hour cutoff. Router 1.170.23+ and router-plugin 1.168.28+ remain gated.
  • Security notes: bun audit reports the same existing 49 advisories on origin/master and this branch (26 high, 19 moderate, 4 low); this upgrade introduces none.

Test plan

  • bun install --frozen-lockfile --ignore-scripts
  • Ultracite check on new and Router configuration files
  • bun run type:check
  • bun run test — 56 unit files / 784 unit tests plus the full integration suite
  • bun run build-local-test
  • Generated route-tree invariant check — 128 IDs, paths, and full paths unchanged
  • Paired production bundle comparison
  • Baseline/candidate bun audit comparison

🤖 Generated with OpenAI Codex

malinskibeniamin and others added 2 commits July 14, 2026 16:13
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
@malinskibeniamin malinskibeniamin added the performance Performance is one of the concerns label Jul 14, 2026
@malinskibeniamin malinskibeniamin self-assigned this Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Clean — no registry drift, off-token colours, or ad-hoc classes

App: frontend · Scope: diff vs origin/master · Files: 12

Count
⚠️ Outdated registry components 0
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0

Generated by lookout audit-changes.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 10, 2026, 12:52 PM

@malinskibeniamin malinskibeniamin changed the title perf(console-ui): tune TanStack Router and Query perf(console-ui): refresh TanStack Router and Query Aug 10, 2026
@malinskibeniamin
malinskibeniamin marked this pull request as ready for review August 10, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant