Re:Convert React JavaScript Code to TypeScript with Proper T...
by ake1 on Tuesday January 16, 2018 @03:15PM
(#16161973)
you don't actually have to manage type definitions for your own code (unless you're referring to typing parameter/return values), just things that you eg. fetch from the backend. those can be trivially generated by a tool from sample json or you can generate it all from things like OpenAPI.
Re:Convert React JavaScript Code to TypeScript with Proper T...
by brlewis on Tuesday January 16, 2018 @02:26PM
(#16161377)
You don't have to do anything. Just drop TypeScript in as a replacement for babel. Whenever you find yourself wondering if a type annotation or definition would help, then do it. Leave it optional; no commitment required.
I'm a big fan of keeping files as minimal and simple as possible. I virtually "count" the number of language concepts that exist, and try to keep it as low as possible. Makes it easy for other developers to on-board and for me to re-on-board.