Why jQuery Mobile Isn’t a Fair jQuery Addon

| Comments

While looking at the source code of jQuery mobile I just figured out that jQuery mobile is using undocumented features of jQuery. Which is pretty bad because first of all to contribute to jQuery mobile it is necessary to have knowledge about the internal behavior of jQuery. The next issue is the consistency of an internal function. I guess there is a reason why the jQuery team is not providing any documentation about a particular function. Maybe because they want to get rid of if? Maybe it’s functionality is changing within the next release? So I think in general it’s not very smart to use something which is not documented, even if it’s possible. However because jQuery mobile does this it is difficult to get rid of the jQuery library if you are planning to do so.

Maybe you have already heard about Zepto.js (it’s not such a new thing). The goal of Zepto is to provide the same (public) interface as jQuery but to remove all parts of the internal functionality which are irrelevant for mobile applications. So all crossbrowser related stuff to handle IE properly will not be included in Zepto. Because of this, Zepto decreases the library size and increases loading speed. So it would be awesome to use the jQuery mobile widget kit with Zepto instead of jQuery. But to achieve this it is not enough to provide the same interface like jQuery…. unfortunately.

So far I found calls for these functions in jQuery mobile:

  • $.expr
  • $.style

If you are interested in porting some of your applications to Zepto, Ms. Pamela Fox already ported some successfully.

Copyright © 2014 - Damien Antipa. Powered by Octopress