tsbro: TypeScript in the Browser, No Build Steps Needed

2025-07-25
tsbro: TypeScript in the Browser, No Build Steps Needed

tsbro is a new library that simplifies using TypeScript in the browser. It bypasses the browser's import system, using synchronous XHR to fetch TypeScript code, transpiling it to JavaScript with swc wasm, and converting it to CJS for synchronous require. This allows developers to run TypeScript code directly in the browser without build steps, and use external libraries like Preact, ideal for quick prototyping or PoCs. Current limitations include difficult-to-read stack traces and the need for manual ambient declaration files.

Development