3 ms·
I'm hesitant to give up on Jammit, but asset pipeline looks great.
by dmix 15y ago
I'm hesitant to give up on Jammit, but asset pipeline looks great.
- davidcuddeback 15y agoSame here. I've been trying out the 3.1 RCs, and I think the asset pipeline has some potential, but I haven't found a replacement for Jammit's JST compilation. (Although I haven't looked very hard. I'm sure there's a solution out there.)
- gnufied 15y ago"Sprockets supports JavaScript templates for client-side rendering of strings or markup. JavaScript templates have the special format extension .jst and are compiled to JavaScript functions" From sprocket README. Although, I have switched to Rails 3.1 and I am not using asset pipelining at all, just sticking with jammit.
- sstephenson 15y agoSprockets includes Jammit-inspired JST support. You can use it with either EJS or Eco templates. See the "JavaScript Templating" section of the readme: https://github.com/sstephenson/sprockets#readme https://github.com/sstephenson/sprockets#readme You can even write your own JST template class. Here's an example that adds Mustache template support: https://github.com/josh/mustache-trimmer/blob/master/lib/tilt/mustache_js_template.rb https://github.com/josh/mustache-trimmer/blob/master/lib/til...
- davidcuddeback 15y agoCool, thanks! I can't wait to try that out.
- angryasian 15y agocan anyone point me, where I can read a comparison on Jammit vs asset pipeline/sprocket or could you offer your opinions. thanks
- jashkenas 15y agoThe 3.1 asset pipeline is great stuff ... but if anyone currently using Jammit is leaning towards switching to the asset pipeline -- for any reason other than it's the default in Rails 3.1 -- I'd be curious to hear about why. I'd like to keep developing Jammit as an alternative approach, as there are differences in philosophy: explicit asset packages vs. in-file dependencies, for example.
- nixme 15y agoJammit has worked extremely well paired with Barista+Compass, but for a Backbone-heavy app where templates are shipped client-side, it's nice to tack on '.erb' at the end of a template file and use Rails asset helpers for cache-busting and asset host url construction.
- jashkenas 15y agoJammit should already be playing well with Rails' built-in cache busting, although I imagine that the situation might change with 3.1's new fingerprinting. As for having to pipe "static" JS and CSS files through ERB ... I've always thought that was something best avoided by choice, unless absolutely necessary.