About Links Archives Search Feed Albums of Note

TypeScript Revealed : v0.8.2 Addenda

The bugger about writing a book on an open source project is that it keeps developing while you are writing, proofing, copyediting and finally printing. This strategy can and does bite you on the arse, and has done me frequently. Two cases spring to mind:

It’s not a surprise that there are already some addenda for ‘TypeScript Revealed [/post/2013/01/16/TypeScript-Revealed-Details.aspx]’. It’s just disappointing that TypeScript v0.8.2 [http://blogs.msdn.com/b/typescript/archive/2013/01/21/announcing-typescript-0-8-2.aspx] was released the same day as the book was and includes a couple of main new features which I would have certainly included were they available at the time.

That said, that’s why I have a facebook page for the book [http://www.facebook.com/typescriptrevealed] so you can check up on links for the latest TypeScript articles and this blog so I can give you the heads up on the new stuff and any new github projects out there I would have included had I known of them at the time.

  1. The main one is that the TypeScript Language Service can now read jsdoc comments in your typescript and roll them into the intellisense pop-ups it presents when you hover over a function parameter, class name etc. This will work in much the same way as any XML comments you write in your .NET code augment the intellisense for function calls. If you do include jsdoc comments, you can preserve them during the compilation into javascript using the -c flag for the compiler. There’ll be a separate article up shortly looking at jsdoc as a whole and how it fits into the TypeScript tool chain. 2. The Visual Studio extension for TypeScript now supports Compile-on-Save in addition to the Compile-as-Build-Step functionality it already supported. This works in much the same way as Compile on Save works if you have Mads Kristensen’s Web Essentials 2012 add-in for Visual Studio already installed. You can find the options for CoS by selecting Options>Text Editor>TypeScript>Project from the Tools menu. The compile-on-save functionality has also been improved in the NPM-based compiler when using the -watch flag. (Note I’m not a node.js user so I can’t say by how much). 3. Adding TypeScript as an MSBuild step into existing project has become slightly easier. v0.8.2 now comes with a new MSBuild targets file meaning rather than call the compiler you can express the call as MSBuild XML. The doesn’t make calling the compiler less valid; it just tidies up the MSBuild file. You can find Microsoft.TypeScript.targets at C:Files (x86).0. Again, a full article will be forthcoming shortly, but you’ll find brief details on the TypeScript wiki here. 4. The compiler service can now be replaced in the TypeScript for Visual Studio 2012 plugin.  This makes it easier to leverage the Visual Studio TypeScript extension with newer compiler builds from CodePlex or from experimental forks. Details of how to do this can be found on the TypeScript blog here.

On the jsodc theme, there’s one new github repo that’s worth highlighting which adds a new way to create TypeScript definition files for you. Jsdocts [https://github.com/joshheyse/jsdocts] outputs a definition file based on the jsdoc within a javascript file. Could be useful, although YMMV.

Posted on February 18, 2013   #Geek Stuff     #TypeScript Revealed  

← Next post    ·    Previous post →