You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Thiago Henrique De Paula Figueiredo (Jira)" <ji...@apache.org> on 2021/02/15 12:55:00 UTC

[jira] [Closed] (TAP5-2661) Allow options to be passed to GoogleClosureMinimizer

     [ https://issues.apache.org/jira/browse/TAP5-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiago Henrique De Paula Figueiredo closed TAP5-2661.
-----------------------------------------------------
    Fix Version/s: 5.6.2
       Resolution: Fixed

> Allow options to be passed to GoogleClosureMinimizer
> ----------------------------------------------------
>
>                 Key: TAP5-2661
>                 URL: https://issues.apache.org/jira/browse/TAP5-2661
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-webresources
>    Affects Versions: 5.4.1, 5.5.0, 5.6.1
>            Reporter: Geoff Callender
>            Assignee: Benjamin Weidig
>            Priority: Major
>             Fix For: 5.6.2, 5.7.0
>
>
> We need a way to pass options via GoogleClosureMinimizer to the google-closure-compiler.
> This is becoming more important as JavaScript advances. For example, the minimizer now fails to parse a javascript file if it contains ECMASCRIPT5 (aka ECMAScript 2009) features such as getters. With third party javascript this can be a blocker.
> The google-closure-compiler used by GoogleClosureMinimizer accepts options that can control this behaviour. One such option is --language=ECMASCRIPT5 (see [google/closure-compiler|[https://github.com/google/closure-compiler]),] which will stop parser trying to protect us from earlier versions of javascript.
> Here is an example of the parser rejection, using tapestry-webresources-5.4.3:
> 2021-01-28 04:31:40,536 ERROR [org.apache.tapestry5.ioc.Registry] (default task-14) Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not supported in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option. at StreamableResource<text/javascript classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
>  2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default task-14) Operations trace:
>  2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default task-14) [ 1] Streaming compressed module html2canvas.min
>  2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default task-14) [ 2] Streaming classpath:META-INF/modules/html2canvas.min.js (compressed)
>  2021-01-28 04:31:40,537 ERROR [org.apache.tapestry5.ioc.Registry] (default task-14) [ 3] Minimizing StreamableResource<text/javascript classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202>
>  2021-01-28 04:31:40,544 ERROR [org.apache.tapestry5.modules.TapestryModule.RequestExceptionHandler] (default task-14) Processing of request failed with uncaught exception: org.apache.tapestry5.ioc.internal.OperationException: Compilation failed: JSC_PARS
>  E_ERROR. Parse error. getters are not supported in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option. at StreamableResource<text/javascript classpath:META-INF/modules/html2canvas.min.j
>  s COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.: org.apache.tapestry5.ioc.internal.OperationException: Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not supported in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option. at StreamableResource<text/javascript classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
>  …
>  Caused by: java.lang.RuntimeException: Compilation failed: JSC_PARSE_ERROR. Parse error. getters are not supported in older versions of JavaScript. If you are targeting newer versions of JavaScript, set the appropriate language_in option. at StreamableResource<text/javascript classpath:META-INF/modules/html2canvas.min.js COMPRESSABLE lastModified: Thu Jan 28 03:44:05 UTC 2021 size: 165202> line 20 : 0.
>          at org.apache.tapestry5.internal.webresources.GoogleClosureMinimizer.doMinimize(GoogleClosureMinimizer.java:97)
>          at org.apache.tapestry5.internal.webresources.AbstractMinimizer$1.perform(AbstractMinimizer.java:72)
>          at org.apache.tapestry5.internal.webresources.AbstractMinimizer$1.perform(AbstractMinimizer.java:68)
>          at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:110)
>          ... 101 more



--
This message was sent by Atlassian Jira
(v8.3.4#803005)