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.
Post by Howard Lewis ShipHi 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
Well, it should be working.
Note that minimization is only for files that are served by Tapestry
environmental), not arbitrary files in the context.
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-core\5.3-alpha-13\tapestry-core-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-ioc\5.3-alpha-13\tapestry-ioc-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-func\5.3-alpha-13\tapestry-func-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry5-annotations\5.3-alpha-13\tapestry5-annotations-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-json\5.3-alpha-13\tapestry-json-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\plastic\5.3-alpha-13\plastic-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-yuicompressor\5.3-alpha-13\tapestry-yuicompressor-5.3-alpha-13.jar
entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-spring\5.3-alpha-13\tapestry-spring-5.3-alpha-13.jar
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
components/pages.
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.
---------------------------------------------------------------------
--
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-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org