3 ms·
Author here, ask me any questions you might have. We used this internally to convert a few repos. It's not perfect but gives you a head start for converting to
by mohsen1 9y ago
Author here, ask me any questions you might have. We used this internally to convert a few repos. It's not perfect but gives you a head start for converting to TS.
I also wrote about our experience with TypeScript at Lyft if you're interested:
https://eng.lyft.com/typescript-at-lyft-64f0702346ea https://eng.lyft.com/typescript-at-lyft-64f0702346ea
- Maarten88 9y agoThank you for making this! I've done this conversion by hand many times and I'll certainly try your program for the next untyped component that I want to import.
- scoot 9y agoNot specific to your project, but I suspect you’ll know the answer: If React code contains sufficient information to infer type, why is a separate type system needed? (Or why can’t the same inference by made at compile time, rather than scattering the code with type definitions and external type files?)
- msoad 9y agoBecause propTypes are leaking into runtime. ASFAIK Flow originally wanted to use propTypes but decided to use compile time only type annotations
- interlocutor 9y agoHave you seen this related project: https://github.com/fuselabs/jsxtyper https://github.com/fuselabs/jsxtyper
- asdojasdosadsa 9y agoWould you suggest this to someone who has (pretty much) never used TypeScript? Case is, I am going to rewrite a project and this would be quite an interesting addition!
- jalvarado91 9y agoThank you for this. I have a slightly tangential question, can you point to some resources on the approach you used for this codemod? I see you used what seem to be native TS transforms. I've used a badly patched up jscodeshift and tscodeshift but they leave much to be desired.