Skip to content

chore: migrate to tsgo (TypeScript native compiler)#11588

Draft
cephalization wants to merge 7 commits intomainfrom
chore/migrate-to-tsgo
Draft

chore: migrate to tsgo (TypeScript native compiler)#11588
cephalization wants to merge 7 commits intomainfrom
chore/migrate-to-tsgo

Conversation

@cephalization
Copy link
Contributor

@cephalization cephalization commented Feb 19, 2026

Summary

  • Migrate from tsc (TypeScript 5.9) to tsgo (TypeScript 7 native compiler) for 3-6x faster type checking and builds
  • Enable type-aware linting with oxlint-tsgolint to catch real type errors

Performance Improvements

Operation Before After Speedup
app/ typecheck 10.4s 1.8s 5.8x
js/ typecheck 5.1s 1.3s 3.9x
js/ build 10.4s 4.8s 2.2x

Changes

tsgo Migration

  • Replace typescript with @typescript/native-preview in both app/ and js/
  • Update all build and typecheck scripts to use tsgo instead of tsc
  • Fix app/tsconfig.json for tsgo compatibility (remove baseUrl, update paths)
  • Add VS Code extension recommendation for TypeScriptTeam.native-preview
  • Update DEVELOPMENT.md with typescript.experimental.useTsgo setting

Type-Aware Linting

  • Add oxlint-tsgolint to both app/ and js/
  • Enable --type-aware flag in lint scripts
  • Configure type-aware rules as warnings for gradual adoption:
    • no-floating-promises - catch unhandled promises
    • no-misused-promises - prevent passing promises where void expected
    • await-thenable - prevent awaiting non-promises
    • no-for-in-array - prevent for...in on arrays
    • require-array-sort-compare - require explicit sort comparator
  • Fix real bug found: removed unnecessary await in classifier_example.ts

Depends On


Note

Medium Risk
Touches core build/typecheck/lint tooling across the monorepo and introduces a new native TypeScript compiler and type-aware linting, which can surface CI/tooling regressions despite minimal runtime code changes.

Overview
Switches the monorepo TypeScript toolchain from tsc (TS 5.x) to the tsgo native compiler (@typescript/native-preview) and updates build/typecheck scripts across app/ and js/ packages accordingly, including VS Code guidance and tsconfig path tweaks for compatibility.

Enables type-aware linting by default via oxlint --type-aware, adds oxlint-tsgolint, and updates CI to enforce version consistency for the new dependencies. Includes follow-up code tweaks mostly to satisfy stricter typing (typed reduce calls, minor signature/type fixes) plus a small cleanup in an eval example.

Written by Cursor Bugbot for commit 703fdfc. This will update automatically on new commits. Configure here.

@cephalization cephalization requested a review from a team as a code owner February 19, 2026 15:35
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Feb 19, 2026
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 19, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 19, 2026

Open in StackBlitz

@arizeai/phoenix-cli

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-cli@11588

@arizeai/phoenix-client

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-client@11588

@arizeai/phoenix-evals

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-evals@11588

@arizeai/phoenix-mcp

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-mcp@11588

@arizeai/phoenix-otel

npm i https://pkg.pr.new/Arize-ai/phoenix/@arizeai/phoenix-otel@11588

commit: 703fdfc

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 19, 2026
@cephalization cephalization force-pushed the chore/upgrade-typescript branch from 26df07e to dea4ac0 Compare February 19, 2026 17:20
Base automatically changed from chore/upgrade-typescript to main February 19, 2026 21:05
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 19, 2026
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Feb 19, 2026
Replace tsc with tsgo for 3-6x faster type checking and builds.

Changes:
- Replace typescript with @typescript/native-preview in app/ and js/
- Update all build and typecheck scripts to use tsgo instead of tsc
- Remove deprecated baseUrl option from app/tsconfig.json
- Update paths to use relative notation (./src/* instead of *)
- Add TypeScriptTeam.native-preview to recommended VS Code extensions
- Update DEVELOPMENT.md with typescript.experimental.useTsgo setting
- Add *.tsbuildinfo to .gitignore

Performance improvements:
- app/ typecheck: 10.4s → 1.8s (5.8x faster)
- js/ typecheck: 5.1s → 1.3s (3.9x faster)
- js/ build: 10.4s → 4.8s (2.2x faster)

All tests pass (692 in app/, 491 in js/).
- Add oxlint-tsgolint to app/ and js/ for type-aware lint rules
- Enable --type-aware flag in lint scripts
- Configure type-aware rules: no-floating-promises, no-misused-promises,
  await-thenable (warn), no-for-in-array, require-array-sort-compare
- Fix await-thenable error in classifier_example.ts (awaiting non-Promise)
- Check @typescript/native-preview instead of typescript
- Add oxlint-tsgolint version consistency check
Examples and benchmarks use standard tsc to be realistic for users
copying the code. They have their own typescript dependency rather
than relying on the workspace root's tsgo.
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 21, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"devDependencies": {
"tsx": "^4.20.6",
"typescript": "^5.9.3"
"tsx": "^4.20.6"
Copy link

Choose a reason for hiding this comment

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

Benchmark build script missing typescript dependency after removal

Medium Severity

The "build": "tsc" script remains but typescript was removed from devDependencies without replacement. The two example apps that also still use tsc (cli-agent-starter-kit, phoenix-experiment-runner) correctly had typescript: ^5.8.3 added as an explicit dependency in this PR, but this benchmark package was missed. Since benchmarks/* is included in the pnpm workspace, pnpm run -r build will attempt to run tsc here, which may fail or rely on a fragile phantom dependency from typedoc.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: 📘 Todo

Development

Successfully merging this pull request may close these issues.

1 participant