|
@sanders_n | |||||
|
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?
|
||||||
|
||||||
|
Andreas Grünh
@andrewgreenh
|
12. lip |
|
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.
|
||
|
|
||
|
Nathan Shively-Sanders
@sanders_n
|
12. lip |
|
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?
|
||
|
|
||
|
Daria Caraway
@dariacaraway
|
12. lip |
|
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.
|
||
|
|
||
|
Brasten
@brasten
|
13. lip |
|
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.
|
||
|
|
||
|
Mike North 🤯
@michaellnorth
|
12. lip |
|
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".
typescriptlang.org/docs/handbook/…
|
||
|
|
||
|
|
Tom Dale
@tomdale
|
13. lip |
|
I became too productive and my manager gave me more bugs to fix.
|
||
|
|
||
|
Titian Cernicova Dragomir
@TitianCernicova
|
12. lip |
|
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)
|
||
|
|
||
|
Patricio Palladino 👷♂️
@alcuadrado
|
12. lip |
|
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.
|
||
|
|
||
|
Rikki Schulte
@rikki_js
|
12. lip |
|
if you are using jest, try ts-jest 🚀
|
||
|
|
||