Repository navigation
Conversation
firsttris
marked this pull request as ready for review
November 4, 2026 12:36
@tanstack/redact 0.3.1 (pinned exactly) is a React-19-compatible runtime; its Vite plugin (redact() after react() in web/vite.config.ts) points the react and react-dom imports at it, so the code stays unchanged. Initial JS shrinks from 171.3 to 128.4 kB gzip, all client JS from 589.0 to 545.5 kB. Redact renders synchronously; the app uses no useTransition, useDeferredValue, Suspense or class components. createPortal (the map's header slot) and the Radix dialogs work in the e2e tests and by hand. Known gap in 0.3.1: SVG attributes outside clip*/fill*/stroke* (textAnchor, vectorEffect) reach the DOM in camelCase and have no effect (src/core/attributes.ts, attributeName()). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3rdfbVn9WQaWcUTzwvU2s
TanStack Redact 0.3.1 hyphenates only clip*, fill* and stroke* attributes (attributeName() in src/core/attributes.ts): textAnchor and vectorEffect reached the DOM in camelCase and did nothing, so the compass letters and the rose's labels sat off centre and the sparklines' strokes scaled with the viewBox. As style (web/src/ui/svg-style.ts) both work the same under React and Redact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y3rdfbVn9WQaWcUTzwvU2s
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.
What and why
Runs the web app on TanStack Redact (
@tanstack/redact, pinned to exactly0.3.1) instead of React. Redact implements the React 19 API, so the code keeps importingreactandreact-dom; the Vite pluginredact()(afterreact()inweb/vite.config.ts) points those imports at the smaller runtime when building and invite dev. No TanStack Start here, so nossr.noExternalis needed.docs/architecture.mdsays so in one paragraph.A Redact 0.3.1 bug lost SVG
text-anchorandvector-effect. The second commit fixes it in the app, so it works the same under React and Redact (see risks).Size (gzip -9, production build)
index.html)dist/assets/*.js)index-*.jsaloneThe initial set now has more, smaller modulepreloads (Rolldown split the chunks differently), the sum is what counts. The map chunk (MapLibre, 324 kB) stays as it is.
Checks
bun run lintbun run typecheckbun run test(Vitest)bun run buildbun run e2e, React (baseline onmain)bun run e2e, Redacttext-anchor/vector-effectin Chromium, React and Redact buildsvite devwith Redact, start page in Chromium@tanstack/redact, no page errors (the API was not running: 502s only)mkdocs build --strictcargo fmt --all --checkcargo build -p windfenstercargo clippy,cargo testThe e2e ran locally on other ports (48xx) through an uncommitted change to the config.
Risks found
attributeName()insrc/core/attributes.tshyphenates camelCase SVG attributes only when they start withclip,fillorstroke. Everything else got to the DOM in camelCase and did nothing. With React,<text>on/station/edsbcarriedtext-anchor(computedmiddle); with Redact it carriedtextAnchor(computedstart), so the labels slid to the right. Affected:textAnchor:web/src/ui/wind-compass.tsx(the compass letters and the centre value),web/src/components/live/stats-card.tsx(two places),web/src/components/favorite.tsx;vectorEffect="non-scaling-stroke":web/src/components/water-tile.tsx,web/src/components/map/measured-spark.tsx.style(TEXT_CENTREDandNON_SCALING_STROKEin the newweb/src/ui/svg-style.ts, with the reason in a comment). React and Redact both write that asstyle="text-anchor: middle"/style="vector-effect: non-scaling-stroke"./station/edsball 9 centred labels compute totext-anchor: middleand no camelCase attribute is left. The rose's ring labels compute tostartin both builds because they never had an anchor. On the map's spot card (/map?spot=…&station=edsb), the measured sparkline computes tovector-effect: non-scaling-stroke. The water tile's level line uses the same constant; the stand-in has no level history, so it does not draw there.strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray(including lucide icons) were fine all along. A grep finds no other camelCase SVG attributes (dominantBaseline,stopColor,fontSize, …).useTransition,useDeferredValue,startTransition,Suspense, class components orflushSync.useSyncExternalStore(prefs, media query) is supported.createPortal(web/src/components/header-slot.tsx, the map's model and layer pills in the header): checked by hand, the pills are in the header on a wide window and back on the map on a narrow one;map.spec.tsalso covers the map.web/src/ui/dialog.tsx):account.spec.tsopens the spot and alarm dialogs; by hand the search dialog opens with Ctrl+K, takes the focus, lists results and closes with Escape.Roll back
Remove
redact()(and its import) fromweb/vite.config.ts, thenbun remove --cwd web @tanstack/redact. The app code needs no change.Generated by Claude Code