ArticlesJavaScriptEngineering

Outgrowing ts-node

A pleasant experience report on just-in-time TypeScript

I just removed ts-node after about two years of service in my personal codebase. This is an experience report on its usage.

Overall I enjoyed using ts-node and was never burnt by it, which is really saying something because I tend to push these things to their limits.

There were minor hiccups like ts-node, package-installed TypeScript, and VSCode TypeScript brawling it out in my editor. Types would work in some subset. But this issue was fleeting. By the time I had ripped ts-node out there was only one artifact of it having lost one of these type battles.

When I was first getting into TypeScript coming from a heavy JavaScript background, it was a quick way to jump in and not have to worry about compiled code. I'm glad it existed to get me over the hump of adopting TypeScript. If this was its purpose, ts-node served it for sure.

Ultimately, the decision to abandon ts-node was performance related. I lean into code-generation heavily and a major pitfall of doing so is the time spent on the code-gen.

Removing ts-node from the process removed 50% of the time spent generating code. This was an optimization I couldn't overlook.

Fortunately, ts-node had not leached too deeply into my codebase because I only deploy compiled JavaScript to my back-end servers. So all production code was living ts-node-free. I just needed to change up the dev-local experience.

I was happy with ts-node as I used it and am happy with it as we parted. It took less then a few hours to have it fully ripped out.

I'll miss you ts-node, thanks for all the training wheels!