TypeScript 7 Beta 与 tsgo:快速编译器更需要迁移验证
速度提升会影响 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.