transformers.js
transformers.js copied to clipboard
[Question] TypeScript rewrite
Hi Joshua. I found your idea is extremely exciting. I am a frontend developer who has worked on TypeScript professionally for three years. Would you mind me doing a TypeScript re-write, so this npm package can have a better DX. If I successfully transform the codebase into TypeScript and pass all the tests, would you mind merging it into main?
I just forked this repo. https://github.com/Lantianyou/transformers.js
ts isn't the best DX, and I've been using it for 13 years, also js intellisense is always improving in IDE's
I do not think TS is always the best solution either, however, it would be nice to have it for this project. For example, this project use BigInt, it assumes ES 2020 or later. I think TypeScript transpiler can be a great use case here.
TS will die if js ever gets types, its at proposal stage atm
I do not think TS is always the best solution either, however, it would be nice to have it for this project.
No, it would be as ugly as it gets, it just makes everything 200 times more complicated while not actually improving anything (actually decreasing the readability) and prevents everyone from quickly testing and making PR's because you have to fumble with a build process in different scenarious, even though you just want to test a few lines of new code.
yup, why do you think I dumped ts for my flagship patterns:
https://github.com/quantuminformation/vanillajs-patterns
I believe type proposal for ES is in a very far future.
I give my 👍 to the rewrite this in typescript proposal. While I agree that TS config can be bit annoying - not to say a pain the a** - I do think that a simple setup is possible that works for most people checking out this repo (at least if you are not using something abstruse like Nix). I think the benefits ( type-safety, better editor auto-completion, using the language that most modern web libraries are written in, ...) far outweigh the config hiccups.
Thank you @sigma-andex for your support.
I think the benefits ( type-safety, better editor auto-completion, using the language that most modern web libraries are written in, ...) far outweigh the config hiccups.
You are just exposing that you don't know how current technology works. JSDoc and TypeScript use the same language server for IntelliSense.
You gain nothing but have a PITA now. you are sold
The amount of TypeScript fanboys that are convinced how much better TS is while not knowing anything about the underlying technology is really getting worrisome...
TypeScript is great if you like low signal/noise ratios
Hello - Don't think TS will die even with new JS proposal as TS does much more the proposal solves (and yes, it could be very painfull, but it's basically just about devs skills).
But rewriting the code is not a good idea as it's possible to create and maintain .d.ts
file, if devs want to use types (for example @types/tramsformerjs
).
I'm not sure if it makes for this library though...