Twitter | Pretraživanje | |
Nathan Shively-Sanders
Hi JS twitter -- I want to know what snags you hit the last time you converted a big JS project to TS. No typings for dependencies? Too many errors? Complex build setup? Something else? If you've never done JS->TS, let me know too. New projects in TS? Never touched TS?
Reply Retweet Označi sa "sviđa mi se" More
Andreas Grünh 12. lip
Odgovor korisniku/ci @sanders_n
For us, the main problem was our low level components. You could not properly type new features, because they would use still untyped low level components. These where often so complex that our juniors could not convert them, so they used any or stayed on JS.
Reply Retweet Označi sa "sviđa mi se"
Nathan Shively-Sanders 12. lip
Odgovor korisniku/ci @andrewgreenh
Did those components also need to be converted to TS or would you have been OK with adding types in a d.ts file and just leaving them as JS?
Reply Retweet Označi sa "sviđa mi se"
Daria Caraway 12. lip
Odgovor korisniku/ci @sanders_n @typescript
Not exactly a “snag”, but one of the most time consuming things is when you add types and catch legitimate bugs that have always been there. Definitely a positive but it can reveal some sticky bugs you weren’t prepared to address.
Reply Retweet Označi sa "sviđa mi se"
Brasten 13. lip
Odgovor korisniku/ci @darcar31 @sanders_n @typescript
Yes! This! We're in the middle of this now and so many times it's been like "how does this even actually work now??" Most commonly, some data is optional at collection, but other code crashes if it's not there, and there's no consideration for getting from one state to the other.
Reply Retweet Označi sa "sviđa mi se"
Mike North 🤯 12. lip
Odgovor korisniku/ci @sanders_n
Recent snag I helped someone with: The "export = and import = require()" docs are really important for those who are trying to type CJS modules without breaking anything. It would be helpful if they were more "front and center".
Reply Retweet Označi sa "sviđa mi se"
Tom Dale 13. lip
Odgovor korisniku/ci @sanders_n
I became too productive and my manager gave me more bugs to fix.
Reply Retweet Označi sa "sviđa mi se"
Titian Cernicova Dragomir 12. lip
Odgovor korisniku/ci @sanders_n
1. No typings for dependencies (wrote custom one just for the stuff we actually use) 2. Partially/Badly typed packages. 3. The number of errors after enabling noImplictAny is hard to deal with (no migration is complete until this is enabled IMO)
Reply Retweet Označi sa "sviđa mi se"
Patricio Palladino 👷‍♂️ 12. lip
Odgovor korisniku/ci @sanders_n @drosenwasser
Running tests with ts-node. It's slow and behaves quite differently from tsc, so some things break in ts-node and not in tsc.
Reply Retweet Označi sa "sviđa mi se"
Rikki Schulte 12. lip
Odgovor korisniku/ci @alcuadrado @sanders_n @drosenwasser
if you are using jest, try ts-jest 🚀
Reply Retweet Označi sa "sviđa mi se"