eclipse-jsdt / webtools.jsdt

1 stars 3 forks source link

Migrate to newer Closure Compiler version #2

Open nitind opened 9 months ago

nitind commented 9 months ago

See https://github.com/eclipse-orbit/orbit-simrel/issues/18 .

JSDT currently relies on the ancient com.google.javascript_0.0.20160315.v20161124-1903 (as Closure Compiler). Orbit has moved to the newer com.google.javascript 0.0.20230802.v20230927-1600, but JSDT does not presently compile against it.

@vrubezhny

benken-parasoft commented 2 months ago

There is a real issue here. I assemble an Eclipse product based on 4.31 (2024-03). My target platform happens to also include the Orbit 4.31 repository to pull in some additional bundles. At runtime, the JSDT is broken:

java.lang.NoSuchFieldError: ES6
    at org.eclipse.wst.jsdt.internal.compiler.closure.ClosureCompiler.parse(ClosureCompiler.java:112)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:911)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:675)
    at org.eclipse.wst.jsdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:93)
    at org.eclipse.wst.jsdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:79)
    at org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:325)
    at org.eclipse.wst.jsdt.internal.core.search.indexing.AddLibraryFileToIndex.indexFile(AddLibraryFileToIndex.java:251)
    at org.eclipse.wst.jsdt.internal.core.search.indexing.AddLibraryFileToIndex.execute(AddLibraryFileToIndex.java:169)
    at org.eclipse.wst.jsdt.internal.core.search.processing.JobManager.run(JobManager.java:393)
    at java.base/java.lang.Thread.run(Thread.java:840)

The "org.eclipse.wst.jsdt.core" bundle does not declare a version restriction on "com.google.javascript" so Tycho is able to satisfy its dependencies using the latest one from Orbit. At runtime, the newer one isn't actually compatible because of a change to "com.google.javascript.jscomp.parsing.parser.Parser.Config.Mode" where the "ES6" and "ES7" constants were replaced with a single "ES6_OR_ES7" constant.

For now, we are working around this by forcing a restriction on the target platform to require version "0.0.20160315" for "com.google.javascript". Something like this:

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <configuration>
          <dependency-resolution>
            <extraRequirements>
              <requirement>
                <type>eclipse-plugin</type>
                <id>com.google.javascript</id>
                <versionRange>[0.0.20160315,0.0.20231112)</versionRange>
              </requirement>
            </extraRequirements>
          </dependency-resolution>
        </configuration>
      </plugin>
alexsuter commented 1 month ago

Hello @nitind

I've the same issue as @benken-parasoft

Is there any solution for this problem?

alexsuter commented 1 month ago

By using an older version, maybe other things are broken then. Build is also failing at the moment: https://ci.eclipse.org/webtools/job/webtools-jsdt_master/

nitind commented 1 month ago

Hello @nitind

I've the same issue as @benken-parasoft

Is there any solution for this problem?

Porting to the newer version would be one, but the committers who moved the project to Nashorn and then the Closure Compiler aren't very active on this project any more.

I doubt that the change in that version constant is the only breaking change. Is it?

alexsuter commented 1 month ago

Saidly there is much more needed:

image

alexsuter commented 1 month ago

No longer an issue for us. We have removed JSDT.