#RailsConf starts for real with Chad Fowler from Living Social and Ben Scofield from Heroku at the podium. They start with a few questions. They discover there are many new attendees, and a few all the way back from 2006. Also, many were sent by their companies. Yay!
A few annoucements… BohConf is said to be the un-conference to end all un-conferences. RSVP for the Change.org happy hour tonight. Later on attend Ruby Heroes awards and Bird of a Feather (BOF) sessions.
Video presentation for DonorsChoose.org, whose mission is to change the world for a child. Every badge holder includes a $25 gift card to get started donating. Not sure how that works yet…
Chad and Ben introduce David Heinemeier Hansson (DHH), creator of Rails. He’ll focus on features new to Rails 3.1, in particular Asset Pipeline.
He was unhappy with the many javascript files used in BaseCamp. They’re useful, but were a javascript junk drawer that needed to be managed better. His rule of thumb “> 13 = :-(“! javascript_include_tag solved the problem of loading the files quickly for the user, but didn’t improve management of the codebase.
The solution in Ruby on Rails 3.1 is to add app/assets, lib/assets, and vendor/assets empty folder. Each contains folders for images, stylesheets, and javascripts. This structure creates a place for everything.
Bundler will assist in management of assets from gems and plugins. For example, the jquery-rails gem version will be managed in Gemfile. Oh BTW, jquery-rails is the new default for Rails, but switching back to Prototype is as easy as saying gem ‘prototype-rails’. Things such as Blueprint CSS could be bundled up and manged this way as well. No mention of if there’s a gem yet.
The change in javascript and the inclusion of CoffeeScript has generated lengthy and passionate discussion on GitHub. DHH recommends reading the thread, but also encourages participants to “chill the fuck out”.
CoffeeScript is a language that compiles into javascript, with somewhat less code written.
Sass is also included in Rails 3.1. It’s a pre-processor for stylesheets, and was created alongside HAML, which DHH has not embraced. Sass looks much like CSS, but includes variable and nesting. It can be combined with erb to use Ruby in Sass to write CSS. Nice!
DHH emphasizes that Rails will continue to include defaults. You don’t have to stay with the defaults! Sass and CoffeeScript are included in the Gemfile, but not in the Rails gem dependencies.
There is a new rake task called assets:precompile to help performance. Compiled assets filenames include an MD5 hash instead of tagging a request with a timestamp. The is less disruptive to deploy and works better with caching. JS and CSS compression now happen automatically.
Rails 3.1 Release Candidate will appear THIS WEEK during RailsConf.
DHH moved quickly through a few other topics.
BaseCamp mobile is now using Cinco. Backend uses Rails as an API. Frontend uses JavaScript with it’s own MVC framework. DHH fears this won’t promote good integration between frontend and backend long term. More to the point, he feels it promotes separate teams. node.js is another possibility, but not attractive to DHH.
Pjax is used to render new content in your page frame without re-rendering the layout, resulting in a speed increase. DHH is already using it, and expects to include it in Rails at some point.
Backbone.js is used for javascript heavy apps to create MVC-ish data structures in the browser and coordinate well with your existing app.
That’s it.





