How do you use CoffeeScript? It need to be compiled, so – you write code in CoffeScript, compile it, and insert real JavaScript on your site?
Doesn’t it take a lot of time? Or is there some another way?
P.S. I’ve seen another way – to insert in development stage coffeescript in text/coffeescript script-tags with coffeescript.js library (about 150k), and compile only for production version and insert real Javascript.
The answer is yes, you compile it and include the generated JavaScript on your side.
If you’re using a web framework (rails, django etc) you should take a look at the following list of coffeescript plugins: https://github.com/jashkenas/coffee-script/wiki/Web-framework-plugins. They will compile your coffeescript to javascript when you deploy your app to a server.
Using the coffee-script plugin with the
text/coffeescripttags is another option, gzipped and compressed, its only about 39kB, but that can add up if you include it on pages that get many hits and I don’t think is a good idea when you can compile the coffeescript to javascript yourself without needing the plugin.There is the middleman plugin which will lets you work with CoffeeScript during development, then compile and minify it for deployment.