Settings

Theme

Show HN: ts-blank-space – fast TypeScript type-stripper

bloomberg.github.io

22 points by tchetwin a year ago · 4 comments · 1 min read

Reader

We've built a new type-stripping compiler for TypeScript source: `ts-blank-space`

It's:

* 5.6x faster than `tsc` due to zero-codegen

* Written in TypeScript

* Uses the official TypeScript parser

* Accurate/preserved source locations

* In used in production

It uses the same novel approach that inspired Node 22.6.0's `--experimental-strip-types` functionality, released last month

joshstrange a year ago

I assume this is named (also) as reference to Taylor Swift’s “Blank Space”? If so, very clever.

aclaymore a year ago

Hi, I'm the author of ts-blank-space and happy to answer any questions you have :wave:

  • matt-attack a year ago

    So is the idea that you would run a normal compiler once in your production pipeline to check syntax, and then re-run it with ts-blank-space to generate the final bundle?

    Clearly you can’t eliminate the syntax checking correct?

    • aclaymore a year ago

      Yes and the TypeScript ASTs generated while checking the code can be re-used when then running ts-blank-space to generate the JavaScript. Only generating the ASTs once is a significant performance win as this work takes much longer than the type-stripping work.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection