chore: migrate to tsgo (TypeScript native compiler)#11588
chore: migrate to tsgo (TypeScript native compiler)#11588cephalization wants to merge 7 commits intomainfrom
Conversation
@arizeai/phoenix-cli
@arizeai/phoenix-client
@arizeai/phoenix-evals
@arizeai/phoenix-mcp
@arizeai/phoenix-otel
commit: |
26df07e to
dea4ac0
Compare
210947a to
ccb8637
Compare
c20d66d to
eeb02db
Compare
b696042 to
ef4f269
Compare
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.
ef4f269 to
703fdfc
Compare
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.


Summary
tsc(TypeScript 5.9) totsgo(TypeScript 7 native compiler) for 3-6x faster type checking and buildsoxlint-tsgolintto catch real type errorsPerformance Improvements
app/typecheckjs/typecheckjs/buildChanges
tsgo Migration
typescriptwith@typescript/native-previewin bothapp/andjs/buildandtypecheckscripts to usetsgoinstead oftscapp/tsconfig.jsonfor tsgo compatibility (removebaseUrl, updatepaths)TypeScriptTeam.native-previewtypescript.experimental.useTsgosettingType-Aware Linting
oxlint-tsgolintto bothapp/andjs/--type-awareflag in lint scriptsno-floating-promises- catch unhandled promisesno-misused-promises- prevent passing promises where void expectedawait-thenable- prevent awaiting non-promisesno-for-in-array- preventfor...inon arraysrequire-array-sort-compare- require explicit sort comparatorawaitinclassifier_example.tsDepends 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 thetsgonative compiler (@typescript/native-preview) and updates build/typecheck scripts acrossapp/andjs/packages accordingly, including VS Code guidance andtsconfigpath tweaks for compatibility.Enables type-aware linting by default via
oxlint --type-aware, addsoxlint-tsgolint, and updates CI to enforce version consistency for the new dependencies. Includes follow-up code tweaks mostly to satisfy stricter typing (typedreducecalls, 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.