Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I dislike that this small gem is written in coffeescript.

https://github.com/rails/turbolinks/blob/master/lib/assets/j...

For various reasons we don't use coffeescript in our projects but now if we want to use turbolinks (which sounds great) we'll get a coffeescript dependency.



Putting the ab initio strangeness of having JavaScript code in a Ruby gem aside -- what it happens to be written in shouldn't be an issue. If the gem is released with the compiled JavaScript inside of it, then it can just be used, without any additional dependency.


I checked, the gem only has the Coffee source, no JavaScript. This frustrates the hell out of me -- clearly the message that you should ship JS is not getting through. When CS can do source maps, ideally people will ship the source, compiled JS and map together.

Having either in a gem is rare, but sensible if the gem wants to include a client to interact with the service it provides.


Good point.


Guys hang on. When Rails assets are compiled all Coffeescript is converted to JavaScript, which is then compressed and minified. So unless you are writing any Coffescript yourselves you will never have to deal with it. Asset pre-compilation has been a Rails feature since Rails 3.1.


Rails already ships with default-on coffeescript.


Yes, like turbolinks it's a default dependency in the Gemfile.

But e.g. jquery-rails https://github.com/rails/jquery-ujs is written in JS not CS, so I can use all the jQuery integration in Rails without using CS.

With turbolinks being written in CS if I want to use the full power of Rails+JS I need to add CS to my project.


or, you could just compile the coffeescript into javascript once and return to your normal javascript flow


You can even write your Javascript in Javascript, it should still work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: