← Back to team overview

launchpad-dev team mailing list archive

Re: Javascript impossible to debug

 

On 11-01-31 11:18 AM, Deryck Hodge wrote:
On Sun, Jan 30, 2011 at 8:23 PM, Tim Penhey<tim.penhey@xxxxxxxxxxxxx>  wrote:
Hi Team,

Right now the default behaviour of our build system is to produce javascript
that is impossible to debug as it minifies everything.

How can we fix this?


Long term the right solution is to get a combo loader going, one that
can be run locally in addition to the central Canonical one.  The
local one could then link non-minified files.

Until then, it's probably worth making the jsbuild step sniff for
devmode and not link the minified files.  So launchpap.js would be
larger, but you could step through the code better.  I'm not sure what
the performance impact on development would be of this approach.


You may want to try linking the raw unminified files when building Launchpad's scripts. At least the source will be readable.

Untested, but should work:

 $ make clean_js
 $ make jsbuild JSFLAGS='--filetype=raw'


This passes a command-line argument into the lazr-js JavaScript build script that changes the input files it selects.

You can find the list of bin/jsbuild arguments by running 'bin/jsbuild --help' or by checking the sources under eggs/lazr_js-1.5DEV_r191-py2.6.egg/lazr/jslazr/js/build.py.

Maris


--
Māris Fogels -- https://launchpad.net/~mars
Launchpad.net -- cross-project collaboration and hosting



Follow ups

References