Yes of course merging and minifying JS CSS is a good practice, but the
main question is to know if it's better to load all the web app JS code in
each page or to only load the specific code required by the current page.
On Fri, Dec 17, 2010 at 09:21, Christophe Porteneuve
On Fri, Dec 17, 2010 at 7:21 PM, Christophe Porteneuve
t...@tddsworld.comwrote:
FYI, Sprockets is another concatenation tool that handles requires,
constants, etc. It also binds to YUI::Compressor for efficient minifying of
the compiled source. And it can be easily used in any context:
It's a really good question but I don't know if there is a good answer.
I prefer to have one file with common functions for all my pages and use
multiple JS files (and multiple CSS files) for specific behaviour. It's
easier to develop and debug because there is no file with thousands of
lines,
Concerning the 1 file vs many files, one common approach is to combine your
files on production but develop the files separately. You can use Squishit
(http://www.codethinked.com/post/2010/05/26/SquishIt-The-Friendly-ASPNET-JavaScript-and-CSS-Squisher.aspx)
for an asp.net site and it will even