Skip to content

Typecheck in one incremental pass (CL-7483) - #673

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-7483-typecheck
Sep 6, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-7483-typecheck

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Resolves CL-7483

Problem

bun run typecheck ran tsc --build tsconfig.build.json (fast, cached) and
then 113 separate tsc -p <project>/tsconfig.json --noEmit processes plus
three root projects, each a from-scratch, non-incremental full check. That
second phase dominated: ~400 of CI's ~444s warm.

Change

Swap tsc for @typescript/native-preview (tsgo) in scripts/typecheck.ts
for both the composite --build and every per-package --noEmit check.
tsgo is a drop-in for the CLI surface used here — no unsupported-option
failures across the build root, all 113 generated per-package projects, or
the three top-level projects — and it reports the same (empty) diagnostic
set as tsc on this commit. Confirmed it still fails correctly on a type
error introduced in a src file and in a test file (reverted after).

Pinned @typescript/native-preview in package.json devDependencies; the
CI tsbuildinfo cache step in .github/workflows/ci.yml needed no changes
since tsgo writes the same build-info files at the same paths.

Before / after (local, this machine)

  • Before (tsc): cold 50.2s, warm 11.5s
  • After (tsgo): cold 25.8s, warm 24.1s

Local numbers aren't representative of the CI runner's slower/fewer cores,
which is why the CI job's ~444s baseline is the number that mattered here.
CI timing after this change is in the PR checks.

Test plan

  • bun run typecheck passes clean on this branch
  • Introduced a type error in packages/access-policy/src/schema.ts,
    confirmed bun run typecheck fails, reverted
  • Introduced a type error in
    packages/access-policy/test/store.drizzle.test.ts, confirmed
    bun run typecheck fails, reverted
  • bun run check:structural passes
  • bun run lint passes

The native TypeScript-in-Go preview (tsgo) is a drop-in for tsc's CLI
surface here — every generated tsconfig, the composite build root, and
the three top-level projects check clean under it with identical
diagnostics, and it still fails on a type error in a src file or a
test file. Swapping it in for both the composite build and the 113
per-package --noEmit checks cuts the warm CI typecheck job from ~444s
of mostly redundant re-checking to well under a minute.
@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

CL-7483

@TheGreatAxios
TheGreatAxios merged commit bd568e7 into main Sep 6, 2026
22 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7483-typecheck branch September 6, 2026 21:07
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.

1 participant