Skip to main content

Microsoft Silverlight

Standard multi-line Silverlight.js? Recommend Javascript reformatter?RSS Feed

(0)

Alan Cobb
Alan Cobb

Member

Member

447 points

198 Posts

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

petemounce
petemounce

Member

Member

174 points

90 Posts

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

Alan Cobb
Alan Cobb

Member

Member

447 points

198 Posts

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

petemounce
petemounce

Member

Member

174 points

90 Posts

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

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities