20

I'm wondering if someone has tried already to port jQueryMobile on top of Zepto.js (http://zeptojs.com/) instead of the required jQuery?

djot
  • 2,952
  • 4
  • 19
  • 28
Samber Valley
  • 261
  • 1
  • 2
  • 5

5 Answers5

16

The main feature of Zepto.js over jQuery is its file size of ~10kb (minified, not gzipped) instead of jQuery's ~80kb. If you were to replace jQuery wuth Zepto.js then you'd still have to include jQuery mobile, which weighs in about 95kb (JS & CSS).

  • jQuery and jQuery mobile: 175kb
  • Zepto.js and jQuery mobile: 115kb

You'd save about 1/3rd of the download weight (not including HTML, images and other JS), making making a port of jQuery Mobile to Zepto.js unlikely to be worth the time.

Zepto.js currently also only supports WebKit browsers, meaning you'd be loosing support of Firefox Mobile and IE7&9 Mobile too.

Update: Zepto now supports a lot more platforms.

Wolfram
  • 8,044
  • 3
  • 45
  • 66
dave1010
  • 15,135
  • 7
  • 67
  • 64
  • 1
    Just an update, Zepto is supporting a large numbers of browser now including firefox and opera. Support for IE is underway. http://zeptojs.com/ – Hasanavi May 28 '12 at 11:20
11

dave1010 makes good points.

You may also be interested in a back & forth between the creator of Zepto (madrobby) and jQuery (John Resig) on Hacker News

webmat
  • 58,466
  • 12
  • 54
  • 59
  • 1
    @max That is almost 2 year old rant abount Zepto vs Jqeury. And even in that topic the rant is on the first beta release of zepto. – Plippie May 29 '12 at 08:26
  • @webmat The link is nothing more then a rant/bribe topic. comparing apples to pears. Not anything positive or real comparable comes out of it. – Plippie May 29 '12 at 08:30
4

I think it's simply to early for that. jQuery Mobile hasn't seen an official release yet (only alpha2) and zepto.js is also still in its infancy.

Furthermore, zepto.js states "[...] that emulation of all features of jQuery is not a project goal", they just want to emulate the most useful parts. With this direction it is questionable if zepto.js can ever serve as a drop-in-replacement for jQuery in the mobile context.

However, a possible success of zepto.js could inspire the jQuery team... maybe we will soon see a "jQuery for Chrome Smartphones" build that has all IE/Firefox/Opera stuff compiled out.

fbuchinger
  • 4,494
  • 2
  • 30
  • 31
  • Although in some cases it's desirable to target specific user agents, encouraging developers to do this based on the current browser market shares doesn't seem like a good idea. – dave1010 Feb 28 '11 at 10:10
1

jqtouch already support zeptojs, you may want to give it a try.

Muayyad Alsadi
  • 1,506
  • 15
  • 23
0

I started on a web project and I really, rally wanna use Zepto, but the current users developing for Zepto is really low. Not a big community, not to many plugins and I don't see why not using google's CDN for jQuery.

Zepto is great for senior JavaScript developers maybe.

Adrian Florescu
  • 4,454
  • 8
  • 50
  • 74