i notice that when i load my site's theme (elgg 2.1), the jquery and other core JS modules are no longer parsed in a deferred way (according to the analysis tools at gtmetrix.com). even when i disable the lines in my theme that point the pages to a CDN to source the JS files, the result is the same.
(i also noticed while looking at the aalborg theme to see if i could learn any tricks, that the aalborg theme is using the pagesetup even that no longer functions in elgg 2.1).
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ura soul@tunist
ura soul - 0 likes
- iionly@iionly
iionly - 0 likes
- ura soul@tunist
ura soul - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
- ura soul@tunist
ura soul - 0 likes
You must log in to post replies.as it turned out, the cause of this was having piwik's tracking script inline on the main html template. i have moved it to an AMD module now. i had no idea that inline JS would change the way that the other JS files were loaded, i thought that requireJS would be stricter than that and just put out an error message.
Pagesetup event should still work in 2.X. It will get removed in 3.X.
i found it doesn't work for me in 2.1 - so i have moved all pagesetups to the relevant system,init event. i didn't look into it any further than that - so it possibly does still work in 2.1, but there was some other issue. in particular river_addon would not run unless i did this.
jQuery, UI, the require config, RequireJS, and elgg.js are all regular (synchronous, not deferred) scripts. They don't block rendering because we keep them at the end of body. I don't know why another script somewhere else would make that much difference.
i don't either, but it definitely was the case that putting the standard piwik js file (which does not use jquery) in the page (at the bottom), caused the jquery files to be listed on the gtmetrix page as not being deferred. essentially they were loaded in the head, as i recall - not the bottom of the body.