Skip to content

Build the web UI on TanStack Redact - #31

Merged
firsttris merged 1 commit into
mainfrom
redact
Nov 4, 2026
Merged

firsttris merged 1 commit into
mainfrom
redact

Conversation

@firsttris

Copy link
Copy Markdown
Owner

What and why

The web UI now runs on TanStack Redact (@tanstack/redact, pinned exactly to 0.3.1), a smaller runtime with the React 19 API. The code doesn't change: it still imports from react. The redact() Vite plugin in web/vite.config.ts (placed after react()) points those imports at Redact, both in the build and in vite dev. react/react-dom stay as dependencies for the types, Vitest and Testing Library.

This app is a plain Vite single-page app (TanStack Router), not TanStack Start, so no ssr.noExternal setting is needed.

docs/development.md and the README mention Redact where they name the stack.

Release age: 0.3.1 was less than a day old, so the minimumReleaseAge rule in web/bunfig.toml was skipped once for this manual install, on the maintainer's instruction. bunfig.toml is unchanged, and bun install --frozen-lockfile passes without any flag, so CI is not affected.

Size (gzip -9, web/dist)

React 19 Redact Change
Initial JS (scripts and modulepreloads in index.html) 120,206 B 74,445 B −38 %
All client JS 180,860 B 134,814 B −25 %

Checks (run locally)

Check React (main) Redact (this branch)
bun run lint ✅ ✅
bun run typecheck ✅ ✅
bun run test (Vitest) ✅ 12/12 ✅ 12/12
bun run build ✅ ✅
bun run e2e (demo server, rebuilt with the new dist) ✅ 21/21 ✅ 21/21
bun run e2e:stack (server and two agents) ✅ 5/5 ✅ 5/5
vite dev: login, overview, opening a Select in the settings – ✅ no errors except the expected 401s before login
cargo fmt --check, cargo clippy -D warnings ✅
cargo test --workspace ✅, see the note below
mkdocs build --strict ✅

Note: crates/agent/tests/daemon.rs playing_on_after_loading_a_version_in_backup_mode_is_no_conflict failed twice during the full workspace run on a machine under heavy load. It passed when run on its own and when its test file was run again. This PR changes no Rust code, so the failure looks like timing flakiness.

Risks checked

Redact renders synchronously; transitions and deferred values do not run concurrently.

  • web/src uses none of useTransition, useDeferredValue, startTransition, Suspense, flushSync or createPortal, and has no class components (ApiError extends Error is the only class).
  • Radix portals are used in components/ui/dialog.tsx and components/ui/select.tsx. The e2e suites exercise both: the pairing dialog, and the language, mode, default-mode, prefix and target-PC selects.
  • @radix-ui/react-dropdown-menu, -switch and -tooltip are dependencies, but no component uses them right now.
  • Known bug in Redact 0.3.1: only SVG attributes starting with clip/fill/stroke are hyphenated. web/src has no inline SVG and no Radix Slider. The lucide icons use only stroke*/fill, so this app is not affected.

Rollback

Remove redact() and its import from web/vite.config.ts and drop @tanstack/redact from web/package.json (bun remove @tanstack/redact). The code itself needs no change.


Generated by Claude Code

The code keeps importing from "react"; the Vite plugin of @tanstack/redact (pinned exactly to
0.3.1) points those imports at Redact, a smaller runtime with the React 19 API
(https://github.com/TanStack/redact). Initial JS shrinks from 120.2 kB to 74.4 kB gzip, all
client JS from 180.9 kB to 134.8 kB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbVn9WQaWcUTzwvU2s
@firsttris
firsttris merged commit b3f2ec8 into main Nov 4, 2026
7 checks passed
@firsttris
firsttris deleted the redact branch November 4, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants