jQueryMobile on Zepto.js?
I'm wondering if someone has tried already t开发者_如何学运维o port jQueryMobile on top of Zepto.js (http://zeptojs.com/) instead of the required jQuery?
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.
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
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.
jqtouch already support zeptojs, you may want to give it a try.
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.
精彩评论