changcheng / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

YuiCssCompressor throws Stackoverflow exception #278

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When compressing a lessCss source (example is the twitter bootstrap library) 
with YUICompressor, it throws StackOverflowException. 

Though it is not correct to use YUICompressor on a lessCss source, still it 
shouldn't throw this kind of exceptions. It should produce a valid lessCss 
source after minimization or at least leave it as it is.

Original issue reported on code.google.com by alex.obj...@gmail.com on 22 Aug 2011 at 1:44

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 22 Aug 2011 at 1:46

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 22 Aug 2011 at 2:25

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 24 Aug 2011 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 25 Aug 2011 at 1:03

GoogleCodeExporter commented 9 years ago
YUI Compressor also throws StackOverflowError when compressing CSS files with 
much data URIs. Do you know any alternatives to YUI Compressor? I'm looking for 
alternatives for my Maven plugin which converts image paths to data URIs in CSS 
files.

Original comment by ovarak...@googlemail.com on 12 Apr 2012 at 9:25

GoogleCodeExporter commented 9 years ago
You can try CssMin or CssMinJawr processor as alternatives: 
http://code.google.com/p/wro4j/wiki/AvailableProcessors

Original comment by alex.obj...@gmail.com on 12 Apr 2012 at 9:28

GoogleCodeExporter commented 9 years ago
Thanks Alex. I've found a lot of posts to StackOverflowError with data URIs. 
E.g. this one http://yuilibrary.com/forum/viewtopic.php?p=26995

I don't like the internal code of YUI Compressor by the way. They match the 
entire string buffer with compiled pattern and then there is this exception by 
matcher.find().

Original comment by ovarak...@googlemail.com on 12 Apr 2012 at 9:32

GoogleCodeExporter commented 9 years ago
Alex, I haven't luck with YUI Compressor. The new fixed 2.4.7 version is not in 
the Maven central repo. Can I reuse your class JawrCssMinifier.java (take code 
from there)? With copyright of course. Is it free?

Thanks in advance.

Original comment by ovarak...@googlemail.com on 12 Apr 2012 at 2:53

GoogleCodeExporter commented 9 years ago
I can also include it as dependency. What should I include in order to be able 
to use JawrCssMinifier? Only core?

<dependency>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-core</artifactId>
    <version>1.4.5</version>
</dependency>

I don't need JawrCssMinifierProcessor.

Original comment by ovarak...@googlemail.com on 12 Apr 2012 at 3:01

GoogleCodeExporter commented 9 years ago
Of course you can reuse the class. Actually I borrowed it from jawr
library. The code is located in core.

Comment #9 on issue 278 by ovarak...@gmail.com: YuiCssCompressor throws
Stackoverflow exception
http://code.google.com/p/**wro4j/issues/detail?id=278<http://code.google.com/p/w
ro4j/issues/detail?id=278>

I can also include it as dependency. What should I include in order to be
able to use JawrCssMinifier? Only core?

<dependency>
   <groupId>ro.isdc.wro4j</**groupId>
   <artifactId>wro4j-core</**artifactId>
   <version>1.4.5</version>
</dependency>

I don't need JawrCssMinifierProcessor.

Original comment by alex.obj...@gmail.com on 12 Apr 2012 at 3:10

GoogleCodeExporter commented 9 years ago
Many thanks! Do you know if compression ratio for JawrCssMinifier is comparable 
with YUICompressor or YUICompressor compresses better CSS code?

Original comment by ovarak...@googlemail.com on 12 Apr 2012 at 3:19

GoogleCodeExporter commented 9 years ago
I don't have such metrics, but you can test it yourself for your particular
situation. I don't think the differrnces

Comment #11 on issue 278 by ovarak...@gmail.com: YuiCssCompressor throws
Stackoverflow exception
http://code.google.com/p/**wro4j/issues/detail?id=278<http://code.google.com/p/w
ro4j/issues/detail?id=278>

Many thanks! Do you know if compression ratio for JawrCssMinifier is
comparable with YUICompressor or YUICompressor compresses better CSS code?

Original comment by alex.obj...@gmail.com on 12 Apr 2012 at 5:36

GoogleCodeExporter commented 9 years ago
..pressed send button by mistake, without finishing the idea...

I don't think there are major differences, since css compressors cannot
obfuscate code. Also gzipping  does a pretty good job anyway.

Comment #11 on issue 278 by ovarak...@gmail.com: YuiCssCompressor throws
Stackoverflow exception
http://code.google.com/p/**wro4j/issues/detail?id=278<http://code.google.com/p/w
ro4j/issues/detail?id=278>

Many thanks! Do you know if compression ratio for JawrCssMinifier is
comparable with YUICompressor or YUICompressor compresses better CSS code?

Original comment by alex.obj...@gmail.com on 12 Apr 2012 at 5:40