Read OSS

microsoft/Typescript

6 articles

Prerequisites

01

The TypeScript Compiler at 30,000 Feet: Architecture & Codebase Navigation

A high-level tour of the TypeScript 6.0 compiler repository — directory structure, five-phase pipeline, core data structures, layered architecture, and build tool.

02

From Source Text to AST: The Scanner, Parser, and Node System

A deep dive into TypeScript's frontend: the stateful Scanner, recursive-descent Parser, SyntaxKind classification system, and the Node type hierarchy.

03

The Binder: Building Symbol Tables and Control Flow Graphs

How the TypeScript binder creates Symbols from declarations, populates hierarchical symbol tables, and constructs FlowNode graphs for type narrowing.

04

The Type Checker: 54,000 Lines of Type Theory in Practice

Inside TypeScript's type checker — the demand-driven architecture, Type hierarchy, assignability algorithm, type inference, control-flow narrowing, and the Program orchestrator.

05

The Emitter Pipeline: Transformations, Code Generation, and Declaration Files

How TypeScript's emitter orchestrates a chain of AST transformers for code lowering, declaration file generation, emit helpers, and source map output.

06

The Language Service and tsserver: Powering IDE Experiences

How TypeScript's Language Service wraps the compiler for editor features, and how tsserver exposes these capabilities over a JSON protocol for VS Code and other editors.