dev.to | 📄 原文链接 | 2026-08-05 收录

TypeScript 7 真正“原生”的是什么?编译器而非你的代码

来源:dev.to — 2026-08-03

📋 概述

作者纠正了关于“TypeScript 原生化”的普遍误解:你的 .ts 代码并不会因此免编译直接运行——浏览器依然不能直接跑 TypeScript,Node 也不能做类型检查。真正原生化的是编译器本身:TypeScript 7 用 Go 重写了编译器并提前编译为原生二进制,取代了原本跑在 Node.js 上的 JS 编译器。虽然输入输出的两端(.ts 文件与 .js 输出/类型错误)都没变,但中间的 10 倍加速是真实的:VS Code 全量构建从 125.7s 降到 10.6s(约 11.9 倍),Sentry、Playwright 也都有近 9 倍的提升。

🔑 核心要点

💡 金句

The first box and the last box didn't change. Only the middle one did. That's the whole announcement and it's enough to be a big deal.
← 返回 Dev.to 首页