It would be nice if there was a way (or ways) to ease the pain of debugging minimized CSS/JS files.
We've all been there, right? Uncaught exception on Line 2, Column 49,392 of /foo/jquery.min.js, right?
1. For well-known source files (like major jQuery releases, etc) perhaps the debugger could (optionally) switch to the unminimized version. This could be done via file hash comparisons based on a table stored on Mozilla's servers (oh, I see you're using jquery.min.js which has a hash of 498DE248A4B which corresponds to the unminimized file jquery-1.9.1.js on Google's CDN) or perhaps the debugger could just optionally substitute "foo.js" for "foo.min.js" if it exists on the server.
2. For cases when #1 fails, perhaps the debugger could at least pretty-format the source code so that it's not all on a single line of code 30,000 (or whatever) characters long, so that breakpoints could be set.
This is what sourcemaps are for. You can minify your JS files with the Closure Compiler and tell it to create a Source Map. Then tell the developer tools to use that sourcemap and you'll debug looking at the unminified code even if you're running the minified one.
First off, thanks for the link! I up-voted you; that's a really good introduction to source maps.
I believe it would be incredibly useful if FF's dev tools could do some of this on their own; primarily for the reason that the person debugging the Javascript can't always control the build process. The times when you don't have access to the build process and/or the original unminified code are the times when you need this functionality the most.
If you don't have any of those, then I don't see how the developer tools can figure out what the original source is. You need some way of mapping points in the minified file to lines in the original file. Ask your favorite CDN to also host a source map. Otherwise the best the developer tools can do is prettify the minified file, something both Chrome and IE do (I don't recall if Firefox Nightly does).
I agree that source maps are the right solution, but even the ability to pretty-print the indentation and separate statements onto lines would work wonders.
We've all been there, right? Uncaught exception on Line 2, Column 49,392 of /foo/jquery.min.js, right?
1. For well-known source files (like major jQuery releases, etc) perhaps the debugger could (optionally) switch to the unminimized version. This could be done via file hash comparisons based on a table stored on Mozilla's servers (oh, I see you're using jquery.min.js which has a hash of 498DE248A4B which corresponds to the unminimized file jquery-1.9.1.js on Google's CDN) or perhaps the debugger could just optionally substitute "foo.js" for "foo.min.js" if it exists on the server.
2. For cases when #1 fails, perhaps the debugger could at least pretty-format the source code so that it's not all on a single line of code 30,000 (or whatever) characters long, so that breakpoints could be set.