Hacker News new | past | comments | ask | show | jobs | submit login

I feel like the point is skipped in the post: if you ship TS sources, it means you need the TS compiler on the installed side, right? And specifically the right TS version for each installed package... which in some cases may mean conflicting requirements?

(If you own code is in JS, that is)




Author here. True, I think I should've worded it better. I work for Deno and it being a JS runtime that is able to run TS natively makes this less of an issue. The problem that a dependency needs a specific TS version hasn't come up so far. But that might be because Deno users tend to update to the latest version pretty frequently as we haven't done any breaking changes so far.


The TypeScript compiler is, in most or even all cases, backward compatible. You just need to have the latest version installed.


They may not be frequent, but they do happen https://www.typescriptlang.org/docs/handbook/release-notes/t...

And given enough public modules, we will find some conflicts in the dependency graph. YOLO just use the latest version is rarely a full solution.


You would be probably better off just running esbuild or similar - it will happily strip types from any version of TS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: