# tsbro **Repository Path**: mirrors/tsbro ## Basic Information - **Project Name**: tsbro - **Description**: 浏览器版 TypeScript - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: main - **Homepage**: https://www.oschina.net/p/tsbro - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-25 - **Last Updated**: 2025-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # tsbro TypeScript for the Browser. No tooling, no build step, simply works. > Update: If you like this you may want to check its sister project, [tssw](https://github.com/stagas/tssw) as well! ## Why? TypeScript is still second-class citizen with regards to browser adoption, [there is a proposal to fix that](https://devblogs.microsoft.com/typescript/a-proposal-for-type-syntax-in-javascript/), but until then we have to use tooling, bundlers, build steps that are an impediment for when you want to quickly create a short demo or PoC. There are ways to run TypeScript code but it can't import other files or make use of remote packages. **tsbro** solves this by completely bypassing the browser's import system using synchronous XHR, transpile with [swc wasm](https://swc.rs/docs/usage/wasm) and a sophisticated ESM-to-CJS transpiler so that synchronous `require` is used everywhere: ``` sync xhr fetch ts code -> transpile to js with swc -> convert esm to cjs -> eval ``` ## Usage ```html
## License
MIT