Sprockets: A Ruby-powered JavaScript dependency library from 37signals

Tháng Hai 21, 2009

Source: http://www.rubyinside.com/sprockets-a-ruby-powered-javascript-dependency-library-from-37signals-1520.html

Managing and organizing multiple JavaScript files in your Rails applications can be a real pain, especially when it comes to deploying your application and you need to minimize those JavaScript files down for better application performance.

Enter Sprockets, the new dependency management and concatenation library from 37signals (or, more specifically, Sam Stephenson). Once installed, Sprockets allows you to organize your application’s JavaScript files into smaller more manageable chunks that can be distributed over a number of directories and files.

Using directives at the start of each JavaScript file, Sprockets can determines which files your current JavaScript file depends on. When it comes to deploying your application, Sprockets then uses these directives to turn your multiple JavaScript files into a single file for better performance.

Sprockets also allows you bundle assets with your JavaScript, as well as allowing you to insert string constants in your JavaScript files, using a YAML file.

Sprockets is available as a Ruby gem or as a Rails plugin. The Sprockets source code is also available on GitHub.


Trả lời

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Đăng xuất / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Đăng xuất / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Đăng xuất / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Đăng xuất / Thay đổi )

Connecting to %s

%d bloggers like this: