It turns out that there’s a nice nifty plugin called images-loaded that fires an event when images inside a parent container have finished loading. Using this with masonry (as recommended on the masonry website…) solves all the problems we were having!
The only potential issue with this pull request is that I have removed the timeout of 500ms for market masonry since it was causing a slight flicker on the live site. I don't think this is required anymore since instantTrendingMasonry() works fine for products, but in the event that masonry no longer fires for markets when we deploy, we'll have to add it back in.
I've assigned @CakeBrewery and @Clebeuf for sign off on this! Everything should be working, but we won't know for certain until we deploy and try with a non-local cache.
It turns out that there’s a nice nifty plugin called images-loaded that fires an event when images inside a parent container have finished loading. Using this with masonry (as recommended on the masonry website…) solves all the problems we were having!
The only potential issue with this pull request is that I have removed the timeout of 500ms for market masonry since it was causing a slight flicker on the live site. I don't think this is required anymore since instantTrendingMasonry() works fine for products, but in the event that masonry no longer fires for markets when we deploy, we'll have to add it back in.