Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Removing unwanted clientlibs in Publish for experience fragment

Avatar

Level 5

Hello All - I am using experience fragment in AEM 6.5. Below files are not required but they get added in the publish instance even if it is not part of my include clientlib category. This is causing unwanted network calls. In my custom component, it is pointing to sling:resourceSuperType:cq/experience-fragments/components/xfpage. Could someone help with this please?

 

/etc.clientlibs/clientlibs/social/thirdparty/underscore.min.js
/etc.clientlibs/clientlibs/granite/moment.min.js
/etc.clientlibs/clientlibs/social/thirdparty/backbone.min.js
/etc.clientlibs/clientlibs/social/thirdparty/handlebars.min.js
/etc.clientlibs/clientlibs/social/commons/scf.min.css
/etc.clientlibs/clientlibs/social/commons/scf.min.js
/libs/social/integrations/livefyre/components/authorcomponents/shared.min.js
/libs/social/integrations/livefyre/components/authorcomponents/authorclientlibs.min.js
/libs/cq/ui/rte.min.js
/libs/cq/ui/widgets.min.js
/etc.clientlibs/cq/personalization/clientlib/personalization/integrations/commons.min.js
/etc.clientlibs/cq/analytics/clientlibs/sitecatalyst/tracking.min.css
/etc.clientlibs/cq/analytics/clientlibs/sitecatalyst/tracking.min.js
/etc.clientlibs/cq/searchpromote/clientlibs/searchpromote.min.css
/etc.clientlibs/cq/searchpromote/clientlibs/searchpromote.min.js
/libs/cq/searchpromote/widgets.min.js

 

@arunpatidar @kautuk_sahni 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@v1101 

A simple answer for you is to create your own xfpage page component (typically in /apps/my-app/components/structure/xfpage, overlaying the /libs xfpage page component, and removing the fluff. 

Since you are referencing and using the out of the box xfpage component, the out of the box xfpage component is trying to resolve the clientlib category of "cq.experience-fragments.web", within custom headlibs. Also taking a look at the content.html, another reference to a clientlib category is referenced "cq.experience-fragments.content". As you can see, the page component is trying to resolve multiple unwanted clientlibs. To resolve your issue, you can create your own xfpage page component. 

xfpage path - http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage

xfpage content.html path - http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage/content.html

xfpage customheaderlibs.html path -http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage/customheaderl...

I hope this helps.

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

@v1101 

A simple answer for you is to create your own xfpage page component (typically in /apps/my-app/components/structure/xfpage, overlaying the /libs xfpage page component, and removing the fluff. 

Since you are referencing and using the out of the box xfpage component, the out of the box xfpage component is trying to resolve the clientlib category of "cq.experience-fragments.web", within custom headlibs. Also taking a look at the content.html, another reference to a clientlib category is referenced "cq.experience-fragments.content". As you can see, the page component is trying to resolve multiple unwanted clientlibs. To resolve your issue, you can create your own xfpage page component. 

xfpage path - http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage

xfpage content.html path - http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage/content.html

xfpage customheaderlibs.html path -http://localhost:4502/crx/de/index.jsp#/libs/cq/experience-fragments/components/xfpage/customheaderl...

I hope this helps.

Avatar

Level 5
@BrianKasingli - Thanks for your response. I have overlay the component and copied customheaderlibs.html and content.html and also verified using /libs/granite/ui/content/dumplibs.test.html?categories=cq.experience-fragments.web /libs/granite/ui/content/dumplibs.test.html?categories=cq.experience-fragments.content, It looks like it is showing the results only for css. is there any other file that I need to updated for restricting the JS that I have mentioned above.

Avatar

Community Advisor

@Vignesh, you would need to look at the implementation of the /libs/...xfpage page component. When overlaying the xfpage component, make sure you don't include client libs that are unwanted. Take a look at we.retail's xfpage implementation : http://localhost:4506/crx/de/index.jsp#/apps/weretail/components/structure/xfpage. For me, I would start from the beginning. Completely remove all client libs from the XF page component, then start to add client libs one at a time.

Avatar

Community Advisor

Hi,

Are these js/css are getting added in all of the page? Can you check the dependencies property of of your project clientlibs?

 



Arun Patidar

Avatar

Level 5
Hi Arun - I have verified the dependencies as well and don't see any dependencies related to this categories.