Hi Team,
Please help me to understand that if I have three clientlibs ( Clientlib A, Clientlib B, Clientlib C),
for Clientlib A I am using both the properties like dependency = Clientlib B as well as embed = Cliebtlib B.
So which property will have more precendency our of this if i am using both at the same time on a single cliebtlib ?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @monish_gavali ,
The main difference is in terms of requests being made to the server.
dependencies : should cause your page to have extra requests to other clientlibs such as jquery.
embed : should "aggregate" those other clientlibs INTO the current clientlib (internal subscribe). This defines the categories which will be combined to the current clientlib. This is usually used for minimizing requests and for accessing clientlibs which are not supposed to be exposed to public
There is no better here, as it depends on your use case, it's an architecture choice.
Here you can find great details about them:-
https://khakiout.wordpress.com/2016/02/23/aem-clientlibs-difference-between-dependencies-and-embed/
Hope this helps!
Hi @monish_gavali ,
The main difference is in terms of requests being made to the server.
dependencies : should cause your page to have extra requests to other clientlibs such as jquery.
embed : should "aggregate" those other clientlibs INTO the current clientlib (internal subscribe). This defines the categories which will be combined to the current clientlib. This is usually used for minimizing requests and for accessing clientlibs which are not supposed to be exposed to public
There is no better here, as it depends on your use case, it's an architecture choice.
Here you can find great details about them:-
https://khakiout.wordpress.com/2016/02/23/aem-clientlibs-difference-between-dependencies-and-embed/
Hope this helps!
Hi @monish_gavali ,
In Adobe Experience Manager (AEM), the embed and dependency properties of client libraries (clientlibs) serve different purposes and it’s not about which one takes precedence over the other. Here’s a brief explanation:
Embed: The embed property is used to combine the embedded clientlibs with the current clientlib. If Clientlib A embeds Clientlib B, the resulting HTML will be a concatenation of content from Clientlib A and Clientlib B. This is usually used for minimizing requests and for accessing clientlibs which are not supposed to be exposed to the public.
Dependencies: The dependencies property defines the other categories that the current clientlib depends upon. If Clientlib A depends on Clientlib B, and if Clientlib B depends on Clientlib C, then all clientlibs A, B, and C will be included in the page2. The order in which they will be included is first C, then B, then A. This property is transitive.
So, if you’re using both embed and dependency properties for Clientlib B in Clientlib A, it means that the content of Clientlib B will be combined with Clientlib A (due to embed), and also, Clientlib B will be loaded before Clientlib A (due to dependency). The choice between embed and dependency depends on your use case and it’s an architecture choice.
Thanks,
Madhur
Dependencies property is transitive – if Clientlib A depends on B and B depends on C, then all clientlibs will be included in the page in the order of C>B>A.
Embed property is NOT transitive – If Clientlib A embed B and B embed C, then only A and B will be included in the page,but C won't. In order to include Clientlib C, it must be added to the embed property of A as well.
@monish_gavali : There is no concept of precedence between embed and dependency. Both properties serve different purposes.
You can try to add embed and dependency property with same clientlibs category-name value to see how it behaves.
thanks.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies