by NathanKP · 16y ago · 0 comments
Just taking a quick peek, for example if we look at .show()/.hide(): http://github.com/madrobby/zepto/blob/master/src/zepto.js#L5... http://github.com/jquery/jquery/blob/master/src/effects.js#L...
There is a major case where Zepto's technique just straight-out breaks: If you are showing or hiding anything that isn't a block element. This includes inline elements, table rows, or inline-block elements.
There doesn't appear to actually be anyway to unbind an event once you've attached it. Nor any way to detach all handlers of a specific type.
There is not a single bug fix for querySelectorAll - this includes the fact that querying from rooted nodes is completely broken for most cases.
I can keep going but yeah - there's a world of difference between Zepto and jQuery.
If you're only targeting bleeding-edge WebKit mobile browsers then yeah, Zepto might be fine. However in the jQuery project we take a far more pragmatic view of web development: There are more browsers than just WebKit and the market is much more complex. You can read more about it here: http://jquerymobile.com/strategy/
That's true. Lot's of it is. Some of it is not. And yes, it targets bleeding edge WebKit mobile browsers.
Yes, some of it is broken and doesn't work correctly yet.
Some of it fixes bugs that jQuery doesn't fix AFAIK (like memory leaks on asset removal on iOS devices).
It's an early beta.
And it does it all in 2K.
I don't care about what the jQuery project does, and how it takes "a far more pragmatic view of web development"; Zepto.js doesn't want to be a do-it-all-works-everywhere-project; so I really don't get your condescending tone ("just taking a quick peak...", "straight-out breaks", "missing critical functionality", "broken for most cases", "I can keep on going", "...might be fine").
(Zepto is broken across multiple files so I might be missing some functionality.)
Roughly, Zepto has this many properties/method: On $: 5, On $.fn: 32.
jQuery has: On $: 95, On $.fn: 146.
Phrases like "jQuery-compatible syntax (lots of the jQuery API supported!)" make it seem like you can just rip jQuery out of an application and drop Zepto in - and it'll just work. Zepto only supports about 15% of the jQuery API - I'm very skeptical that any major jQuery plugin would "just work" given the provided API.
Framing the marketing within the context of jQuery (or, really, even Prototype) is disingenuous and creates a deceptive message. A better way to market the code would be: "Zepto provides a simple API for making JavaScript awesome in the latest WebKit mobile browsers - all in 2KB!"
That's 100% accurate and frames the code in a way that users will be able to grasp (2KB is nothing! It'll make my code simpler when I build my next PhoneGap app!). Whereas framing it within the context of jQuery doesn't benefit Zepto - it doesn't support more than one platform and it doesn't support the full jQuery API.
Zepto has been positioned as compatible with jQuery - inviting opinion on the subject.
As the comparison was one of the core selling points of the argument for Zepto, it's actually wide open for discussion.
http://gs.statcounter.com/#mobile_browser-ww-monthly-200909-...
It frustrates me to no end that the only JavaScript tools being developed in this day and age, for mobile platforms, exclusively target the latest WebKit: Sencha Touch, jQTouch, Zepto, etc - they all exclusively focus on the latest WebKits and it's completely baffling. No web developer in their right mind would drop support for IE - no one would hire them - and yet they seem to be fine taking that approach on mobile.
Even if these tools are only being built to be used within a "safe" environment like PhoneGap - web developers don't understand that distinction. If the only tools for mobile web developers target WebKit platforms then web developers will only ever target WebKit platforms. As has been shown in the past competition is absolutely critical to the health and longevity of the browser - when one platform dominates and doesn't receive competition the platform will stagnate.
Not only is targeting multiple platforms pragmatic, you get more users visiting your sites thus making you more money, but you also help the health of the mobile web as a whole: Pushing more browsers to compete better and provide an improved experience to all users.
I don't want to be restricted by implementing something what works on every mobile browser (do you still support WAP?). Again, I want to build the most amazing applications. If that means some browsers can't show it, well, too bad.
I'm doing the web a disservice because I release a library that only works with one mobile browser? The web as a whole will suffer from that? What do you know about my customers? What do you know about the sites and apps I want to create?
And web developers aren't smart enough to understand the difference between developing for PhoneGap and the web?
Please don't lecture me about making money and about making awesome user experiences. I can very well take care of that myself, thank you.
Right now it makes a lot of sense to only target WebKit browsers simply because it's the only decent rendering engine that's available on decent mobile phones. Zepto could easily support a mobile version of Firefox or IE once Firefox catches up in terms of performance and size and IE catches up in terms of support for HTML5, CSS3 and other emerging web standards.
Finally, stating that "web developers don't understand that distinction" sounds slightly derogatory, don't you think?
No consumer in their right mind would use IE on a mobile :/
FWIW my webapp is 20% Chrome, 55% Firefox, 19% IE (All mainly desktop users). So dropping support for IE isn't that insane.
Mobile devices don't have the staying factor of desktop browsers (most users upgrade their phone/plan every 2-3 years). Shouldn't we target the best devices going forward to ensure that adoption of technology keeps up and everyone is entitled to the best experience overall?
However, everyone here is constantly ignoring Opera. Opera's Presto competes head-on with Webkit in standards support and performance and has higher market share. And Opera Mobile has the best mobile UI in the market (although that's debatable due to personal preferences) and biggest feature set.
What's really a disservice and plan stupid is to outright ignore Opera and even worse not mentioning it entirely when discussing mobile app or mobile web app development.
On the other hand, most micro-frameworks require the user to take more responsibility for making sure things don't break - which could mean lighter code... a good thing for mobile. For example, Emile does a fine job of tweening integers or colors, but watchout for inherited values - like fontWeight 'normal'. So the user has to take the extra step of defaulting the styles to values the script can work with.
It's an iPhone and Android only website. Would have been perfect!
Zepto.js and jQueryMobile have different purposes, just deal with it.
I mean - either it's feature complete and it's small or it's not feature complete and its size is unknown. A large portion of the linked-to site is dedicated to the size of the library so I assumed that it was feature complete (as did most of the people in this thread).
Whats left are what (at least I use) about 90% of the time: querying, manipulation and ajax.
FWIW browser differences are always vastly overplayed by 'framework' developers.
The fact that pretty much all js frameworks periodically announce speedups of 50%+ should ring alarm bells.
Your point about framework docs being better than JS docs is a little puzzling. I think the folks at Mozilla.org would take issue. Plus, there is at least one very excellent JS book ("JavaScript: The Good Part", Crockford) out there to get people started, and most of the silly "Learn JavaScript in 24hours" type books aren't on any JS dev's bookshelf that I've seen (except as a joke).
Relax and go back to coding. :)
The speedups in frameworks are realizations of better ways to do things that a group of programmers came up with - which is almost definitely going to be a better way of doing things outside of a community. That argument would only work if your functions were always as fast as possible at start. Don't forget Chrome was already the fastest browser out there for JS, and they still have improvements of 50%+ in updates.