Scripts2026年5月30日·1 分钟阅读

TypeScript-Go — Native TypeScript Compiler Rewritten in Go

Microsoft's official native port of the TypeScript compiler to Go, delivering up to 10x faster type-checking and build times for large codebases.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
TypeScript-Go
直接安装命令
npx -y tokrepo@latest install f7b603b6-5c64-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

TypeScript-Go is Microsoft's effort to rewrite the TypeScript compiler in Go for native performance. The goal is to bring type-checking and emit times down by an order of magnitude on large projects where the current JavaScript-based tsc can take tens of seconds.

What TypeScript-Go Does

  • Performs full TypeScript type-checking using a native Go binary
  • Emits JavaScript output compatible with the standard tsc compiler
  • Provides a Language Server Protocol (LSP) implementation for editor integration
  • Targets 1:1 compatibility with the existing TypeScript type system
  • Runs as a standalone binary with no Node.js dependency required

Architecture Overview

The project is a line-by-line port of the TypeScript compiler source from JavaScript/TypeScript to Go. The scanner, parser, binder, checker, and emitter stages mirror the original architecture. By compiling to a native binary, it eliminates V8 JIT warm-up and garbage collection overhead, yielding significant speed gains especially on multi-million-line codebases.

Self-Hosting & Configuration

  • Clone the repo and build with go build or use pre-built binaries when available
  • Run the compiler against your tsconfig.json just like standard tsc
  • Editor integration is planned via an LSP server binary
  • Existing tsconfig.json files and compiler options are supported as-is
  • The project is still in preview; track the GitHub repo for release milestones

Key Features

  • Up to 10x faster type-checking compared to the JavaScript-based tsc
  • Native binary with zero Node.js runtime dependency
  • Full TypeScript language compatibility as the target
  • LSP support for real-time editor feedback
  • Open source under Microsoft, backed by the TypeScript core team

Comparison with Similar Tools

  • tsc (TypeScript) — the original JS-based compiler; TypeScript-Go is its native successor
  • SWC — Rust-based transpiler that skips type-checking; TypeScript-Go does full checking
  • esbuild — Go-based bundler/transpiler without type-checking; complementary tool
  • Oxc — Rust-based JS toolchain focused on linting and parsing; different scope
  • Biome — Rust linter/formatter; does not perform TypeScript type-checking

FAQ

Q: Will TypeScript-Go replace tsc? A: That is the long-term goal. Microsoft intends it to become the primary compiler once compatibility is validated.

Q: Does it support all TypeScript features? A: The aim is 100% compatibility. Some edge cases may lag during the preview period.

Q: Can I use it today? A: It is available as a preview. Check the repository for the latest build instructions and known limitations.

Q: Does it work with my IDE? A: LSP support is under development, which will enable integration with VS Code and other editors.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产