Google Developer Rips 'Painful' TypeScript 3.5 Upgrade
A GitHub issue titled "Google feedback on TypeScript 3.5" rips the "painful" release for causing upgrade problems across Google's repository of billions of lines of code.
Although any changes to the language cause the Google team to rework its massive codebase, Google developer Evan Martin pointed out three changes in the TypeScript 3.5 release that made it "especially painful," including one that "broke our code everywhere."
While emphasizing that Google was "very happy with TypeScript in general," Martin said:
We believe most of these changes were intentional and intended to improve type checking, but we also believe the TypeScript team understands that type checking is always just a tradeoff between safety and ergonomics.
It is our hope that this report about TS 3.5 as applied to a large codebase will help the TypeScript team better evaluate future situations that are similar, and we make some recommendations.
Martin, who has recently presented on Google's use of TypeScript, detailed the three main problems with the upgrade and offered suggestions to alleviate each. Summarized, they are:
A project contributor with the handle AnyhowStep responded to the post, in part saying, "A good workaround for most of these problems is to just have a lint rule to always explicitly specify type params for certain constructors/functions."
The issue garnered some 70 comments on Hacker News, where Martin's comment about some TypeScript code "relying on inference too much" was discussed in the top post.
Several Hacker News comments expressed "love" and admiration for TypeScript, and Martin's GitHub post also said: "I'd like to emphasize we are very happy with TypeScript in general. It is our hope that the above critical feedback is useful to you in your design process for future development of TypeScript."
TypeScript 3.5 was released in May. Coincidentally, Martin's Sept. 5 post came about a week after TypeScript 3.6 was introduced by program manager Daniel Rosenwasser.
Rosenwasser was "assigned" to the GitHub issue four days ago but that assignment was subsequently removed and the issue was tagged as "discussion," and the "Meta-Issue" and "Planning" labels were removed, so apparently no official action will be taken in regard to the post.
Martin's post (which garnered more than 400 approval icons) included a final note to Rosenwasser: "@DanielRosenwasser if you or anyone on your team who was interested read this, feel free to close it; I don't think it's actionable as a bug. (Also lemme know if it was useful or not, and we can do a similar one for 3.6.)"
At press time, developers were still commenting on the post.
Update: After this article was originally published, Rosenwasser answered Martin directly:
Hey @evmar, thanks a ton for writing this up. Having this available publicly is great, and gives us an easy way to return to this discussion, so I especially appreciate that. It sounds like users outside of both Google and Microsoft have gotten something out of it too!
This isn't the first batch of feedback that we've leveraged either. For example, with certain breaks, we've tried to stretch them out over several releases. But for what it's worth, I think that getting this sort of feedback earlier on would be more ideal since we would have realized how impactful each of these changes were (and whether they warranted a flag). While we can err on the side of caution and always introduce flags and the like, that's still more cognitive overhead we'd generally rather avoid.
We've actually expanded our release cadence in 3.6 to be longer in order to encourage users (and larger organizations like Google) to have more time to upgrade and try betas and RCs. I think that the sooner you can upgrade to 3.6 and hopefully the 3.7 beta, the better off the community as a whole will be too. Let us know if there's anything we can do to help there!
About the Author
David Ramel is an editor and writer for Converge360.