I have built an app using jQuery mobile. Apart of some compatibility issues across different Android devices I have experienced extremely poor performance on Android system. Because even clean template from jquerymobile.com works slow on my galaxy tab I’ve decided that maybe removing unnecessary parts of jQuery will speed it up a bit. But has anyone already tried it ? Is it even possible ?
I have built an app using jQuery mobile. Apart of some compatibility issues across
Share
It is impossible to run jQuery Mobile without jQuery itself. (that’s for the people who might come here and not know that already)
You can try to shrink the size of JQ and JQM.
Sadly, I don’t think there is a lot to remove from jQuery. I’ll give it anoder thought and edit 😉
But you sure can “clean up” jQuery Mobile as it consists of widgets. Get JQM from github, read about “compilation” and you’ll know what to do.
I am planning to do the exact thing, so I’m quite sure it can be done.
If you don’t use selectboxes you can just remove the widget from the manifest file and after
makingits CSS and code should not get into the build.So you can easily shrink JQM down upto (my guess) about half the size if you don’t use any form elements, collapsibles listviews etc. and the basics should still work.
[edit]
Possible jQuery shrinking will be hard, but you can try removing:
The best way to do the tidying is to replace the body of the function you think you don’t need with a
alert('damnit!')to see if you really didn’t need it 😉To be sure it remains working and stable you should only replace functions that are bound to names. Try not to replace or remove any closures or functions that return functions.
And do it AFTER YOUR code is TESTED to always work correctly. Repeat tests after messing up the J*