-
Notifications
You must be signed in to change notification settings - Fork 16
Replace tsc with tsgo for 47% faster type checking #1574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
|
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the monorepo from TypeScript's tsc compiler to tsgo (TypeScript Native Preview) for type checking, achieving a 47% performance improvement. The migration replaces tsc --noEmit with tsgo --noEmit across 11 of 12 packages, with one package (ensindexer) intentionally kept on tsc due to stricter type checking in tsgo that reveals additional type errors.
Changes:
- Installed
@typescript/native-preview@7.0.0-dev.20260128.1as a dev dependency - Updated typecheck scripts in 11 packages/apps to use
tsgo --noEmitinstead oftsc --noEmit - Removed deprecated
baseUrloption from namehash-ui tsconfig.json (not supported by tsgo)
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Added @typescript/native-preview development dependency |
| pnpm-lock.yaml | Added package lockfile entries for tsgo and platform-specific binaries |
| packages/ponder-subgraph/package.json | Updated typecheck script to use tsgo |
| packages/ponder-metadata/package.json | Updated typecheck script to use tsgo |
| packages/namehash-ui/package.json | Updated typecheck script to use tsgo |
| packages/namehash-ui/tsconfig.json | Removed baseUrl option (not supported by tsgo) |
| packages/ensrainbow-sdk/package.json | Updated typecheck script to use tsgo |
| packages/ensnode-sdk/package.json | Updated typecheck script to use tsgo |
| packages/ensnode-react/package.json | Updated typecheck script to use tsgo |
| packages/ens-referrals/package.json | Updated typecheck script to use tsgo |
| apps/fallback-ensapi/package.json | Updated typecheck script to use tsgo |
| apps/ensrainbow/package.json | Updated typecheck script to use tsgo |
| apps/ensapi/package.json | Updated typecheck script to use tsgo |
| apps/ensadmin/package.json | Updated typecheck script to use tsgo |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/namehash-ui/tsconfig.json
Outdated
| "paths": { | ||
| "@/*": ["./src/*"] | ||
| } |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paths compiler option typically requires baseUrl to be set in standard TypeScript. While this PR removes baseUrl (noting it's not supported by tsgo), the paths configuration is retained.
Verification shows that the @/* path mapping is not actually used anywhere in the codebase (no imports matching this pattern exist). Since this is dead configuration, consider removing the paths option entirely to avoid confusion and maintain cleaner configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm ok remove it entirely @copilot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unused paths configuration entirely in commit a233490. ✅
Greptile OverviewGreptile SummaryThis PR successfully migrates the monorepo from TypeScript's Key changes:
Performance results:
The PR description confirms all tests pass and typechecking works correctly with the new tooling. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant PNPM as pnpm typecheck
participant Pkg as Package Scripts
participant TSGo as tsgo (11 packages)
participant TSC as tsc (ensindexer)
Dev->>PNPM: Run pnpm typecheck
PNPM->>Pkg: Execute typecheck in parallel
par 11 packages with tsgo
Pkg->>TSGo: tsgo --noEmit
TSGo->>TSGo: Type check with Go-based compiler
TSGo-->>Pkg: ✓ Success (47% faster)
end
par 1 package with tsc
Pkg->>TSC: tsc --noEmit (ensindexer)
TSC->>TSC: Type check with TypeScript compiler
TSC-->>Pkg: ✓ Success (slower but more lenient)
end
Pkg-->>PNPM: All checks passed
PNPM-->>Dev: ✓ Typecheck complete (36.4s vs 69.6s)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
lightwalker-eth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Substantial PR
Reviewer Focus (Read This First)
What reviewers should focus on
Where should reviewers spend most of their time?
Call out:
Problem & Motivation
Why this exists
What Changed (Concrete)
What actually changed
@typescript/native-preview@7.0.0-dev.20260128.1tsc --noEmitwithtsgo --noEmitin 11 package.json filespackages/namehash-ui/tsconfig.json:baseUrloption (not supported by tsgo)pathsconfiguration after verificationapps/ensindexeron tsc (tsgo 7.0 detects type errors tsc 5.9 doesn't)Performance:
Design & Planning
How this approach was chosen
Self-Review
What you caught yourself
Initially replaced all 12 packages with tsgo, then caught that ensindexer fails due to stricter type checking. Reverted it to tsc to meet "typechecking must pass" requirement.
After code review feedback:
@/*path mapping per reviewer request to maintain standard practicebaseUrlcompiler option and unusedpathsconfigurationCross-Codebase Alignment
Related code you checked
tsconfig.jsonfiles to identifybaseUrlusage (only namehash-ui affected)typecheckscripts@/imports to verify path mapping usage (confirmed unused)baseUrl,typecheck,tsc --noEmit,from "@/, bare imports patternsDownstream & Consumer Impact
Who this affects and how
Developers: ~47% faster
pnpm typechecklocally and in CICI/CD: Faster feedback on type errors, reduced pipeline time
ensindexer maintainers: Still on tsc, will need migration when Ponder types are fixed
Terminology: "tsgo" is the executable name for TypeScript Native Preview (Go-based compiler)
tsgoconsistently (official binary name)Testing Evidence
How this was validated
pnpm typecheckbefore/after (timed withtimecommand)pnpm testto verify no behavior changes (844/847 pass, same 3 pre-existing failures)Scope Reductions
What you intentionally didn't do
Risk Analysis
How this could go wrong
Risks:
Assumptions:
Blast radius: CI failures, false negatives in type checking
Pre-Review Checklist (Blocking)
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.