From: Bill Erickson Date: Mon, 16 Dec 2013 16:51:35 +0000 (-0500) Subject: web staff: log minification X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7e9ef36ba1cdfaea3e2c75fd97e9e95bcd3f154f;p=working%2FEvergreen.git web staff: log minification Signed-off-by: Bill Erickson --- diff --git a/web-staff-log.txt b/web-staff-log.txt index 7cb7577f56..4605d2ce09 100644 --- a/web-staff-log.txt +++ b/web-staff-log.txt @@ -1102,6 +1102,60 @@ the story develops.... break and flow (e.g. for mobile devices) a little too aggressively right now. TODO. +2013-12-16 JS Minification +-------------------------- + +Angular has some built-in magic which forces us to take special care when +preparing for Javascript minification. For the details, see the "A Note +On Minification" section of the +http://docs.angularjs.org/tutorial/step_05[Angular Totorial Docs]. Briefly, +there's a short (auto-magic) way and a long way to declare dependencies +for services, controllers, etc. To use minificaiton, you have to use the +long way. To make sure everything is working as expected, I've set up +a test. + +Testing Minification +~~~~~~~~~~~~~~~~~~~~ + + * Download jar file from https://github.com/yui/yuicompressor/releases[YUICompressor Releases] + * Create a staff.min.js bundle from commonly loaded files: + +[source,sh] +----------------------------------------------------------------------------- +% cd /openils/var/web/js/ui/default/staff + +# note the files have to be combined in a specific order +% cat /openils/var/web/js/dojo/opensrf/JSON_v1.js \ +/openils/var/web/js/dojo/opensrf/opensrf.js \ +/openils/var/web/js/dojo/opensrf/opensrf_xhr.js \ +services/core.js \ +services/idl.js \ +services/event.js \ +services/net.js \ +services/auth.js \ +services/pcrud.js \ +services/env.js \ +services/org.js \ +services/startup.js \ +services/ui.js \ +navbar.js \ +| java -jar yuicompressor-2.4.8.jar --type js -o staff.min.js +----------------------------------------------------------------------------- + + * modify /openils/var/templates/staff/t_base_js.tt2 + ** comment out +----------------------------------------------------------------------------- + + * Reload the page. + +I'm happy to report all pages load successfully with (mostly) minimized JS. +Next on the minification front would be baking minification into the +release-building process. + Future Topics... ----------------