Is there an easy way to step through TypeScript compiler (tsc.js) and observe how it works?
1 Answer
One way is to use Windows Script Host with //x key. You need Visual Studio installed, and you can't use source maps to debug over the original source.
Another way is to debug it in Node.js using tools like Nodeclipse or similar.
The easiest way is to debug it using Developer Tools embedded in any modern browser. There is a web page emulating platform IO and allowing to run TSC over it: http://mihailik.github.com/tsc.browser/
4 Comments
Sebastian
So Typescript compiled Javascript actually works in WSH.exe? Thats so awesome.
Marty Pitt
Is the tsc.browser project still active / moved? The link provided 404's.
Oleg Mihailik
It's been discontinued and I am redoing it in a full-blown IDE now. See at mihailik.github.com/teapo.
KnarfaLingus
This may have worked in past, but with TypeScrpt 1.0.1, I tried using WSH+Visual Studio 2013, but it didnt work for me. I don't think it will work without some polyfills specifically Array.prototype.forEach() and Array.prototype.map(), JScript isn't ECMAScript 5 compliant AFAIK. Also with some polyfills added, I then ran out of stack space. I wound up using nodejs, installing and editing the typescript module and adding console.log() in places of interest. I am sure Eclipse would have worked but I know from experience that would have taken a while to install.