All Projects → nateyolles → aem-clientlib-async

nateyolles / aem-clientlib-async

Licence: Apache-2.0 license
Create AEM clientlibs that can output 'async', 'defer' and 'onload' attributes on your HTML script elements.

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to aem-clientlib-async

aem-touch-ui-validation
AEM Touch UI Validation Library
Stars: ✭ 40 (-11.11%)
Mutual labels:  aem, adobe-experience-manager
aem-intellij-plugin
IntelliJ Platform plugin for AEM (Adobe Experience Manager).
Stars: ✭ 26 (-42.22%)
Mutual labels:  aem, adobe-experience-manager
burp-aem-scanner
Burp Scanner extension to fingerprint and actively scan instances of the Adobe Experience Manager CMS. It checks the website for common misconfigurations and security holes.
Stars: ✭ 60 (+33.33%)
Mutual labels:  aem, adobe-experience-manager
wcm-io-caconfig
Context-Aware Configuration for AEM applications.
Stars: ✭ 16 (-64.44%)
Mutual labels:  aem, adobe-experience-manager
aem-akamai-replication-agent
How to create custom replication agents in AEM using Akamai as an example.
Stars: ✭ 33 (-26.67%)
Mutual labels:  aem, adobe-experience-manager
gradle-aem-multi
Example Multi-Module AEM application built by Gradle Build System
Stars: ✭ 31 (-31.11%)
Mutual labels:  aem, adobe-experience-manager
wcm-io-tooling
Tooling for Maven and IDEs.
Stars: ✭ 12 (-73.33%)
Mutual labels:  aem, adobe-experience-manager
aem-dispatcher-experiments
Experiments to demonstrate the impact of the Dispatcher and it's configuration parameters.
Stars: ✭ 41 (-8.89%)
Mutual labels:  aem, adobe-experience-manager
wcm-io-wcm
Extensions for AEM authoring and AEM applications.
Stars: ✭ 17 (-62.22%)
Mutual labels:  aem, adobe-experience-manager
aem-osgi-annotation-demo
Demonstrates OSGi Declarative Services Annotations along side Felix SCR Annotations.
Stars: ✭ 42 (-6.67%)
Mutual labels:  aem, adobe-experience-manager
aem-docker-getting-started
Getting started guide for development with Adobe Experience Manager and Docker.
Stars: ✭ 38 (-15.56%)
Mutual labels:  aem, adobe-experience-manager
jstackSeries.sh
Script for capturing a series of thread dumps from a Java process using jstack (on Linux and Windows)
Stars: ✭ 28 (-37.78%)
Mutual labels:  aem
etoolbox-authoring-kit
Offers a set of tools that create Granite UI authoring interfaces for Adobe Experience Manager components from Java code. This is a comprehensive solution that makes different widgets work in a coordinated manner, provides greater interactivity in AEM dialogs, and introduces additional features (customizable data lists, options selection, etc.)
Stars: ✭ 93 (+106.67%)
Mutual labels:  aem
aem-spa-page-model-manager
Interface between Adobe Experience Manager and Single Page Application framework.
Stars: ✭ 26 (-42.22%)
Mutual labels:  aem
aem-react-editable-components
SPA React Editable Components for Adobe Experience Manager
Stars: ✭ 43 (-4.44%)
Mutual labels:  aem
aem-test-samples
Adobe Experience Manager Test Samples
Stars: ✭ 19 (-57.78%)
Mutual labels:  aem
aio-cli-plugin-cloudmanager
Cloud Manager plugin for the Adobe I/O CLI
Stars: ✭ 32 (-28.89%)
Mutual labels:  adobe-experience-manager
cookbook-cq
Chef cookbook for Adobe CQ (aka AEM)
Stars: ✭ 20 (-55.56%)
Mutual labels:  aem
elasticsearch-aem
Example Implementation to integrate ElasticSearch in AEM
Stars: ✭ 13 (-71.11%)
Mutual labels:  aem
aemscan
Adobe Experience Manager Vulnerability Scanner
Stars: ✭ 161 (+257.78%)
Mutual labels:  aem

AEM Clientlib Async

See http://www.nateyolles.com/blog/2016/06/custom-aem-html5-async-clientlibs for a detailed description regarding this project and how Sightly clientlibs work.

Create AEM clientlibs that can output async, defer, onload and crossorigin attributes on your HTML script elements. The new clientlib component works with or without clientlib minification.

The Sightly templates were updated to accept the new Sightly expression options and the ClientLib Java class was updated to accept the new bindings.

  • /ui.apps/src/main/content/jcr_root/apps/clientlib-async/sightly/templates/clientlib.html
  • /ui.apps/src/main/content/jcr_root/apps/clientlib-async/sightly/templates/graniteClientLib.html
  • /ui.apps/src/main/content/jcr_root/apps/clientlib-async/sightly/templates/ClientLibUseObject.java

The sample page using the new clientlib component:

  • /ui.apps/src/main/content/jcr_root/apps/clientlib-async-sample/components/structure/page/page.html

Included is a sample JavaScript file which loads asynchronously and excutes a function on load:

  • /ui.apps/src/main/content/jcr_root/etc/designs/clientlib-async-sample/clientlib-async-sample/script.js

Install

A package is provided in the /package folder. Install it with Package Manager at http://localhost:4502/crx/packmgr/index.jsp or you can copy the /apps/clientlib-async folder into your project.

How to build

You can build and deploy to a running AEM instance with default values of port 4502, user admin and password admin. Navigate to the /demo directory and run:

mvn clean install -PautoInstallPackage

View sample

After building and deploying, navigate to the sample page at http://localhost:4502/content/clientlib-async-sample/en.html. View the source to verify that the clientlib-async-sample.js script element has the async void attribute and the onload attribute with a value of sayHello().

Using the updated clientlibs

Use the clientlibs in your Sightly markup just as you would before (see Sightly intro part 5: FAQ), however, you will update the value of the data-sly-use option to point to the new clientlib component.

<head data-sly-use.clientLib="${'/apps/clientlib-async/sightly/templates/clientlib.html'}">

<!--/* for css+js */-->
<meta data-sly-call="${clientLib.all @ categories='your.clientlib'}" data-sly-unwrap></meta>

<!--/* only js */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib'}" data-sly-unwrap></meta>

<!--/* only css */-->
<meta data-sly-call="${clientLib.css @ categories='your.clientlib'}" data-sly-unwrap></meta>

</head>

Using 'async', 'defer', 'onload' and 'crossorigin'

Valid values for loading are async and defer. Valid values for crossorigin are anonymous and use-credentials.

<!--/* async */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib', loading='async'}" data-sly-unwrap></meta>

<!--/* defer */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib', loading='defer'}" data-sly-unwrap></meta>

<!--/* defer and onload */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib', loading='defer', onload='myFunction()'}" data-sly-unwrap></meta>

<!--/* crossorigin */-->
<meta data-sly-call="${clientLib.all @ categories='your.clientlib', crossorigin='anonymous'}" data-sly-unwrap></meta>

License

The project is licensed under Apache License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].