I'm curious to gauge the interest in a version of imagesLoaded without the jQuery dependency.
Personally, I have Vanilla Masonry and other projects in the works which could benefit from a vanilla imagesLoaded.
Chime in if you're interested as well.
I'll take a shot at it. See what I'll run into :)
@desandro I have a working copy of dependency-less imagesloaded. It is 1.5KB minified, but works solely on callbacks. That is a drawback as returning a promise is something that really fits this library.
The problem is that the smallest Promises/A+ spec compliant implementation I found is 2 times larger than imagesLoaded itself, so I'm reluctant to attach it :)
So for now, it will be without promises. The repo is here: Darsain/imagesLoaded.
Wow, this is fantastic! Thank you so much for the work that went into this.
I agree on keeping out promises. Though, it might be worth considering building it in via bower.
What about component? https://github.com/component/component
you can basically use other small libraries for nodeListToArray and below, cutting the source code almost in half
@jonathanong but than it would have dependencies :) It's just a ~1KB library. I don't want a little shit like this to have dependencies.
@desandro but optional use of promises if some of the popular promise libraries is present might be nice. I'll look into it.
You have dependencies now, the only difference being they're hard coded. And a promise library would be a dependency as well.
Another thought, would it make sense to some how work this into the jQuery version? So the vanilla JS version would be the base, then we just provide a jQuery.fn wrapper for it, if present, then use jQuery deferreds, if present.
I've thought about it actually. Wrapping it with jQuery is not a problem at all. I'm trying to design my other libraries the exact same way. But I don't like that jQuery's current promises implementation is wrong :) I don't remember details, but it is mentioned somewhere in here: You're Missing the Point of Promises.
Done in v3.