jQuery-less imagesLoaded #46

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

Comments

3 participants
@desandro
Owner

desandro commented Dec 30, 2012

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

This comment has been minimized.

Show comment
Hide comment
@darsain

darsain Dec 30, 2012

Collaborator

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

Collaborator

darsain commented Dec 30, 2012

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

@darsain

This comment has been minimized.

Show comment
Hide comment
@darsain

darsain Jan 4, 2013

Collaborator

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

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

This comment has been minimized.

Show comment
Hide comment
@desandro

desandro Jan 4, 2013

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@jonathanong

jonathanong Jan 4, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@darsain

darsain Jan 4, 2013

Collaborator

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

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

This comment has been minimized.

Show comment
Hide comment
@jonathanong

jonathanong Jan 4, 2013

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

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

@desandro

This comment has been minimized.

Show comment
Hide comment
@desandro

desandro Jan 4, 2013

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@darsain

darsain Jan 4, 2013

Collaborator

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.

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

This comment has been minimized.

Show comment
Hide comment
@desandro

desandro May 27, 2013

Owner

Done in v3.

Owner

desandro commented May 27, 2013

Done in v3.

@desandro desandro closed this May 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment