madrobby/zepto — Issue #295: $.each "this" context
Author: jamietre
Created: 2011-10-22 08:45:28+00:00
State: open

.. it doesn't assign one, $.fn.each on the other hand does. This is really easy to fix of course, and I am interested in contributing to this project, but I wanted to make sure I understand the project goals before I make any pull requests.

1) For methods that zepto implements, is jQuery compatibility a goal? That is, is there an expectation that code written against zepto will also work with jQuery? I realize it's targeting mobile devices, but I'd love to be able to code in such a way that I can use it for all modern browsers instead of jQuery. Just do a browser check and load jQuery only when it's needed.

2) Along those lines any reason not to use the existing jQuery tests for methods that are covered?

3) zepto implements String.prototype.trim, jQuery on the other hand does not but does have things like $.trim and $.inArray (the latter of which I guess would not be needed by any of zepto's targeted browsers). I'm in the habit of using those methods just because they are there and the prototype fills are not with jQuery. Are they left out for philosophical reasons since zepto isn't really targeting old browsers anyway? Or would it be useful to fill in things like this? e.g. where's the line drawn for compatibility in basic stuff vs. size of the library.

If this is discussed somewhere already I apologize and just send me that way. Thanks!