Closed dmix closed 12 years ago
It is definitely something I would like to have in Dieter. I have not attempted to run coffeescript in rhino but I've seen that some people have had older versions running. Check out resources/vendor/less-wrapper.js for an example of how I was able to read a file from javascript. I'm also willing to help you out if you get stuck.
I'm trying to include haml-coffee, which requires both haml and coffeescript. It seems like this might be doable if instead of parsing using rhino (which is dead-ish I think), we use command-line programs from node to process it (somewhat like Rails programs do). What do you think?
Oh, here's the project I need to include: https://github.com/9elements/haml-coffee
I think the ruby asset pipeline is a much more complicated than running node via command line. It depends heavily on ExecJS which converts JS code into ruby objects: https://github.com/sstephenson/execjs
Although compiling the coffee files via command lien is relatively straightforward. The big question is it worth implementing vs compiling coffeescript the traditional way.
@dmix Ah, I'm not suggesting something that complex at all. Merely compiling the templates using programs installed via npm
, and then possibly a lein assets:precompile
to eagerly do the compilation.
Ah, never mind the precompilation, looks like rails_assets_coffee shows it can be done using rhino, for example: https://github.com/netzpirat/haml_coffee_assets/blob/master/lib/haml_coffee_assets/haml_coffee.rb. Am working on this now.
Implemented in #2
Would it be difficult to add coffeescript support?
I'm willing to give it a shot if its relatively straightforward.
CS depends on node for compilation though.