You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joe Klecko <bu...@gmail.com> on 2011/09/14 01:28:11 UTC

[5.3-alpha-13] - Combine/Minify doesn't appear to work ...

Hi All,

When my app is running in production mode, I don't see my scripts/css being
combined/minified. They are still included as individual files.  Oddly, I do
see the tapestry scripts being combined/minified though.    I tried manually
configuring this in my AppModule with no luck with the following settings:
        configuration.add(SymbolConstants.COMBINE_SCRIPTS,true);
        configuration.add(SymbolConstants.MINIFICATION_ENABLED,true);

Is this suppose to work for assets stored in jar files?  Any help or
guidance is appreciated.

Thanks,
J


--
View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-alpha-13-Combine-Minify-doesn-t-appear-to-work-tp4800682p4800682.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: [5.3-alpha-13] - Combine/Minify doesn't appear to work ...

Posted by Howard Lewis Ship <hl...@gmail.com>.
Is tapestry-yuicompressor on the classpath?

On Tue, Sep 13, 2011 at 4:28 PM, Joe Klecko <bu...@gmail.com> wrote:
> Hi All,
>
> When my app is running in production mode, I don't see my scripts/css being
> combined/minified. They are still included as individual files.  Oddly, I do
> see the tapestry scripts being combined/minified though.    I tried manually
> configuring this in my AppModule with no luck with the following settings:
>        configuration.add(SymbolConstants.COMBINE_SCRIPTS,true);
>        configuration.add(SymbolConstants.MINIFICATION_ENABLED,true);
>
> Is this suppose to work for assets stored in jar files?  Any help or
> guidance is appreciated.
>
> Thanks,
> J
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-alpha-13-Combine-Minify-doesn-t-appear-to-work-tp4800682p4800682.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: [5.3-alpha-13] - Combine/Minify doesn't appear to work ...

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Hi,

I had a go at turning on minimization in my app [T5.3-beta-8] with the
following results:

- The content of the files are squished / minimised
- The JS stacks are combined into a single JS file
- All other files are included individually
- JS minimisation often throws exceptions, returning HTTP 500 error
pages instead of JavaScript.

I was rather hoping more files would be combined. For this is now my
standard <head> list:

<link href="/assets/2.0/tapestry/default.css" rel="stylesheet" type="text/css">
<link href="/assets/2.0/ctx/stylesheets/reset-fonts-grids-base-min.css"
rel="stylesheet" type="text/css">
<link href="/assets/2.0/ctx/stylesheets/thag.css" rel="stylesheet"
type="text/css">
<link href="/assets/2.0/ctx/stylesheets/admin.css" rel="stylesheet"
type="text/css">
<link href="/assets/2.0/tapestry/tapestry-console.css"
rel="stylesheet" type="text/css">
<link href="/assets/2.0/tapestry/t5-alerts.css" rel="stylesheet"
type="text/css">
<link href="/assets/2.0/tapestry/tree.css" rel="stylesheet" type="text/css">
<link href="/assets/2.0/app/components/admin/CalendarEventEditor.css"
rel="stylesheet" type="text/css">
<link href="/assets/2.0/tapestry/datepicker_106/css/datepicker.css"
rel="stylesheet" type="text/css">
<script type="text/javascript" src="/assets/2.0/stack/en/core.js"></script>
<script type="text/javascript"
src="/assets/2.0/stack/en/core-datefield.js"></script>
<script type="text/javascript"
src="/assets/2.0/app/components/CalendarEventEditor.js"></script>
<script type="text/javascript"
src="/assets/2.0/easyfck/fckeditor/fckeditor.js"></script>

Though the exceptions are more of a worry because they prevent the
page from working! Could the minimiser not catch YuiCompressor
exceptions and return the un-compressed version instead?

Some of my own JS code throws similar exceptions, but it works fine
when run through: http://www.refresh-sf.com/yui/ - any ideas on how I
may tidy up my code?

Some sample minimiser exceptions below:


2011-09-15 20:45:51,187 ERROR :                  Registry -
java.util.EmptyStackException
2011-09-15 20:45:51,187 ERROR :                  Registry - Operations trace:
2011-09-15 20:45:51,187 ERROR :                  Registry - [ 1]
Streaming asset stack en/core.js
2011-09-15 20:45:51,187 ERROR :                  Registry - [ 2]
Minimizing JavaScript
2011-09-15 20:45:51,359 INFO  :            SystemActivity - ERROR:
java.util.EmptyStackException - null
2011-09-15 20:45:51,359 ERROR : RequestExceptionDecorator - null - caused by
null
org.apache.tapestry5.ioc.internal.OperationException
	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47)
	at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76)
...
Caused by: java.util.EmptyStackException
	at java.util.Stack.peek(Stack.java:79)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.getCurrentScope(JavaScriptCompressor.java:559)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1105)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:553)
	at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)
	
2011-09-15 20:47:50,859 ERROR :                  Registry -
java.util.EmptyStackException
2011-09-15 20:47:50,859 ERROR :                  Registry - Operations trace:
2011-09-15 20:47:50,859 ERROR :                  Registry - [ 1]
Streaming classpath:org/apache/tapestry5/scriptaculous_1_9_0/controls.js
2011-09-15 20:47:50,859 ERROR :                  Registry - [ 2]
Minimizing JavaScript
2011-09-15 20:47:50,953 INFO  :            SystemActivity - ERROR:
java.util.EmptyStackException - null
2011-09-15 20:47:50,953 ERROR : RequestExceptionDecorator - null - caused by
Caused by: java.util.EmptyStackException
	at java.util.Stack.peek(Stack.java:79)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.getCurrentScope(JavaScriptCompressor.java:559)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1105)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:553)
	at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)
	
and

Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: 286
	at java.lang.String.substring(String.java:1765)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceString(JavaScriptCompressor.java:267)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:330)
	at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
	at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:97)
	at org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer$1.perform(AbstractMinimizer.java:68)
	
Steve.




On 15 September 2011 06:32, Howard Lewis Ship <hl...@gmail.com> wrote:
> On Wed, Sep 14, 2011 at 11:32 AM, Joe Klecko <bu...@gmail.com> wrote:
>> Hi Howard thanks for the reply.   I do have the tapestry-yuicompressor in my
>> pom.xml.  It also appears on the classpath.  Here are tapestry jars on my
>> classpath:
>
> Well, it should be working.
>
> Note that minimization is only for files that are served by Tapestry
> (typically, via the @Import annotation, or via the JavaScriptSupport
> environmental), not arbitrary files in the context.
>
>>
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-core\5.3-alpha-13\tapestry-core-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-ioc\5.3-alpha-13\tapestry-ioc-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-func\5.3-alpha-13\tapestry-func-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry5-annotations\5.3-alpha-13\tapestry5-annotations-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-json\5.3-alpha-13\tapestry-json-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\plastic\5.3-alpha-13\plastic-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-yuicompressor\5.3-alpha-13\tapestry-yuicompressor-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-spring\5.3-alpha-13\tapestry-spring-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-test\5.3-alpha-13\tapestry-test-5.3-alpha-13.jar
>>
>> It does appear to combine some pre-defined stacks located in a jar (but it
>> does not minify them).    But as I said it does not minify or combine any
>> other included scripts/css using @Import(library=...,stylesheet=...} in
>> components/pages.
>>
>>
>> I have also tried forcing production mode just in case:
>> configuration.add(SymbolConstants.PRODUCTION_MODE, true);
>>
>> Is there another config or jar file I maybe missing?
>>
>> Thanks,
>> J
>>
>>
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-alpha-13-Combine-Minify-doesn-t-appear-to-work-tp4800682p4803910.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: [5.3-alpha-13] - Combine/Minify doesn't appear to work ...

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Wed, Sep 14, 2011 at 11:32 AM, Joe Klecko <bu...@gmail.com> wrote:
> Hi Howard thanks for the reply.   I do have the tapestry-yuicompressor in my
> pom.xml.  It also appears on the classpath.  Here are tapestry jars on my
> classpath:

Well, it should be working.

Note that minimization is only for files that are served by Tapestry
(typically, via the @Import annotation, or via the JavaScriptSupport
environmental), not arbitrary files in the context.

>
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-core\5.3-alpha-13\tapestry-core-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-ioc\5.3-alpha-13\tapestry-ioc-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-func\5.3-alpha-13\tapestry-func-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry5-annotations\5.3-alpha-13\tapestry5-annotations-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-json\5.3-alpha-13\tapestry-json-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\plastic\5.3-alpha-13\plastic-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-yuicompressor\5.3-alpha-13\tapestry-yuicompressor-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-spring\5.3-alpha-13\tapestry-spring-5.3-alpha-13.jar
> ProjectClassLoader:
> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-test\5.3-alpha-13\tapestry-test-5.3-alpha-13.jar
>
> It does appear to combine some pre-defined stacks located in a jar (but it
> does not minify them).    But as I said it does not minify or combine any
> other included scripts/css using @Import(library=...,stylesheet=...} in
> components/pages.
>
>
> I have also tried forcing production mode just in case:
> configuration.add(SymbolConstants.PRODUCTION_MODE, true);
>
> Is there another config or jar file I maybe missing?
>
> Thanks,
> J
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-alpha-13-Combine-Minify-doesn-t-appear-to-work-tp4800682p4803910.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: [5.3-alpha-13] - Combine/Minify doesn't appear to work ...

Posted by Joe Klecko <bu...@gmail.com>.
Hi Howard thanks for the reply.   I do have the tapestry-yuicompressor in my
pom.xml.  It also appears on the classpath.  Here are tapestry jars on my
classpath:

ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-core\5.3-alpha-13\tapestry-core-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-ioc\5.3-alpha-13\tapestry-ioc-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-func\5.3-alpha-13\tapestry-func-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry5-annotations\5.3-alpha-13\tapestry5-annotations-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-json\5.3-alpha-13\tapestry-json-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\plastic\5.3-alpha-13\plastic-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-yuicompressor\5.3-alpha-13\tapestry-yuicompressor-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-spring\5.3-alpha-13\tapestry-spring-5.3-alpha-13.jar
ProjectClassLoader:
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-test\5.3-alpha-13\tapestry-test-5.3-alpha-13.jar

It does appear to combine some pre-defined stacks located in a jar (but it
does not minify them).    But as I said it does not minify or combine any
other included scripts/css using @Import(library=...,stylesheet=...} in
components/pages.    


I have also tried forcing production mode just in case:
configuration.add(SymbolConstants.PRODUCTION_MODE, true);

Is there another config or jar file I maybe missing?  

Thanks,
J


--
View this message in context: http://tapestry.1045711.n5.nabble.com/5-3-alpha-13-Combine-Minify-doesn-t-appear-to-work-tp4800682p4803910.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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