How AnyTool TypeScript Playground compiles and type-checks in the browser
The playground self-hosts the official TypeScript compiler and its lib.d.ts files and loads them into a Web Worker. As you type, it runs an in-memory language service over the source for genuine type diagnostics and uses ts.transpileModule to emit JavaScript. Because the compiler is bundled rather than fetched from a CDN, the whole pipeline works offline.
- Uses the real TypeScript compiler, not a regex type-stripper
- Full DOM + ESNext lib.d.ts is bundled locally
- Compiler runs in a Web Worker so typing stays smooth
- Builds are debounced about 250ms for live updates
