From: Girish N. <get...@gm...> - 2016-10-18 23:54:28
|
I would suggest to keep the code beautifully formatted and adding as much comments needed which will be helpful to developers. Generally the practice is to minify the js/css files and generate filename-min.js/filename-min.css, this can be committed along with the original one for every build, Also, there should be an easy way to switch between the non-minified/minified version. Some useful tools to minify: https://github.com/tedious/JShrink https://github.com/mishoo/UglifyJS2 http://yui.github.io/yuicompressor/ http://www.crockford.com/javascript/jsmin.html There are many more... On a production server these optimizations can be used: Enabling gzip compression on the webserver(Apache/nginx) etc will reduce the overall download size for all files: js, css, html etc. http://howtounix.info/howto/Apache-gzip-compression-with-mod_deflate Configure the pagespeed module (by Google) https://developers.google.com/speed/pagespeed/module/ Compression results from the JShrink doc: Raw - 586,990 Gzip - 151,301 JShrink - 371,982 JShrink and Gzip - 93,507 hope this info is useful. Girish, InfraStack-Labs.com On Wed, Oct 19, 2016 at 3:29 AM, gilberto dos santos alves <gs...@gm... > wrote: > +1 from me to min javascripts. documentation must be inside manuals. see > refs about on javadocs that is large used. restructured text like sphinx > could be used to build php python java c++ or any other language. see that > current texts inside weberp sources already can be handled for this. > it is like .pot and .mo files for translations. > uml diagrams could enhance docs for devellopment. > regards. > > Em 18/10/2016 16:15, "Rafael Chacón" <raf...@gm...> > escreveu: > > Hi, > > Recently, I updated the file MiscFunctions.js. I added comments and > improve the format. Now it is more easy to understand the code. > > But it has a big disadvantage: Each html page generated by the webERP > loads that file through ~/includes/header.inc. That is: if we add comments > and reformat the code to make it very easy to understand, we increase the > traffic of that file to about 239% (more comments and spaces in formatting > code). > > Someone say me that he prefers a minimum file size to prioritise the > principle "low footprint" (absolutely minimal network traffic) over to > "easily readable", because this file is modified infrequently. That is: to > have a MiscFunctions.js without comments (explanations) and put them in the > manual. Also, to remove the spacing for easy reading. > > I agree. But, if we are strict, that "minimising" principle should apply > to all JavaScript, CSS and HTML code. > > Comments? Opinions? > > Best regards, Rafael. > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > |