I was amazed that backbone.js can use either jQuery or Zepto as its "helper library". How did the Zepto people manage to have a synta开发者_开发技巧x compatible with jQuery's? Is Zepto just a subset of jQuery?
Seems they are trying to keep with the jQuery style syntax and providing a minified library that only includes the most useful features.
Zepto.js should closely emulate it. Note that emulation of all features of jQuery is not a project goal, rather we want the most useful parts while keeping to the ~5k minified goal.
From: https://github.com/madrobby/zepto/blob/master/README.rdoc
Zepto is a new library where their goal is to make it easy to transition from jQuery. It's obvious they are leaving out many functions you'd find in jQuery to do so.
It also looks like they are keeping prototype functionality in mind too.
I also wouldn't be surprised if they are choosing smaller blocks of code over performance, I'm not saying it's heavily detrimental to performance or jQuery is overly bloated, but a different outlook than jQuery has had lately.
精彩评论