Take the 2-minute tour ×

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 syntax compatible with jQuery's? Is Zepto just a subset of jQuery?

share|improve this question
They managed to have a syntax compatible with jQuery, by looking at its API and emulating the behavior. It's not that hard. –  Rocket Hazmat Sep 15 '11 at 20:07
add comment

closed as not constructive by Sean Vieira, Rocket Hazmat, Jeff Atwood Sep 15 '11 at 22:14


2 Answers

up vote 3 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
Their goal is a minimalistic library geared towards mobile platforms and loading times. –  Shawn Khameneh Sep 15 '11 at 20:26
add comment
