build: upgrade Vite+ to 1.3 and cache typecheck #22716
main fromrefs/pull/22716/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubvpr typecheck ran every package from scratch on every run, two at a time. That limit was set in June, before tsc-rs. We were also three minor versions behind on Vite+.
Fix#
- Bump
vite-plusandvite-plus-coreto 1.3.0, and@vitest/browser-playwrightto 5.0.5 (1.3 bundles Vitest 5.0.5). The 1.1 to 1.3 release notes list no breaking changes that affect us. 1.2 makes task cache keys independent of the install path, and fixes thevp configgit lock error in linked worktrees. - Root
typecheckandtcscripts now runvp run -r --cache --concurrency-limit 4 typecheck.--cacheapplies only to that run, so build, dev, and test stay uncached. - Vite+ does not cache a task that rewrites a file it also reads. Web and desktop (
tsconfig.tsbuildinfo) and marketing (.astro/*.d.ts) now definetypecheckas a task in theirvite.config.tswith that file excluded from the inputs. This is the only way to set inputs: rootrun.tasksapply to the root package only. Marketing gets avite.config.tsthat only holds this task. Knip no longer seesastro checkthere, so@astrojs/checkis in its ignore list. scriptsandoxlint-plugin-t3codealso write tsbuildinfo but stay plain scripts. They miss the cache once after their own files change (about 0.4 s and 0.1 s).- oxfmt 0.73 (bundled with 1.3) breaks long string unions in two
docs/orchestration-v2TypeScript blocks onto separate lines. Those files are reformatted here. - The bundled oxlint 1.88 now treats
new Date()as impure (oxc#26894) and also flags it inside event handlers (oxc#27309). This failed 11 call sites in apps/web. The React Compiler we ship (oxc-transform-react0.152.0) still compiles all 5 files with no bailouts, so I setreact/puritytowarnfor web instead of rewriting those sites.reactCompilerCoverage.test.tsstill fails on real bailouts. - CI does not keep
node_modules/.vite/task-cache, so CI typecheck still runs cold.
Related: #21603 (outside PR) bumps vite-plus to 1.2.0. It has conflicts and its CI did not run. This PR supersedes the version bump.
Evidence#
BeeBox, Linux x64, 16 cores. vpr typecheck, 32 packages.
| Run | Time | Cache hits |
|---|---|---|
| Before: no cache, limit 2 | 14.4 to 14.7 s | none |
| No cache, limit 4 | 12.3 to 12.5 s | none |
| Cold cache, limit 4 | 14.8 s | 0/32 |
| Rerun, no change | 0.71 s | 31/32 (scripts rewrote its tsbuildinfo) |
| Rerun, no change | 0.54 s | 32/32 |
After an edit in packages/contracts | 15.2 s | 5/32, only contracts and its 26 dependents ran |
| Next rerun | 0.59 s | 32/32 (web and desktop hit, which they did not before the exclusion) |
A type error is still caught after cache hits. I renamed pullRequestHostOf inside packages/contracts only, so contracts passed. @t3tools/shared, which was cached and imports the old name, ran again and failed with TS2305, and the run exited 2. After the revert, the run was green again.
Before the exclusions, marketing never hit the cache (2.8 s on every run), and web and desktop missed on two runs after each contracts edit.
Smoke checks on 1.3.0: apps/server/src/attachmentStore.test.ts (10 passed), apps/web/src/components/ChatMarkdown.browser.test.tsx (6 passed), vp lint and vp fmt --check on changed files, vp run typecheck in contracts, vp run dev booted (web 200, server listening), and knip on apps/marketing, web, and desktop.
Open questions#
react/purityiswarnfor web now. Should a follow-up move the render-timenew Date()calls (Sidebar, CustomSnoozeDialog, ChatView snooze clock) into state or effects and restoreerror?vp iprints "Failed to create bin ... vitest.mjs" for packages that get vitest only through@effect/vitest(ssh, tailscale, scripts, source-control-*). Tests, lint, typecheck, and dev all work. I left it as is.
Made by Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
e897c9cf-311d-4847-9596-bb37ca4fb6e6
📥 Commits
-
Reviewing files that changed from the base of the PR and between a93b03c8a5a888cfa7fac1fd6cb7a814221adf72 and 545460fc4f1af2d2547ee2aeeb48855bb3e18e2e.
⛔ Files ignored due to path filters: 1
-
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing: 12
-
apps/desktop/package.jsonapps/desktop/vite.config.tsapps/marketing/package.jsonapps/marketing/vite.config.tsapps/web/package.jsonapps/web/vite.config.tsdocs/orchestration-v2/core-graph-and-data-model.mddocs/orchestration-v2/thread-lineage-and-context-transfer.mdknip.jsoncpackage.jsonpnpm-workspace.yamlvite.config.ts
💤 Files with no reviewable changes: 1
-
- apps/desktop/package.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
📝 Walkthrough
-
The pull request moves application typecheck commands into Vite task configuration and updates root typecheck scripts. It also updates a web testing dependency, changes a React lint rule, and reformats orchestration type declarations.
Changes: Vite Plus typecheck task migration
Layer / File(s) Summary Update workspace tooling
package.json,pnpm-workspace.yamlThe root typecheckandtcscripts enable caching and increase concurrency from 2 to 4. The Vite and Vite Plus catalog versions change to 1.3.0.Configure application typecheck tasks
apps/desktop/package.json,apps/desktop/vite.config.ts,apps/marketing/package.json,apps/marketing/vite.config.ts,apps/web/package.json,apps/web/vite.config.ts,knip.jsoncThe desktop and web tasks run tsc-rs --noEmit; the marketing task runsastro check. These tasks use automatic cache inputs with the specified exclusions. The application package-level typecheck scripts are removed, and Knip ignores@astrojs/checkin the marketing workspace.Web browser test dependency update
Layer / File(s) Summary Update browser test dependency
apps/web/package.json@vitest/browser-playwrightchanges from version5.0.1to5.0.5.Orchestration type formatting
Layer / File(s) Summary Format orchestration union declarations
docs/orchestration-v2/core-graph-and-data-model.md,docs/orchestration-v2/thread-lineage-and-context-transfer.mdThe listed union declarations are reformatted with one member per line. Their supported values do not change. React purity lint rule
Layer / File(s) Summary Adjust React purity lint rule
vite.config.tsThe web TypeScript react/purityrule changes from error to warning. Comments describe oxlint false positives involvingnew Date().Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Other
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
54546-
The reviewed changes are mergeable with no identified current-head correctness, availability, security, or data-integrity risk.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description provides detailed problem, change, verification, open-question, and agent information. It does not provide the required Scope and approval section or explicit maintainer approval and s… Add a Scope and approval section. Link the triaged issue or approval discussion and include the explicit maintainer approval comment. If this is a focused configuration change that does not require prior approval, explain why it qualifies a… Passed checks: 3 passed-
Check name Status Explanation Title check The title clearly summarizes the primary changes: upgrading Vite+ to 1.3 and enabling typecheck caching. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
Full details: Description check
-
Explanation
The description provides detailed problem, change, verification, open-question, and agent information. It does not provide the required Scope and approval section or explicit maintainer approval and scope justification.
Resolution
Add a Scope and approval section. Link the triaged issue or approval discussion and include the explicit maintainer approval comment. If this is a focused configuration change that does not require prior approval, explain why it qualifies and how its effects remain within the established capability.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB +7 B (+0.1%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +7 B (+0.6%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
a93b03c· PR result:545460f· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This build/tooling upgrade adds Vite+ typecheck caching and updates related test and lint tooling, with no direct product-runtime changes. Human review is required because
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).react/purityis changed from an error to a warning across the web codebase, weakening a static-analysis diagnostic gate.