Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

[AEM 6.4.2] GCC JS Processor not working

Avatar

Avatar
Validate 1
Level 1
Kauan_Nagashi
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Kauan_Nagashi
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Kauan_Nagashi
Level 1

04-12-2018

Hello, everyone!

I'm trying to change the JS compiler from Yui to GCC (to use ES6 in our project), I have read the official document ( Change the minification engine for client libraries in AEM ), but for some reason the GCC is not working.

What we have tried:

This doesn't work.

  • Adding the jsProcessor inside the clientLibraryFolder like this:

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

    jcr:primaryType="cq:ClientLibraryFolder"

    allowProxy="{Boolean}true"

    embed="[project.components]"

    categories="project.all"

    jsProcessor="[default:none,min:gcc;languageIn=ECMASCRIPT6]"/>

This doesn't work either.

If we turn it back to min:yui on the configMgr, it works again, but just minfies the ES5 functions, if we use arrow functions or let/const, it doesn't transform into ES5 (the main reason why we're changing to GCC).

Could you guys please help us?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

04-12-2018

Cust Care found a ticket related to this and says this doc not valid for 6.4. I recommend opening a ticket so this can be dealt with.

Answers (4)

Answers (4)

Avatar

Avatar
Validate 10
Level 2
fionas76543059
Level 2

Likes

3 likes

Total Posts

66 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 10
Level 2
fionas76543059
Level 2

Likes

3 likes

Total Posts

66 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
fionas76543059
Level 2

29-03-2021

 

Hi there,

I set up an OSGI config file called com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.xml with these contents and gcc seems to work o.k.
for JS with some caveats.
I still get some files failing minification because of "strict" errors which I couldn't seem to get around with configuration options in this file.
In the end, I had to fix the errors in the files to get the gcc to minimize them.


<
jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
htmllibmanager.disable.replacement="[]"
htmllibmanager.path.list="[/apps,/libs,/etc]"
htmllibmanager.maxDataUriSize="0"
htmllibmanager.useFileSystemOutputCache="{Boolean}true"
htmllibmanager.fileSystemOutputCacheLocation=""
htmllibmanager.timing="{Boolean}false"
htmllibmanager.clientmanager="granite.clientlibrarymanager"
htmllibmanager.maxage="-1"
htmllibmanager.debug="{Boolean}false"
htmllibmanager.forceCQUrlInfo="{Boolean}false"
htmllibmanager.processor.css="[min:yui]"
htmllibmanager.minify="{Boolean}true"
htmllibmanager.debug.init.js="window.CQ_initial_log_level\='INFO';"
htmllibmanager.excluded.path.list="[/etc/commerce/classifications,/etc/commerce/collections,/etc/commerce/payment-methods,/etc/commerce/products,/etc/commerce/shipping-methods,/etc/reports/auditreport,/etc/reports/compreport,/etc/segmentation,/etc/taskmanagement,/etc/workflow/instances]"
htmllibmanager.defaultthemename="default"
htmllibmanager.defaultuserthemename="default"
htmllibmanager.processor.js="[min:gcc;languageIn\=ECMASCRIPT_2015]"
htmllibmanager.gzip="{Boolean}true"
htmllibmanager.longcache.patterns="[]"
htmllibmanager.longcache.format="lc-%s-lc"
/>

 

 

It might be that some of files are minifying for you and others aren't.

Also, it might be worth clearing the clientlibs caches in AEM as described here, so you get a fresh view of them.

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html

 

 

 

Avatar

Avatar
Level 1
alessandrov1415
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
alessandrov1415
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
alessandrov1415
Level 1

18-10-2019

Try with languageIn=ECMASCRIPT_2015

source: Flags and Options · google/closure-compiler Wiki · GitHub

Avatar

Avatar
Validate 1
Level 1
Kauan_Nagashi
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Kauan_Nagashi
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Kauan_Nagashi
Level 1

05-12-2018

Thank you for your time, Smacdonald!

I will do that.

Best regards,

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

04-12-2018

I am checking with the team if this doc is still valid.