Any browser. Any host. Any OS. Open Source.
Unfortunately, TypeScript is painfully slow at compiling in OS X. Hopefully this gets fixed eventually because from what I’ve read, CoffeeScript doesn’t have this problem.
Or if you want to actually install it, the TypeScript compiler is just a Node.js package, which makes the setup super easy.
npm install -g typescript
This will install tsc, the TypeScript compiler.
Here’s how TypeScript works;
- Write your TypeScript in a file with a .ts extension
- Send your ts file through tsp with the command tsc myfile.ts
Visual Studio Plugin
I believe Web Essentials can do everything the TypeScript plugin can do, but don’t quote me on that, since I haven’t looked to deeply into it.
There’s also support for TypeScript in WebStorm/IntelliJ. There’s a detailed blog post from JetBrains here. It works essentially the same as the VisualStudio plugin.
In WebStorm, everything just works (from what I’ve read), but in IntelliJ, it takes a little work.
- Make sure you have Node.js installed
- Make sure you have run npm install -g typescript
- Make sure you have the following plugins installed and enabled in IntelliJ
- File Watchers
I know this one may seem a little off topic, but I’m a fan of Vim. If I just need to make a small change and I don’t have my IDE open, Vim opens a lot faster.
There’s emacs, vim and sublime plugin information here.
If you’re using Vundle for your Vim plugins, you can just add the following plugin to your vimrc
If you’re not using Vundle, you should be.
The Vundle plugin has the official plugin, and it also provides support for :make from within a ts file.
This makes it so you never have to leave vim to run the compile command manually. Additionally, you can make it automatically make ts files on save by adding the following
autocmd BufWritePost *.ts make
Just keep in mind that by doing so, it will slow down your :wq but this is a small price to pay for not having to remember to make your files manually.