← Back to team overview

launchpad-dev team mailing list archive

launchpad.js development

 

Revision 12584 in devel brings a much simplified mechanism for
building launchpad.js. I noticed recently that it was no longer
possible to build a non-minified launchpad.js (bug 733230. Trying to
unravel the issue was quite frustrating mainly because jsbuild
contains a lot of magic.


What this change means for you
------------------------------

In development (i.e. where LPCONFIG=development), launchpad.js is
built non-minified by default. *All* of it, including YUI and lazr, so
you can debug. In all other environments launchpad.js is built
minified by default.

To force a minified build:

    make JS_BUILD=min clean_js jsbuild

To force a non-minified build:

    make JS_BUILD=debug clean_js jsbuild

Values of JS_BUILD other than "min" and "debug" are possible in
theory, but you get to keep the pieces.


The not-so-gory details
-----------------------

Merge proposal: http://goo.gl/rliW9

The merge proposal contains some more details, repeated here:

* utilities/lp-deps.py has been dropped, which means that
  lazr.js.build.Builder is no longer used to generate the minified .js
  files from the lib/lp tree. Obtaining the list of in-tree javascript
  and minifying it is now done in just a few lines in Makefile.

* bin/jsbuild is still used to generate lazr.js, and to copy YUI into
  the right place. However the call to do this now respects the
  JS_BUILD variable. This can be set to "min" or "debug" to select the
  type of file you want. It is set automatically to "debug" in
  development and "min" everywhere else.

* utilities/yui-deps.py has been changed to (optionally) accept a
  command line argument of "min" or "debug". This means we can select
  a minified or debug version of YUI when building launchpad.js.

* The build targets have been set up such that conditional rebuilds of
  launchpad.js work; if no javascript file in the tree has been
  modified, launchpad.js will not be regenerated.

* Everything put together means that, by default, *nothing* in
  launchpad.js will be minified in development, and everything will be
  in other environments.



Follow ups