Tsbro
Languages and libraries
browser typescript runtime
SHOW HN2025
How HN took it
3 positive, 5 neutral or asking, 0 mixed, 7 critical, out of 15 comments about the project. Thread score -0.14.
Performance: 0 for, 5 againstExecution: 1 for, 1 againstDesign: 1 for, 0 againstPrivacy: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Name is fun
From 1 comment
I'm wondering if it would be useful/possible to run the compilation in a service worker that would intercept requests for *.ts and compile them in the worker? I've seen an…
Tade0 on HN
Useful for running TS in browser for tests or embedded code samples
From 2 comments
Neat! I've been working on a custom element for running tests in the browser, and was thinking of wiring up swc to prevent having to compile the tests from ts before running…
catapart on HNOh, I wouldn't use something like this for the main code of a page. You should absolutely just compile and bundle the TS once, rather than on every page load. But there are cases…
spankalee on HN
Objections
Synchronous XHR hurts performance for large module graphs
From 2 comments
Synchronous XHR is a really bad way to do this. The performance will be terrible for anything but the smallest module graphs. But the TypeScript compiler API is synchronous, so…
spankalee on HNThe compiler is about 730k compressed, not 10 MB. You can also lazy load it so that you show code before being able to run it. Being in a worker only causes the synchronous…
spankalee on HN
Downloads a 5MB wasm file
From 1 comment
Yes, but it's doing all that locally. When I ran the code it downloaded a 5MB file, namely https://esm.sh/@swc/wasm-web@1.13.2/wasm_bg.wasm. It's also not using a service worker.
Tade0 on HN
Compiler is large to ship to every page
From 2 comments
> But the TypeScript compiler API is synchronous, so there's a problem. But it doesn't use DOM APIs, so you can run it in a worker without any issue. Monaco (the embeddable…
rafram on HN> The compiler is about 730k compressed Thanks, you're right, I was looking at the unminified version. Minified is 3.4 MB uncompressed, 730 KB compressed. That's still crazy…
rafram on HN
Questions
How does this differ from esm.sh/tsx?
From 1 comment
How does this differ from esm.sh/tsx?
nikisweeting on HN
Alternatives named
esm.sh/tsx
From 2 comments
How does this differ from esm.sh/tsx?
nikisweeting on HNIn their docs[0]: > Your source code is sent to the server, compiled, cached at the edge, and served to the browser as a JavaScript module. [0]: https://esm.sh/#tsx
stagas on HN
sucrase service worker
From 1 comment
I've tried this before, with a service worker[1] that intercepts TS/X-ish requests, and directing them over to sucrase[2] to compile to JS, before being loaded by the browser.…
altbdoor on HN
erasableSyntaxOnly in TypeScript 5.8+
From 1 comment
If you are interested in TypeScript for the browser, you might also like --erasableSyntaxOnly option of typescript >5.8. The only tool needed for it is the typescript compiler…
simulo on HN
Playground Elements
From 1 comment
Synchronous XHR is a really bad way to do this. The performance will be terrible for anything but the smallest module graphs. But the TypeScript compiler API is synchronous, so…
spankalee on HN