JavaScript libraries should be written in TypeScript
1–10 of 285 posts
Re: JavaScript libraries should be written in TypeScript
#2Re: JavaScript libraries should be written in TypeScript
#3The title is needlessly inflammatory (hope that's the right word). It's the original one, but the article states clearly that it is an advice for libraries that are intended to be used by thousands of developers . Maybe the title could be changed to "All big JavaScript libraries…"?
Re: JavaScript libraries should be written in TypeScript
#4What's nice is how much types can be inferred from just a handle of type annotations. My editor can start pointing out potential bugs at the cost of relatively little effort on my part, and that's a good place to be.
Re: JavaScript libraries should be written in TypeScript
#5Re: JavaScript libraries should be written in TypeScript
#6I'm positively surprised when I come across a JavaScript API whose documentation actually specifies this very basic information.
Coming from the static typing world, it's astounding...
Re: JavaScript libraries should be written in TypeScript
#7The title is needlessly inflammatory (hope that's the right word). It's the original one, but the article states clearly that it is an advice for libraries that are intended to be used by thousands of developers . Maybe the title could be changed to "All big JavaScript libraries…"?
What's a "big" JavaScript library? How do you know how widely adopted your JavaScript library will be?
Re: JavaScript libraries should be written in TypeScript
#8And then new transpiler language appears, with "real" type system, not java-grade. And everyone stops using typescript, treating it as outdated technology.
There are enhancements to the type system on the roadmap, for example support for non-nullable and variadic types: https://github.com/Microsoft/TypeScript/wiki/Roadmap
Typescript may not be perfect but I'm glad to see it getting more attention as I think it can bring a significant quality improvement to a code base for a fairly small investment of effort.
Re: JavaScript libraries should be written in TypeScript
#9I've recently started using Flow alongside Nuclide IDE (a Facebook-developed suite of Atom extensions), which allows me to easily see the type of a given variable. What's nice is how much types can be inferred from just a handle of type annotations. My editor can start pointing out potential bugs at the cost of relatively little effort on my part, and that's a good place to be.
Re: JavaScript libraries should be written in TypeScript
#10And then new transpiler language appears, with "real" type system, not java-grade. And everyone stops using typescript, treating it as outdated technology.