Comments (4)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 587Q_Achim_Staebler commented Permalink

Great article Jim, thanks for taking the time to write this up!

One thing I would like to add is that IMHO it is viable to minify/compress Javascript code when you're developing for the Web as it reduces request size and/or number. However for Worklight Apps it complicates your build process and does not really provide a significant performance gain since the application archive including all its assets is already compressed. Hence, my preference would be not to do any minification. And then there's also code uglification/obfuscation, which is yet another story.

2 Jim Zhang commented Permalink

thanks for the feedback sta. Packaged apps like those based on phonegap is definitely different than web based deployment, as you pointed out, but I think the jury is still out on whether minification is going to benefit even packaged apps. My colleagues in IBM are working with customers using Dojo to build Worklight apps that are fairly significant in size, and their preliminary finding points to improvements with minfied code. I suspect this is a function of the size of the javascript code base.

Also worth pointing out is some of the special features in dojo builder that is beyond compressing texts, for instance the ability to remove dead code branches to actually reduce the amount of javascript code in the minified layers.
For the developers who don't have a need to produce minified code, step 2 becomes a workflow to discover what your application actually needs from dojo and copy those files into the project. In Firebug or Web Inspector you can sort the network requests by domain and get an accurate account of what dojo pieces are being downloaded from the remote URL, then move them into the app.

3 mirv commented Permalink

Good article.

Does this still work for Worklight V6?

4 Jim Zhang commented Permalink

Worklight 6 incorporated the technique described in this blog so you should get this workflow out-of-box with Worklight Studio 6.0