Maintaining order.
-
Hey Frank, me again ;). Our latest version of Popup Maker ran into several issues with assets. Most dealing with cache not properly invalidating. We made changes in how we load assets. Now rather than loading js/css + inline js/css + extensions js/css we now presave it to a static file in /wp-content/uploads/.
I have seen at least 10 or so users who had errors due to things being loaded out of order or the localize scripts vars not loading.
I know for several we enabled the maintain asset ordering which fixes it, but i’m wondering why that wouldn’t be on by default.
Errors that I’ve seen include jQuery not being defined, our localized variable not defined.
Would love some insights into why we are having these issues from your perspective.
I will say one underlying change is that we now localize variables late. Because our scripts are registered early, but not enqueued until a popup is actually determined to be loading, and because our localized variables includes an array of loaded popups, we localize variables for scripts just before wp_footer renders them. Could this be part of the above issues? Obviously not for the
jQuery undefined
errors, but thepum_vars undefined
.https://github.com/PopupMaker/Popup-Maker/blob/master/classes/Site/Assets.php
- The topic ‘Maintaining order.’ is closed to new replies.