If you want to output javascript that looks more familiar to what we're used to dealing with in D7 try this:
(($) ->
Drupal.behaviors.test = attach: (context, settings) ->
$("test").hide()
return
return
) jQuery
becomes (use the bare option, -b)
// Generated by CoffeeScript 1.6.3
(function($) {
Drupal.behaviors.test = {
attach: function(context, settings) {
$("test").hide();
}
};
})(jQuery);
It's not perfect since we still need the bare option, but it outputs what I'm used to seeing, and probably what most everyone else is too.
Comments
Comment #1
mike.roberts commentedAlso I wasn't sure what to mark this as. I guess support request doesn't really work though, so changing to feature request to possibly add the bare option to the PHP compiling step and to update the documentation.
Comment #2
mike.roberts commentedHere's a patch to get the ideas flowing, not sure how well it'll actually work.