Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery-less imagesLoaded #46

Closed
desandro opened this issue Dec 30, 2012 · 9 comments
Closed

jQuery-less imagesLoaded #46

desandro opened this issue Dec 30, 2012 · 9 comments
Milestone

Comments

@desandro
Copy link
Owner

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. 🔔

@darsain
Copy link
Collaborator

darsain commented Dec 30, 2012

I'll take a shot at it. See what I'll run into :)

@darsain
Copy link
Collaborator

darsain commented Jan 4, 2013

@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.

@desandro
Copy link
Owner Author

desandro commented Jan 4, 2013

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.

@jonathanong
Copy link

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

@darsain
Copy link
Collaborator

darsain commented Jan 4, 2013

@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.

@jonathanong
Copy link

You have dependencies now, the only difference being they're hard coded. And a promise library would be a dependency as well.

@desandro
Copy link
Owner Author

desandro commented Jan 4, 2013

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.

@darsain
Copy link
Collaborator

darsain commented Jan 4, 2013

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.

@desandro
Copy link
Owner Author

Done in v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants