You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jochen Kemnade <jo...@crossgate.com> on 2011/10/31 15:51:14 UTC

[T5.3] Using ResourceMinimizer to remove debugging code?

Hi,

after playing with the new Tapestry 5.3 features, an idea came to my 
mind. I'd like to "abuse" the ResourceMinimizer to remove debug code 
when running in production mode, i.e. calls to Tapestry.debug, 
T5.console.debug and the like.
The idea I currently have is to override the tapestry-yuicompressor 
contribution for "text/javascript" (unfortunately, the behavior of 
existing contributions cannot easily be extended as the 
MasterResourceMinimizer doesn't use a pipeline for each type, but that's 
a different story ;-) ) and remove all the calls to debug methods. 
Yuicompressor does not support features like that, so I wonder if 
there's a way to get around having to write horrible regular expressions 
or parser code. Any ideas? :-)

Regards,
Jochen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3] Using ResourceMinimizer to remove debugging code?

Posted by Jochen Berger <fo...@googlemail.com>.
Hi,

Am 31.10.2011 18:48, schrieb Martin Strand:
> Perhaps you could use Google closure compiler and its preprocessor
> features?
> http://stackoverflow.com/questions/2934509/exclude-debug-javascript-code-during-minification

That looks like a good idea, thanks for the hint.

> I have no experience with the closure compiler, but it's written in Java
> so should be possible to integrate with a Tapestry app.

And ASL2, too. I think I'll give it a try.

Jochen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3] Using ResourceMinimizer to remove debugging code?

Posted by Martin Strand <do...@gmail.com>.
On Mon, 31 Oct 2011 15:51:14 +0100, Jochen Kemnade <jo...@crossgate.com> wrote:

> Hi,
>
> after playing with the new Tapestry 5.3 features, an idea came to my
> mind. I'd like to "abuse" the ResourceMinimizer to remove debug code
> when running in production mode, i.e. calls to Tapestry.debug,
> T5.console.debug and the like.
> ...
> Yuicompressor does not support features like that, so I wonder if
> there's a way to get around having to write horrible regular expressions
> or parser code. Any ideas? :-)


Perhaps you could use Google closure compiler and its preprocessor features?
http://stackoverflow.com/questions/2934509/exclude-debug-javascript-code-during-minification

I have no experience with the closure compiler, but it's written in Java so should be possible to integrate with a Tapestry app.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org