Hi,
I'm using some JS component in AIKAU widgets. It works fine when debug mode is enabled in share, but when debug is disabled, widget is not rendered.
Following error message appears in log: [extensions.surf.ClosureJavaScriptCompressionHandler] [http-apr-8080-exec-7] input.js:195: ERROR - this language feature is only supported for ECMASCRIPT6 mode or better: class. Use --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT to enable ES6 features.
I'm using alfresco CE 5.2.g with aikau 1.0.101.
How to enable ES6 support on ClosureJavaScriptCompressionHandler ?
Thanks.
Instead of trying to fiddle with the ClosureJavaScriptCompressionHandler, you may be better off to replace that with the ExternalJavaScriptCompressionHandler, which is able to call an external command (most likely some Node.js based script) to run the compression. This class was introduced alongside ExternalLessCssThemeHandler to allow for flexibility in using better tools, when the Surf-provided classes did not keep up with current standards - which they have not, considered there isn't any noticeable development anymore apart from bugfixes.
Thanks for this valuable advice.
Could you share an example of how to implement this ?
(the error message of ClosureJavaScriptCompressionHandler looks like a simple settings may enable ES6 support. What do you think about that ?)
You'll need to configure a bean with ID "javascript.compression.handler" using that class, e.g. in custom-slingshot-application-context.xml, and have that bean extend from the parent "javascript.compression.handler.abstract".
Sure, the error message sounds like you could just set a flag. But the flag is currentl hard-coded in the ClosureJavaScriptCompressionHandler class and would require you to patch that class and recompile.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.