Typescript is powerful, expressive, and very good for collaborative projects. Community support and ecosystem are good for React projects.
Adding it to this codebase, may reduce typos and parameter type errors. New contributors will be a little more relaxed to modify existed code.
I assume there can be some phases for this approach.
Almost painless.
tsconfig.json with allowJs: true and some other compilerOptions to avoid countless strict errors.@types/* packages. If you're using VSCode, IntelliSense will work pretty good already.Do some filename converting, from js->ts.
ava and jest can load ts modules.Rewrite react components, from js->tsx, will get a lot of errors at first, but anything typed will always make future maintainance a little bit easier. And I assume there may already be some useful codemods or transformers to automate this process.
Rewriting(since phrase 2) is not mandatory, and even after it starts, we can still keep a mixed codebase of js/ts, and recommend to write new code in ts/tsx.
looks promising. but,
just my two cents.
For that second point: we are working on cleaning up all the issues over the next couple weeks. If you know of any issues/PRs that can be closed, then feel free to leave a comment on them. I will then mark and close them accordingly.
Oh I've just found the repo for renewal version boost.Completely rewritten in Typescript and has some big architectural changes. But it seems to be at an early prototype stage, and development is kind of held up, all the best wishes with Rokt33r 馃嵑 .
Back to this issue, since this repo may still exist for a long time, I think phase 1 may be worth a try.
Most helpful comment
looks promising. but,
just my two cents.