Page view counter
Standard multi-line Silverlight.js? Recommend Javascript reformatter?
Last post 10-21-2007 12:52 PM by petemounce. 3 replies.
Sort Posts:
10-14-2007 2:08 PM
Standard multi-line Silverlight.js? Recommend Javascript reformatter?

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

Alan Cobb

Loading...
Joined on 04-30-2007
Northern California, USA
Posts 183
10-14-2007 3:17 PM
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?

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). 

petemounce

Loading...
Joined on 08-14-2007
Posts 90
10-20-2007 11:46 PM
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?

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

Alan Cobb

Loading...
Joined on 04-30-2007
Northern California, USA
Posts 183
10-21-2007 12:52 PM
Re: Standard multi-line Silverlight.js? Recommend Javascript reformatter?

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?!)
 

petemounce

Loading...
Joined on 08-14-2007
Posts 90
Microsoft Communities