A Conscious Trade-off
Debuggers and Compressors
Firebug, WebKit Inspector provide some traditional debugging tools; you can set breakpoints, and do the usual step-through process. There are serious limitations.
java -jar yuicompressor-x.y.z.jar -line-break 0
However, the FireBug debugger / Yahoo Compressor combination is broken as follows.
- Separate logical statements end up on the same line.
- Breakpoints stop at declaration time.
Function declarations and the first statement or two in their closures are on the same line. Whereas the developer intends to stop on a line in the function at runtime, FireBug will stop when the script loads.
- Convenient Watches unusable.
Normally you may hover cursor over a variable name, to see its value. This feature becomes difficult to use.
- Breakpoints on extremely long lines are unusable...
...unless you can scroll sideways, and follow the bouncing highlighter.
One complex object declaration became a string of 8000+ characters with no line feeds! This appears to be a side-effect of Yahoo's 1-linefeed-per-semicolon approach; the statements in an object literal are comma-delimited.
Next, I'll explore some alternatives.