TypeScript
JavaScript with a static, structural type system that is checked at build time and erased before the code runs; since version 7.0 its compiler is written in Go.
- What it is
- Programming languages (run on a virtual machine)
- Type
- Open source
- Made by
- Microsoft
- License
- Apache 2.0
- Facts checked
- 24 October 2026
What it is
TypeScript adds type annotations, interfaces and generics to JavaScript, and working JavaScript code is already TypeScript code. Types are structural: a value fits an interface if it has the right shape, whatever it was declared as, and most types are inferred from the values assigned. The compiler, tsc, checks the types and then emits plain JavaScript with them removed, so the program runs on any JavaScript engine and the types never change what it does at run time. By default it still emits code when there are type errors, which eases migrating old JavaScript; noEmitOnError stops that. Strictness is a dial: strict turns on checks such as noImplicitAny and strictNullChecks, and is the default since TypeScript 6.0.
Because the types are only erased, many tools run TypeScript without tsc and without checking it. Vite transpiles .ts files with the Oxc transformer and leaves type checking to the editor and the build. Node.js runs .ts files directly by default since v23.6 and v22.18, stable since v25.2 and v24.12: it replaces the type syntax with whitespace and refuses features that need real code generation, such as enum declarations, namespaces with runtime code and parameter properties. Deno runs TypeScript without configuration and type-checks only with --check or deno check. Type checking is therefore a separate step, typically tsc --noEmit in CI, and the erasableSyntaxOnly option keeps code within what these tools can strip.
TypeScript 6.0 (March 2026) was the last release built on the original JavaScript codebase and mostly prepared users for the next one. TypeScript 7.0 (July 2026) is a port of the compiler to Go, published as the same typescript npm package with the same tsc command. Microsoft measured full builds 8 to 12 times faster, partly by parsing, checking and emitting on several threads with shared memory. 7.0 has no programmatic API, so tools built on it, such as Vue, Svelte and Angular template checking, stay on 6.0 through the @typescript/typescript6 package; the 7.1 beta of 20 October 2026 brings a new API.
Why teams pick it
- Gradual adoption: rename a
.jsfile, then turn up strictness option by option as the codebase allows - Structural types and inference describe how JavaScript is actually written, so most code needs few annotations
- One checker drives the editor too: errors as you type, completions, go-to-definition and safe renames across a project
- Since 7.0, a native, multithreaded compiler: the VS Code codebase builds in 10.6 seconds instead of 125.7
Watch out for
- Unsound by design and erased at run time:
any, type assertions and data from the network can all disagree with the types, so input still needs runtime validation - Two toolchains in practice: fast tools strip types without checking them, so a separate
tscrun is needed, and enums, namespaces and parameter properties don’t work in strip-only runtimes - TypeScript 7.0 ships without a programmatic API; linters and framework tools that depend on it stay on 6.0 until 7.1
- Major versions change defaults: 6.0 turned on
strict, defaultedtypesto an empty list deprecated ES5 output andbaseUrl, and dropped AMD modules; 7.0 removes everything 6.0 deprecated
Alternatives
What all run on a virtual machine have in common →Compare side by side →async and await mainstream and gains a new version every November.How it fits with other technologies
Structural typing, and what is left after the types are erased · ts
interface Point {
x: number;
y: number;
}
function norm(p: Point): number {
return Math.hypot(p.x, p.y);
}
const parsed = { x: 3, y: 4, label: 'a' }; // never declared as a Point
console.log(norm(parsed)); // 5: the shape matches
norm({ x: 3 });
// error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Point'.
// Property 'y' is missing in type '{ x: number; }' but required in type 'Point'.
// The JavaScript that tsc emits, or Node.js runs after stripping the types:
// function norm(p) {
// return Math.hypot(p.x, p.y);
// }See it in a real stack
No architecture uses TypeScript yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2012–2026
JavaScript was never designed for large applications, yet that is what web teams were building with it. On 1 October 2012 Microsoft released a preview of TypeScript, built by Anders Hejlsberg, lead architect of C#, with Steve Lucco and Luke Hoban. Any JavaScript could be pasted into it and still work; optional static types made larger programs easier to build; and the output was plain JavaScript that ran in any browser. The code was open source under Apache 2.0 from the first day.
TypeScript 1.0 shipped in April 2014, and the team began taking pull requests. That July it moved from CodePlex to GitHub with a new compiler about five times faster. TypeScript 2.0, in September 2016, gave null and undefined their own types under --strictNullChecks, so forgetting to handle a missing value became a compile error.
As codebases grew, the compiler itself, written in TypeScript, became slow to load and check very large projects. In March 2025 Hejlsberg announced a native port to Go, code-named Corsa, with the existing codebase called Strada. It shipped as TypeScript 7.0 in July 2026, after 6.0 removed old options to ease the move, and the Go code replaced the old code in the main repository.
Why it’s built this way
- A superset that compiles to clean JavaScript
- The design goals ask for no runtime overhead and clean, idiomatic, recognizable JavaScript output, so existing code, libraries and engines all keep working and the output is readable without TypeScript.
- Structural, fully erasable types
- JavaScript code passes plain objects around and checks their properties, not their declared class. Typing by shape fits that, and erasable types mean no type information is needed at run time.
- Not sound on purpose
- The design goals list a sound or “provably correct” type system as a non-goal, and aim for a balance between correctness and productivity, so common JavaScript patterns type-check without fighting the compiler.
- Port the compiler to Go instead of rewriting it
- The new compiler had to behave like the old one. Idiomatic Go closely resembles the existing TypeScript code, so it could be ported rather than redesigned, and a garbage collector keeps the code simple while costing little in a compiler that mostly runs as a batch job.
Timeline
- 2012
Microsoft releases a TypeScript preview on 1 October, under Apache 2.0
- 2014
TypeScript 1.0 in April; the project moves to GitHub in July
- 2016
TypeScript 2.0 adds non-nullable types with
--strictNullChecks - 2025
Anders Hejlsberg announces a native port of the compiler to Go in March
- 2026
TypeScript 6.0 in March, the last JavaScript-based release; TypeScript 7.0, the Go port, in July
- TechCrunch: Microsoft previews new JavaScript-like programming language TypeScript (1 October 2012)
- TypeScript blog: Announcing TypeScript 1.0 (April 2014)
- TypeScript blog: New compiler and moving to GitHub (July 2014)
- TypeScript blog: Announcing TypeScript 2.0 (September 2016)
- Anders Hejlsberg: A 10x faster TypeScript (March 2025; Strada and Corsa)
- microsoft/typescript-go discussion #411: Why Go?
- TypeScript wiki: Design goals
- TypeScript blog: Announcing TypeScript 6.0 (23 March 2026)
- TypeScript blog: Announcing TypeScript 7.0 (8 July 2026)
Sources11 · facts checked 24 October 2026
- TypeScript handbook: TypeScript in 5 minutes (JavaScript code is TypeScript code, inference, structural typing)
- TypeScript handbook: The basics (erased types, emitting with errors, noEmitOnError, strictness flags)
- TypeScript wiki: Design goals (no runtime overhead, erasable structural types, soundness a non-goal)
- TypeScript blog: Announcing TypeScript 6.0 (new defaults, deprecations, bridge to 7.0)
- TypeScript blog: Announcing TypeScript 7.0 (Go port, build times, no API, @typescript/typescript6)
- GitHub: microsoft/TypeScript releases (v7.0.2, v7.1-beta on 20 October 2026)
- GitHub: microsoft/typescript-go (staging repo for the native port, now closed)
- Node.js docs: Modules, TypeScript (type stripping, unsupported syntax, version history)
- Deno docs: TypeScript support (no configuration, type checking with --check)
- Vite docs: Features, TypeScript (transpile only with Oxc, no type checking)
- GitHub: microsoft/vscode (written in TypeScript)