How do keep JS untouched

Oct 18, 2010 at 1:56 PM
Edited Oct 18, 2010 at 1:57 PM

Hi,

Im using the YUI Compressor for .NET and everything is working fine, except for 1 little thing. I would like to combine all my files, not minified or obfuscated, leaving the breaklines and more importantly, leaving the tabulations there. 

Ive managed to do all of the above, except for my code indentation that gets scrapped..

Thanks,

Rafael

Coordinator
Jan 17, 2011 at 11:09 PM
Edited Jan 17, 2011 at 11:10 PM

Hi Rafael - sincere appologies for the extremely late reply.

I'm not sure I can keep the indentation, unfortunatley. If the source Java code does that, then I can do that. Otherwise, no can do. The minification process is really weird stuff (read: sometimes a bit too confusing for me) so i'm not going to start to go in and tweak the minification code. More importantly, this is trying to be a PORT of the original source code. So if it's not in there, then I'm not going to spend some time doing it.

Now the question I have is this: WHY?

When we minify, obfuscate and combine, we're basically saying this: I have some code. I like that code. It's ready for people to use it. I want to get rid of as much 'bloat' as possible to keep the file size nice and small. As such, it shouldn't be used by humans to read, but by computers. Therefore, i don't want it to look pretty because then i've added some bloat. So, little YUICompressor library -> got nuts and squish and obfuscate and combine away!!! 

If you just want to combine files, then you can do that with some other methods available (out of scope of this project). Remember, this project is aimed at getting things SMALL. and for COMPUTERS, not humans. So maybe this project isn't the right one for your needs?

Jan 17, 2011 at 11:25 PM
Hi,

I understand what you mean. My intention was purely for devlopment purposes and I'm still wondering about a few things. Its hard to find best practice rules for development using javascript frameworks and visual studio. The .NET yui compressor is doing exactly what I want it to do in production, minify and combine everything (a pain though for file ordering). My problem is development. Visual studio 2010 supports translation files for multiple web.config (debug, staging or release), VS 2008 doesn't and that's what I'm stuck with. For a large application, do you have any suggestions for development using YUI compressor (switching between).

Thanks,
Rafael

Sent from my BlackBerry® smartphone


From: "purekrome" <notifications@codeplex.com>
Date: 17 Jan 2011 16:09:59 -0800
To: <rabelanger@gmail.com>
ReplyTo: YUICompressor@discussions.codeplex.com
Subject: Re: How do keep JS untouched [YUICompressor:231327]

From: purekrome

Hi Rafael - sincere appologies for the extremely late reply.

I'm not sure I can keep the indentation, unfortunatley. If the source Java code does that, then I can do that. Otherwise, no can do. The minification process is really weird stuff (read: sometimes a bit too confusing for me) so i'm not going to start to go in and tweak the minification code. More importantly, this is trying to be a PORT of the original source code. So if it's not in there, then I'm not going to spend some time doing it.

Now the question I have is this: WHY?

When we minify, obfuscate and combine, we're basically saying this: I have some code. I like that code. It's ready for people to use it. I want to get rid of as much 'bloat' as possible to keep the file size nice and small. As such, it shouldn't be used by humans to read, but my computers. Therefore, i don't want it to look pretty because then i've added some bloat. So, little YUICompressor library -> got nuts and squish and obfuscate and combine away!!!

If you just want to combine files, then you can do that with some other methods available (out of scope of this project). Remember, this project is aimed at getting things SMALL. and for COMPUTERS, not humans. So maybe this project isn't the right one for your needs?

Coordinator
Jan 17, 2011 at 11:29 PM

Hi Rafael,

I might have a suggestion : Post-Build Events. In development, you don't need to have any YUICompressor magic (aka. minification or obfuscation). Just combining, by the sounds of things. Why don't you add a Post-Build event to combine whatever files you need. This post-build event can only occur on Debug configurations ... and this is available in VS2008 (and of course VS2010).

Maybe possible?