Every asset a web browser requires needs a separate connection. If it's
possible to include all JS in one file and all CSS in another file the
browser only requires two connections. If the JS and CSS are broken into
multiple small files the browser must create many separate connections
to get them all.
AFAIK this is the primary reason the default convention in Rails is to
compile all JS and CSS files together in a single resource for each.
When adding gzip this method can significantly improve performance.
> On ActiveAdmin screencast, I saw that a solution is to remove
> "require_tree" and then convert the application.css to sass and then:
Framework code that contains it's own JS and CSS should really be
name-spaced in such a way as to not interfere with your own custom code.
That's not to say that all of them do so.
JavaScript and CSS are not natively name-spaced. Just having the code in
separate files will not prevent namespace collisions.
--
Posted via http://www.ruby-forum.com/.