Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Substantial PR


Reviewer Focus (Read This First)

What reviewers should focus on

Where should reviewers spend most of their time?

Call out:

  • apps/ensindexer still uses tsc: tsgo 7.0 detects ~80 type errors in Ponder table type usage that tsc 5.9 doesn't. Verify this is acceptable.
  • Mixed compiler strategy: 11 packages on tsgo, 1 on tsc. Confirm this doesn't create maintainability debt.

Problem & Motivation

Why this exists
  • Type checking takes ~70s, slowing down CI and local dev feedback loops
  • Microsoft released tsgo (TypeScript native preview) claiming 10x speed improvements
  • Issue requested benchmarking and migration if beneficial

What Changed (Concrete)

What actually changed
  1. Installed @typescript/native-preview@7.0.0-dev.20260128.1
  2. Replaced tsc --noEmit with tsgo --noEmit in 11 package.json files
  3. Cleaned up packages/namehash-ui/tsconfig.json:
    • Removed deprecated baseUrl option (not supported by tsgo)
    • Removed unused paths configuration after verification
  4. Kept apps/ensindexer on tsc (tsgo 7.0 detects type errors tsc 5.9 doesn't)

Performance:

  • Without cache: 69.6s → 36.4s (47% faster)
  • With cache: 65.3s → 34.7s (47% faster)

Design & Planning

How this approach was chosen
  • No formal design doc; task was scoped to benchmark and migrate if viable
  • Attempted full migration, discovered tsgo's stricter type checking breaks ensindexer
  • Chose hybrid approach over blocking on fixing ~80 Ponder type errors
  • Alternative considered: Skip migration entirely. Rejected due to significant perf win for 92% of packages.
  • Planning artifacts: Issue description only
  • Reviewed / approved by: N/A (direct implementation)

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:

  • Initially removed all path mappings from namehash-ui tsconfig after verifying they weren't used
  • Temporarily restored @/* path mapping per reviewer request to maintain standard practice
  • After further review, confirmed the path mapping was genuinely unused and removed it entirely for cleaner configuration
  • Bugs caught: None
  • Logic simplified: N/A
  • Naming / terminology improved: N/A
  • Dead or unnecessary code removed: Removed deprecated baseUrl compiler option and unused paths configuration

Cross-Codebase Alignment

Related code you checked
  • Searched for all tsconfig.json files to identify baseUrl usage (only namehash-ui affected)
  • Checked all package.json files for typecheck scripts
  • Verified no custom build scripts invoke tsc directly
  • Searched namehash-ui codebase for @/ imports to verify path mapping usage (confirmed unused)
  • Search terms used: baseUrl, typecheck, tsc --noEmit, from "@/, bare imports patterns
  • Reviewed but unchanged: All tsconfig files (only namehash-ui needed changes)
  • Deferred alignment: Fixing ensindexer's Ponder type errors (separate effort)

Downstream & Consumer Impact

Who this affects and how

Developers: ~47% faster pnpm typecheck locally and in CI

CI/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)

  • Public APIs affected: None
  • Docs updated: None (internal tooling change)
  • Naming decisions: Used tsgo consistently (official binary name)

Testing Evidence

How this was validated
  • Ran pnpm typecheck before/after (timed with time command)
  • Ran pnpm test to verify no behavior changes (844/847 pass, same 3 pre-existing failures)
  • Tested with and without cache to measure both scenarios
  • Verified namehash-ui typecheck passes after removing all unused configurations
  • Testing performed: Local typecheck and test runs with benchmarking
  • Known gaps: No validation on Node 24+ (ran on Node 20.20.0)
  • What reviewers must reason about: Whether hybrid tsc/tsgo is maintainable long-term

Scope Reductions

What you intentionally didn't do
  • Fix ensindexer type errors: ~80 errors in Ponder OnchainTable usage. Beyond scope; requires understanding Ponder's type system evolution
  • Upgrade to stable tsgo: Preview version only available; stable tsgo target is TypeScript 7.0
  • Remove tsc dependency entirely: Blocked by ensindexer
  • Follow-ups: Fix ensindexer Ponder type errors, then migrate to tsgo
  • Why deferred: Requires domain knowledge and code changes beyond compiler swap

Risk Analysis

How this could go wrong

Risks:

  • tsgo 7.0 is preview/dev quality (not production-ready)
  • Mixed compiler strategy creates two paths to maintain
  • Future tsc updates might diverge further from tsgo behavior

Assumptions:

  • tsgo preview is stable enough for CI use
  • Microsoft will reach type-checking parity between tsc/tsgo before TypeScript 7.0 release

Blast radius: CI failures, false negatives in type checking

  • Risk areas: Preview software in critical path (CI)
  • Mitigations: Easy rollback (revert package.json changes), tsc still present as fallback
  • Named owner: Original implementer (copilot/replace-tsc-with-tsgo branch)

Pre-Review Checklist (Blocking)

  • I reviewed every line of this diff and understand it end-to-end
  • I'm prepared to defend this PR line-by-line in review
  • I'm comfortable being the on-call owner for this change
  • Relevant changesets are included (or are not required)
Original prompt

This section details on the original issue you should resolve

<issue_title>Replace tsc with tsgo and benchmark the timing differences</issue_title>
<issue_description>- benchmark pnpm typecheck (with and without cache) before and after

  • typechecking and tests pnpm test should pass both before and after</issue_description>

<agent_instructions>read the issue description</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Contributor

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Jan 29, 2026 6:55am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
ensnode.io Skipped Skipped Jan 29, 2026 6:55am
ensrainbow.io Skipped Skipped Jan 29, 2026 6:55am

@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io January 28, 2026 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io January 28, 2026 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io January 28, 2026 23:10 Inactive
@namehash namehash deleted a comment from changeset-bot bot Jan 28, 2026
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

⚠️ No Changeset found

Latest commit: 5c8d71b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – ensnode.io January 28, 2026 23:25 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io January 28, 2026 23:25 Inactive
@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io January 28, 2026 23:25 Inactive
Copilot AI changed the title [WIP] Replace tsc with tsgo and benchmark timing differences Replace tsc with tsgo for 47% faster type checking Jan 28, 2026
Copilot AI requested a review from shrugs January 28, 2026 23:33
Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – ensnode.io January 29, 2026 00:39 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io January 29, 2026 00:39 Inactive
@shrugs shrugs marked this pull request as ready for review January 29, 2026 00:46
@shrugs shrugs requested a review from a team as a code owner January 29, 2026 00:46
Copilot AI review requested due to automatic review settings January 29, 2026 00:46
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/replace-tsc-with-tsgo

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a 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.1 as a dev dependency
  • Updated typecheck scripts in 11 packages/apps to use tsgo --noEmit instead of tsc --noEmit
  • Removed deprecated baseUrl option 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.

Comment on lines 7 to 9
"paths": {
"@/*": ["./src/*"]
}
Copy link

Copilot AI Jan 29, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

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

Copy link
Contributor Author

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-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR successfully migrates the monorepo from TypeScript's tsc to tsgo (TypeScript in Go) for type checking, achieving a 47% performance improvement. The migration updated 11 out of 12 packages to use tsgo --noEmit, with only apps/ensindexer remaining on tsc due to stricter type checking in tsgo that revealed ~80 type errors in Ponder type system usage.

Key changes:

  • Installed @typescript/native-preview@7.0.0-dev.20260128.1 as a root dependency
  • Updated typecheck scripts across 11 packages to use tsgo --noEmit instead of tsc --noEmit
  • Removed baseUrl from packages/namehash-ui/tsconfig.json for tsgo compatibility while keeping @/* path mapping

Performance results:

  • Without cache: 36.4s (was 1m9.6s) - 47% faster
  • With cache: 34.7s (was 1m5.3s) - 47% faster

The PR description confirms all tests pass and typechecking works correctly with the new tooling.

Confidence Score: 4/5

  • This PR is generally safe to merge with minor configuration concerns
  • The migration is well-executed with documented performance improvements and proper testing. The score is 4 rather than 5 due to the baseUrl removal in tsconfig.json which may affect path resolution behavior, though this appears to have limited impact since the @/* path mapping is not currently used in the codebase.
  • Pay attention to packages/namehash-ui/tsconfig.json where path mappings may not resolve correctly without baseUrl

Important Files Changed

Filename Overview
package.json Added @typescript/native-preview 7.0.0-dev dependency for tsgo support
packages/namehash-ui/tsconfig.json Removed baseUrl option for tsgo compatibility while keeping @/* path mapping
pnpm-lock.yaml Added @typescript/native-preview package with platform-specific binaries

Sequence Diagram

sequenceDiagram
    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)
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Co-authored-by: shrugs <1535001+shrugs@users.noreply.github.com>
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@lightwalker-eth lightwalker-eth merged commit be142c4 into main Jan 29, 2026
15 of 16 checks passed
@lightwalker-eth lightwalker-eth deleted the copilot/replace-tsc-with-tsgo branch January 29, 2026 07:31
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.

Replace tsc with tsgo and benchmark the timing differences

3 participants