I have been working for several months on a RoR project with student students. I am responsible for part of the interface and assets, and I wondered how to use Sprockets in a better way .
The point of existence of the asset pipeline is to increase productivity in terms of page load time. A way to create a Rails application is to put all the stylesheets and javascripts in two compressed files.
But when the volume and complexity of the application grows, IMHO becomes a bad idea, as the all-in-one file size grows, and there may be problems with overlapping CSS rules or scripts that are looking for the element and not find it, making the entire part of the javascript page page crash.
Note. . I know that with good coding rules and agreement between the team, the occurrence of these problems can be reduced, but not to 0.
Am I right with these statements so far?
If positive, what is a good way to handle large projects without serving a lot of rules or scripts that are useless for page size, without losing the benefits of multiple assets to send to the client?
My current approach is to define a set of all-in-one files, one for each “context area” of the application. So basically I'm trying to send 2 + 2 files.
But then how to handle such cases:
, , . , CSS3 javascript.
. ?
, ?
, , - . - (?) , , , . , javascript_include_tag , .
, - ? ? , ? ?
.