Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Standard multi-line Silverlight.js? Recommend Javascript reformatter?
3 replies. Latest Post by petemounce on October 21, 2007.
(0)
Alan Cobb
Member
447 points
198 Posts
10-14-2007 2:08 PM |
Hi,
The normal 8KB Silverlight.js is formatted as one long line, presumably for faster downloading. But it is hard to read and single-step through with a debugger. There was a more readable 370-line, 14KB version in the 2007-07 SDK. Is there an official multi-line version of the latest Silverlight.js somewhere?
I realize you aren't supposed to modify the functionality, but for temporary reading and single stepping a conventional file is nice.
This brings up the general issue of code reformatters / beautifiers. Anyone have a favorite for Javascript to recommend?
Thanks,
Alan Cobbwww.alancobb.com
petemounce
174 points
90 Posts
10-14-2007 3:17 PM |
I've successfully used Dean Edwards' Packer (but it makes me add ; where they're strictly-speaking unnecessary), and, more recently, Julian Lecompte's YUI Compressor (which, like Dojo ShrinkSafe, is based on Mozilla's JavaScript parser, I gather).
10-20-2007 11:46 PM |
Hi Pete,
Thanks for turning me on to those compressor/minifier programs.
Actually, I wanted to go in the reverse direction to that. That is, reformat the stock compressed 1-single-huge-line Silverlight.js into something debuggable. I ended up using a free trial of the Polystyle code reformatter and some hand editing. I wrote a blog post about it and have my reformatted, more-debuggable Silverlight.js available for anyone else who wants to download it.
Alan Cobbwww.alancobb.com/blog (Silverlight blog)-------------------------------Come see my Silverlight Debugging presentation at:Silicon Valley Code Camp Oct 27/28
10-21-2007 12:52 PM |
Sorry, completely mis-read you!
Aptana is just now beginning to work on code-formatting, though I haven't played with it much yet. That's what I use for all my web-development, except for the parts where CSharp is involved (where the hell is the hash key on a Mac US keyboard?!)