TypeScript Bundle Transform for ASP.NET

Last week, Microsoft announced TypeScript, a superset of Javascript that adds strong typing, interfaces, classes, modules and lambda expressions. If you have not heard of it, their website has a tutorial and playground. If you have some more time, there is a very good video overview by Anders Hejlsberg on Channel 9 (embedded below).



The response to this new language seems to be mixed. I largely agree with the opinions expressed in this article: Thoughts on typescript.

An interested fact about the open source TypeScript compiler is that it is written in TypeScript. This compiler translates TypeScript to plain Javascript.

When I first read about TypeScript (yesterday), I immediately started looking for an IBundleTransform implementation that runs the TypeScript compiler. I did not find any implementations, so I decided to write one myself and put it on GitHub and NuGet.

The only available compiler is written in TypeScript itself (so you can compile it to Javascript) and I did not quite have the time to translate the entire compiler to C#, so I needed a way to execute Javascript in C#. I know I could have used Microsoft's Chakra Javascript engine, but that would have introduced a dependency on having Internet Explorer installed on your server. I ended up using Google's V8 Javascript engine, which I could bundle with the project.

Enjoy!

Comments

Popular posts from this blog

Mobile Vikings App for Windows Mobile v2.0

Mobile Vikings App for Windows Mobile

The best hosting offer you've ever seen