Ruby on Rails 3.1 Released, Brings Assets Pipeline, Streaming, and Javascript Changes
2011-09-05 11:41
441 查看
http://www.infoq.com/news/2011/09/rails-31
A few days ago, the Ruby on Rails team released version 3.1 of the most popular web framework for Ruby, almost exactly
one year after their last major release of Rails 3.0. These are the highlights of the release:
Assets Pipeline
Streaming
Reversible Migrations
jQuery as the default JavaScript library
The assets pipeline is the major change in Rails, and there's a complete guide that describes how it can be used and what it does:
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB.
The assets pipeline was also the topic of David Heinemeier Hansson's RailsConf talk.
Streaming means that Rails now supports HTTP streaming, which is also known as chunked transfer encoding. The advantage
of streaming is that the web server can start transmitting the response before it has been fully computed. The Rails team explains the benefits of streaming in
their blog:
Streaming doesn't cut latency, neither it cuts the time a dynamic response needs to be generated. But since the application sends content right away instead of waiting for the whole response to be rendered, the client is able to request assets sooner. In particular,
if you flush the head of an HTML document CSS and JavaScript files are going to be fetched in parallel, while the server works on generating content.
The consequence is that pages load faster.
There's also a Railscast that explains how to set up streaming for a Rails application.
Rails has supported down migrations for a long time, so why are reversible migrations new? Until now,
you always had to write the down-migration yourself, but Rails 3.1 can now do this for you. Rohit
Arondekar explains how the magic works:
Basically if you define a change method [instead of up and down methods as before] in your migration and are applying the migration then the commands are executed as normal. However while reversing the migration, the commands are recorded and a list of inverse
commands is generated and run. Inverse commands are simply commands that perform the opposite of the original command.
These are only some of the changes in Rails 3.1, there are dozens more in the detailed release notes for you to discover. For example,
a configuration option to force SSL has been introduced. To see if your plugins are already working with 3.1, check out and
contribute to railsplugins.org.
Do you plan to upgrade your applications? Austin Hughey has some advice in his article on The H.
A few days ago, the Ruby on Rails team released version 3.1 of the most popular web framework for Ruby, almost exactly
one year after their last major release of Rails 3.0. These are the highlights of the release:
Assets Pipeline
Streaming
Reversible Migrations
jQuery as the default JavaScript library
The assets pipeline is the major change in Rails, and there's a complete guide that describes how it can be used and what it does:
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, Sass and ERB.
The assets pipeline was also the topic of David Heinemeier Hansson's RailsConf talk.
Streaming means that Rails now supports HTTP streaming, which is also known as chunked transfer encoding. The advantage
of streaming is that the web server can start transmitting the response before it has been fully computed. The Rails team explains the benefits of streaming in
their blog:
Streaming doesn't cut latency, neither it cuts the time a dynamic response needs to be generated. But since the application sends content right away instead of waiting for the whole response to be rendered, the client is able to request assets sooner. In particular,
if you flush the head of an HTML document CSS and JavaScript files are going to be fetched in parallel, while the server works on generating content.
The consequence is that pages load faster.
There's also a Railscast that explains how to set up streaming for a Rails application.
Rails has supported down migrations for a long time, so why are reversible migrations new? Until now,
you always had to write the down-migration yourself, but Rails 3.1 can now do this for you. Rohit
Arondekar explains how the magic works:
Basically if you define a change method [instead of up and down methods as before] in your migration and are applying the migration then the commands are executed as normal. However while reversing the migration, the commands are recorded and a list of inverse
commands is generated and run. Inverse commands are simply commands that perform the opposite of the original command.
These are only some of the changes in Rails 3.1, there are dozens more in the detailed release notes for you to discover. For example,
a configuration option to force SSL has been introduced. To see if your plugins are already working with 3.1, check out and
contribute to railsplugins.org.
Do you plan to upgrade your applications? Austin Hughey has some advice in his article on The H.
相关文章推荐
- Ruby on Rails 使用mysql数据库 use local and remote mysql in development production environments in Ruby o
- 【转】Rails 3.1错误-Could not find a JavaScript runtime及execjs和therubyracer介绍
- Ruby on Rails 3.1的新特征将使你的程序运行更快
- 在rails3.1使用assets pipeline with compass
- Ruby on Rails for PHP and Java Developers
- Homebrew, Ruby, and Rails on OS X 10.10
- [导入]Produce GIF or PNG barcode images from a Ruby on Rails application using RMagick and Gbarcode
- guides.rubyonrails.org 读书笔记(十): Layouts and Rendering in Rails
- Ruby and Ruby on Rails介绍
- Rails 3.1 execjs and Could not find a JavaScript runtime
- Ruby on Rails: Up and Running
- ruby and ruby on rails
- ruby on rails and so on
- OReilly.Ruby.on.Rails.Up.and.Running
- Installing RVM, Ruby on Rails, and Passenger on Centos 6
- 如何理解ruby on rails中的asset pipeline
- Javascript + Ruby on Rails: 提交上传文件之前检验文件类型
- Ruby On Rails--Layouts and Rendering in Rails(布局和页面渲染)
- Installing Ruby and Railswith RVM on Fedora 14
- 搭建ruby on rails(3.1)之安装gem mysql2