acs-aem-commons
acs-aem-commons copied to clipboard
Versioned Client Libs: Async-loaded JS/CSS calls are not getting a hash appended
Required Information
- [x] AEM Version, including Service Packs, Cumulative Fix Packs, etc: 6.5.12
- [x] ACS AEM Commons Version: 5.2.0
- [x] Reproducible on Latest? yes
Expected Behavior
<script>
GraniteClientLibraryManager.write([{"p":"/etc.clientlibs/clientlibs/granite/jquery.min.1234567890.js","c":[]},{"p":"/etc.clientlibs/clientlibs/granite/utils.min.1234567890.js","c":[]},{"p":"/etc.clientlibs/clientlibs/granite/jquery/granite.min.1234567890.js","c":[]},{"p":"/etc.clientlibs/foundation/clientlibs/jquery.min.1234567890.js","c":[]},{"p":"/etc.clientlibs/foundation/clientlibs/shared.min.1234567890.js","c":[]},{"p":"/etc.clientlibs/clientlibs/social/thirdparty/underscore.min.1234567890.js","c":[]},...],false);
</script>
(With hash)
Actual Behavior
<script>
GraniteClientLibraryManager.write([{"p":"/etc.clientlibs/clientlibs/granite/jquery.min.js","c":[]},{"p":"/etc.clientlibs/clientlibs/granite/utils.min.js","c":[]},{"p":"/etc.clientlibs/clientlibs/granite/jquery/granite.min.js","c":[]},{"p":"/etc.clientlibs/foundation/clientlibs/jquery.min.js","c":[]},{"p":"/etc.clientlibs/foundation/clientlibs/shared.min.js","c":[]},{"p":"/etc.clientlibs/clientlibs/social/thirdparty/underscore.min.js","c":[]},...],false);
</script>
(Without hash)
Steps to Reproduce
- Install AEM
- Install AEM service pack
- Install latest ACS AEM Commons
- Enable versioned clientlibs transformer factory
- Notice that all clientlibs (in view-source:) are being hashed, except for the ones in GraniteClientLibraryManager.write()
- Notice that the values that are passed to GraniteClientLibraryManager.write() are translated 1:1 to script/link tags
Links
@henrykuijpers Versioned Clientlibs uses a Sling Rewriter Transformer Factory to update the URL's w/ the checksums. These URLs are in JavaScript itself, so im not sure this is really feasible (even if we could, it sounds like a bad idea to try to start parsing JS and updating it).
Reminder me what writes out that GraniteClientLibraryManager.write()
JS?