Ticket #1859529 (closed enhancement)

Reporter


sfbugs
Opened: 12/28/07
Last modified: 12/12/12
Status: closed
Type: enhancement
Resolution: wontfix

Owner


Adam Moore
Target Release: FUTURE
Priority: P4 (low)
Summary: Allow Compressor to work with js.jar
Description:

It seems that compressor cannot be used when the standard rhino js.jar is also on the class path. The problem I had is with a string in my JavaScript: o+="rn"; When js.jar was on the class path I got
an actual new line in the output and when I removed it I got the expected "rn" literal. The newline caused an unterminated string literal error. The difference must be coming from TokenStream.java.

I found this while working on an ant task that used compressor (I also have another task that uses JavaScript via BSF) but it could happen in other contexts such as a servlet that is also using
JavaScript.

Perhaps you could put the modified rhino code in a different package to avoid the conflict.

Let me know if you have any questions or comments
Thanks
-John
jjsnyders _at_ rcn.com

Type: enhancement Observed in Version: 2.4.1
Component: YUICompressor Severity: S3 (normal)
Assigned To: Adam Moore Target Release: FUTURE
Location: Library Code Priority: P4 (low)
Tags: Relates To: #2527981, #2528056, #2528114
Browsers: N/A
URL:
Test Information:

Change History

George

YUI Developer

Posted: 12/28/07
  • summary changed from Allow Compressor to work with js.jar to [#1668237] Allow Compressor to work with js.jar

George

YUI Developer

Posted: 12/28/07

Forwarding to component owner for consideration.

tcoulter

  • Username: tcoulter
Posted: 08/26/08

I've ran into this as well, and I get the impression it's plaguing others. I noticed YUI Compressor 2.3.6 and the removal of the old Rhino -- any chance the compressor will get more friendly?

Thanks a lot!

George

YUI Developer

Posted: 10/22/08
  • status changed from assigned to closed

This bug has been fixed in the latest version of compressor. Please download the 2.4 version and give it a try.

sfbugs

Posted: 01/7/09

This ticket was imported from Source Forge.

Orginially submitted by: nobody

endium

Posted: 08/24/09
  • browser changed to N/A
  • resolution changed from None
  • status changed from closed to reopened
  • version changed from None to 2.4.1

The bootstrapping works fine when executing the jar like normal, but I'm calling the compress method directly, like this:
JavaScriptCompressor compressor = new JavaScriptCompressor(in, e_reporter);
compressor.compress(out, -1, false, true, true, false);

I had to add the regular js.jar into the classpath for a new project i'm working on, and now the compressor isn't working properly any more. Any ideas?

George

YUI Developer

Posted: 09/23/09
  • owner changed from julien-lecomte to Isaac Z. Schlueter
  • status changed from reopened to assigned

Isaac Z. Schlueter

YUI Contributor

Posted: 10/1/09
  • location changed to Library Code
  • milestone changed to FUTURE
  • priority changed from P3 (normal) to P4 (low)
  • status changed from assigned to accepted

There are really 2 issues in this ticket.

1) YUICompressor breaks on o+="rn"
2) YUICompressor requires its own modified Rhino library

  1. 1 is bug, and is fixed. #2 is an enhancement request.

Reworking the YUICompressor to work with the standard unmodified Rhino package is a noble goal, but not trivial or easy. Using the compressor from within a Java project is a use-case that would be nice to support, but is not the primary use-case for the yuicompressor. As such, this is not high priority.

Putting on the roadmap for FUTURE.

George

YUI Developer

Posted: 01/30/10

Adam Moore

YUI Contributor

Posted: 02/3/10
  • status changed from assigned to accepted

Damien Raude-Morvan

YUI Contributor

Posted: 05/22/11

Hi,

Since Rhino 1.7R3 (out since 2011-05-09), there is now an AST API provided to enable anyone to bridge from internal Rhino parsing.
Maybe it'll be easier for YUICompressor to use this ?

Regards,

bob harner

Posted: 07/5/12
  • relatesto changed to 2528056, 2528114, 2527981

FYI, this problem is causing a lot of other projects to have to fork and modify/repackage the YUICompressor code, which means improvements to the otherwise excellent YUICompressor aren't making it out to as many people as they should:

Liferay portal: http://issues.liferay.com/browse/LPS-3169 ("WebLogic chokes on rhino.jar / yuicompressor.jar")
(To resolve, had to repackage YUICompressor and Rhino code)

WRO4J: http://code.google.com/p/wro4j/wiki/KnownIssues ("YUIJs processor is broken in release 1.4.6")

Maven-play-plugin: To resolve, had to repackage YUICompressor and Rhino code)

Apache Tapestry: https://issues.apache.org/jira/browse/TAP5-1729 ("https://issues.apache.org/jira/browse/TAP5-1729")
Resolved by using jar repackaged by Maven-play-plugin project

XWiki: http://jira.xwiki.org/jira/browse/XWIKI-6148 ("Upgrade to yuicompressor 2.4.2")
(To resolve, had to repackage YUICompressor and Rhino code)

Jenny Donnelly

YUI Developer

Posted: 12/12/12
  • resolution changed to wontfix
  • status changed from accepted to closed

Thank you for your bug report. We are deprecating YUI Compressor in favor of yuglify. Please see our announcement for more information: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/. We will consider migrating these legacy tickets to GitHub if there are community maintainers willing to step up and own them.