Is TypeScript Ready for Prime Time?

As TypeScript edges towards a version 1.0 release, it's time to consider whether it's worthy of use in large-scale JavaScript application development. Don Kiely explores the current state of TypeScript, with an eye towards using it in the new year.

Don Kiely

January 2, 2014

5 Min Read
Is TypeScript ready for prime time Image Credit Microsoft
Image Credit: Microsoft

Related: "Microsoft Launches Visual Studio Online, Windows Azure-Based Toolset for Developing Apps in the Cloud"

It's been well over a year since I last wrote about TypeScript, Microsoft's language for large-application JavaScript development. If you're not familiar with TypeScript, then read my November 2012 article, "Is Microsoft's TypeScript Programming Language Worth the Fuss?," which provides background on the technology. The source code for the project is located on CodePlex.

Last month Microsoft announced the release of TypeScript 0.9.5, which the company seems to feel is getting pretty close to a version 1.0 release, despite the inclusion of some breaking changes that's still happening with every release. The 0.9.5 release fixes several different bugs and memory issues, and incorporates feedback from the community that's quickly growing around TypeScript.

Despite the inclusion of TypeScript version 0.9.1.1 in a release candidate version of Visual Studio 2013, the final Visual Studio RTM version didn't include the latest version of TypeScript. If you read between the lines of various Microsoft TypeScript blog posts, they were clearly hoping to include version 1.0, but it just didn't happen.

In what's one of the odder ways that Microsoft has come up with to install a technology in Visual Studio, you can get the latest version of TypeScript by creating a new project and selecting the Install the Latest TypeScript for Visual Studio project template, as shown in Figure 1. With the availability of NuGet, Visual Studio extensions, and the Web Platform Installer in Visual Studio, it's a bit of a strange way to install TypeScript. One of these days I'll have to ask Someone Who Knows why they chose this route. Anyway, the template opens a web page that lets you download the latest version of TypeScript for Visual Studio 2012 and 2013, and then you'll need to run the installer to get the full benefit of TypeScript goodness. Just be aware that the installation will install TypeScript for both Visual Studio 2012 and 2013 if they are both installed on your machine.

 logo in a gray background |

As you can see in Figure 1, you also have a project template that makes it easy to create an HTML page that uses TypeScript. Although there's nothing too fancy in the project template, it's a handy way to get a feel for using and playing with some of TypeScript's features, as it creates a .ts TypeScript file with some simple code that sets up a timer to continuously display the current time on an HTML page.

Microsoft continues to enhance support for TypeScript in Visual Studio. The 0.9.5 release includes a project property page to provide options for building JavaScript files from your TypeScript source, as shown in Figure 2. The page only appears once you've installed this TypeScript release and have restarted Visual Studio. Note that you won't get this property page by only using the HTML application with the TypeScript project template.

 logo in a gray background |

One interesting development in the gestation of TypeScript has been the introduction of Monaco, an online source management and editing environment that's part of Visual Studio Online and is built using TypeScript. Monaco isn't exactly a typical sample application that Microsoft typically provides with new technologies, but it's a major initiative for the company that serves as evidence of TypeScript's apparent readiness for real world enterprise applications. Apparently Xbox Music is also built with TypeScript, and these projects certainly don't hurt JavaScript's image as being worthy of consideration for far more than simple web page animations.

The company claims that there are already dozens of large TypeScript applications written by various Microsoft teams, as well as several different third party applications, so that "millions of lines of code are now active in the wild, which reflects a serious indication of the level of commitment and energy that that the community is investing in TypeScript." As grandiose as that statement appears on the surface, it certainly appears that there's growing interest if not excitement in TypeScript, particularly as JavaScript takes on a much more prominent role in web-based applications.

As of a couple of months ago, the company was expecting that with the 0.9.5 release it would have the version 1.0 specification completed. I've not been able to find such a spec on the web yet; the link to the spec on the main TypeScript homepage is still version 0.9.5, dated 18 November 2013. The specification is fairly interesting to scan, providing a lot of good background about the language features, generally written in readable English, unlike so many jargon-dense web specifications.

I'm of two minds when it comes to whether TypeScript is ready for prime time. On one hand, I'm a bit leery of the number of breaking changes in the latest 0.9.5 release, which indicates a still-evolving specification, a moving target that I'd lose sleep over if I were to begin a large project using TypeScript. On the other hand, the language seems to have a lot of momentum developing behind it, and once it stabilizes -- even prior to a version 1.0 release, whenever that happens -- I think it will be a worthy technology with enormous benefits for large-scale application development using JavaScript. As Microsoft is fond of pointing out, even if you start a large project with TypeScript and find that it won't work for you, there's an easy exit strategy: compile all your TypeScript code into JavaScript and use those .js files directly. That beats having to rip out an entire code base and starting over from scratch!

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like