You can benefit immoderately from compiling your existing codebase in TS; you'll probably discover some bugs, even before adding any annotations.
You can benefit immoderately from compiling your existing codebase in TS; you'll probably discover some bugs, even before adding any annotations.
There are still cases where you'll need to sprinkle <any>. For example:
var state = { foo: 1 };
if(something) {
state.bar = 2;
}
is valid JS, but the TS compiler will complain that `state` does not have a member named `bar`.We also have an established toolchain with gulp and browserify and babel, and again, at the time TS didn't play as nicely (vs Flow which just worked). Things are definitely improving in the TS world, and I keep tabs on it. The fortunate thing is that both Flow and TS' annotations are compatible, so it should be relatively easy to switch from one to another.
Whichever one you go with doesn't actually matter though. As long as you go with one of them you'll see a massive increase in productivity vs vanilla JS.