Skip to content
Source
Sign inSign up
pingdotgg/t3code

build: upgrade Vite+ to 1.3 and cache typecheck #22716

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/22716/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

vpr 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-plus and vite-plus-core to 1.3.0, and @vitest/browser-playwright to 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 the vp config git lock error in linked worktrees.
  • Root typecheck and tc scripts now run vp run -r --cache --concurrency-limit 4 typecheck. --cache applies 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 define typecheck as a task in their vite.config.ts with that file excluded from the inputs. This is the only way to set inputs: root run.tasks apply to the root package only. Marketing gets a vite.config.ts that only holds this task. Knip no longer sees astro check there, so @astrojs/check is in its ignore list.
  • scripts and oxlint-plugin-t3code also 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-v2 TypeScript 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-react 0.152.0) still compiles all 5 files with no bailouts, so I set react/purity to warn for web instead of rewriting those sites. reactCompilerCoverage.test.ts still 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.

RunTimeCache hits
Before: no cache, limit 214.4 to 14.7 snone
No cache, limit 412.3 to 12.5 snone
Cold cache, limit 414.8 s0/32
Rerun, no change0.71 s31/32 (scripts rewrote its tsbuildinfo)
Rerun, no change0.54 s32/32
After an edit in packages/contracts15.2 s5/32, only contracts and its 26 dependents ran
Next rerun0.59 s32/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/purity is warn for web now. Should a follow-up move the render-time new Date() calls (Sidebar, CustomSnoozeDialog, ChatView snooze clock) into state or effects and restore error?

  • vp i prints "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. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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 react/purity is changed from an error to a warning across the web codebase, weakening a static-analysis diagnostic gate.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing: 12
      • 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
      • docs/orchestration-v2/core-graph-and-data-model.md
      • docs/orchestration-v2/thread-lineage-and-context-transfer.md
      • knip.jsonc
      • package.json
      • pnpm-workspace.yaml
      • vite.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.yaml
      The root typecheck and tc scripts 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.jsonc
      The desktop and web tasks run tsc-rs --noEmit; the marketing task runs astro check. These tasks use automatic cache inputs with the specified exclusions. The application package-level typecheck scripts are removed, and Knip ignores @astrojs/check in the marketing workspace.

      Web browser test dependency update

      Layer / File(s)Summary
      Update browser test dependency
      apps/web/package.json
      @vitest/browser-playwright changes from version 5.0.1 to 5.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.md
      The 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.ts
      The web TypeScript react/purity rule changes from error to warning. Comments describe oxlint false positives involving new 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: Passed 3 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Description checkWarningThe 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 Passed checks: 3 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly summarizes the primary changes: upgrading Vite+ to 1.3 and enabling typecheck caching.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
      Comment `@coderabbitai help` to get the list of available commands.
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: a93b03c · PR result: 545460f · Source CI: success

      Scenario 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.

Sign in to join this conversation.