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?
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).
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.
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?!)
Alan Cobb
Member
479 Points
208 Posts
Standard multi-line Silverlight.js? Recommend Javascript reformatter?
Oct 14, 2007 06:08 PM | LINK
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 Cobb
www.alancobb.com
petemounce
Member
174 Points
90 Posts
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?
Oct 14, 2007 07:17 PM | LINK
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).
Alan Cobb
Member
479 Points
208 Posts
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?
Oct 21, 2007 03:46 AM | LINK
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 Cobb
www.alancobb.com/blog (Silverlight blog)
-------------------------------
Come see my Silverlight Debugging presentation at:
Silicon Valley Code Camp Oct 27/28
petemounce
Member
174 Points
90 Posts
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?
Oct 21, 2007 04:52 PM | LINK
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?!)