TypeScript 7 Beta 與 tsgo:快速編譯器更需要遷移驗證

Tech
TypeScript 7 tsgo migration checklist diagram
A side-by-side validation path keeps TypeScript 7 adoption measurable.

速度提升會影響 CI、編輯器與大型程式庫體驗,但 JSDoc、declaration emit、watch mode、LSP,以及依賴 compiler API 的內部工具都要分開檢查。

What happened

Microsoft announced TypeScript 7.0 Beta on April 21, 2026. The beta is available as @typescript/native-preview@beta and runs through tsgo, so teams can compare it with TypeScript 6 tsc before changing their default toolchain.

Why it matters

TypeScript 7.0 Beta 引入以 Go 打造的原生編譯器。團隊應先讓 tsgo 與 tsc 並行驗證,再切換預設流程。 This is especially relevant for large TypeScript codebases, monorepos, and teams where type-checking latency affects pull-request flow and editor responsiveness.

實務清單

記錄 tsc 基線,將 tsgo 加為非阻塞 CI 任務,比對診斷與 .d.ts,有限度試用 VS Code Native Preview,並先定義升級與回滾標準。

Risks

The official repository still marks the programmatic API as not ready, watch mode as prototype, and LSP work as in progress. Teams with legacy JavaScript, CommonJS, Closure-style JSDoc, or compiler-API tooling should validate those areas separately.

Sources