Foxandxss wrote in post #1046631:
> maybe Im asking too much, but I want you, Rails developers to share your
> assets pipeline configurations.
>
> Im really loving Rails but some things doesn't fit in my head and I need
> solutions (this perfectionism will kill me someday :P)
>
> Is not THAT bad having all CSS and all JS compressed into one file (I
> think that having an import on every erb is not that bad). The problem
> is when you have third party css like ActiveAdmin's one that conflict
> with your own CSS.
>
> I think that the default options are not the best, just a starting.

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/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to