开发者

Is Zepto just a subset of jQuery? [closed]

开发者 https://www.devze.com 2023-04-05 17:47 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消