TSC = Typescript compiler

AST Playground

  1. ASTExplorer - Shows AST returned by TSC parser. Very useful.

  2. TypeScript AST Viewer - SImilar to ASTExplorer, but custom made for Typescript. Very useful for checking symbols (not shown in ASTExplorer).

Reading and examples

  1. Typescript Architectural Overview - Explains how all the different parts of TS are connected together. Also defines the common terminologies.

  2. Typescript compiler wiki page - Example code to use diff parts of TS. Show boilerplate code and some example.

    More services covered, less depth.

  3. Typescript Deep Dive by Basarat - Good introduction to various parts of TSC api.

    Gives the initial hints and basic concept of many apis, but often doesn't show full examples or connect the different parts it is describing. Feels like a developer's note.

  4. Typescript Transformer Handbook - Lots of links and examples on how to write custom transformer. More of complete working examples, less theory. Same techniques apply for using TSC api directly.

  5. Typescript API Playground - Great live examples on how to consume a custom transformer end-to-end on the browser. Very useful for building interactive ts tools that run on the browser. It shows how to create a virtual source file from input raw string, run transformers on it and then emits the result to string and shows it on the page.

  6. Compiler API through Deno - Deno is a new secure runtime for JavaScript and TypeScript. It allows runtime access to the built in TypeScript compiler.

Wrappers and utils

  1. ts-morph - Easier and nicer abstraction layer on top of TS internals. Exposes underlying constructs for advanced usecases.

    Slower startup due to extra initial overhead.

  2. byots - Modified version of Typescript lib, which exposes more internal apis. Matching releases are created automatically.

    TS has anyway opened up more apis, is it worth using anymore ??

  3. ttypescript - TSC drop-in replacement which supports passing custom transformers as cmdline argument.

Tools built using it

  1. Typescript language service plugin in VS Code (inbuilt), atom, Sublime Text - Supports similar feature set in multiple editors

  2. Typedoc - Very popular Typescript documentation generator which extracts type definitions and inline jsdoc comments into separate documents.

  3. (shameless plug) webpack-strip-log-loader - webpack plugin to remove some module (or symbol) and their usages recursively in a project. Uses TSC api internally.

Collection of resources related to Typescript internals