3

Just a quick question about JQuery, I've been using phonegap and made a few apps with JQuery. One in particularly runs really slowly so I've been trying to slim it down as much as possible.

One change I've been considering is replacing JQuery with something smaller. What would be the most painless replacement, ie what could I use that would need the least code change and have as much of JQuerys features as possible?

As far as I can tell xui is the winner, but maybe theres something else out there I'm not aware of?

Also am I right in saying JQuery Mobile goes on top of JQuery, so the footprint is actually larger?

Please share your advice on this, it would be a great help.

Thanks

mao
  • 1,059
  • 2
  • 23
  • 43
  • I believe jQuery mobile uses jQuery-min – potato Dec 08 '11 at 12:53
  • Yep: http://jquerymobile.com/download/ . I've made a few pages that uses jQuery Mobile and they are not slow. Are you doing some sort of heavy operations? – OptimusCrime Dec 08 '11 at 12:57
  • Ok so jquery + jquery mobile weigh in at 174k still seems hefty compared to xui at 10.6k. I suppose it depends on whether xui can do what I need it to. – mao Dec 08 '11 at 12:58
  • I'd look at optimising your code first, before switching libraries. Also, the size of the library only affects the initial load times. If it's running slowly or not being responsive, it's down to the code you've written. – Rory McCrossan Dec 08 '11 at 12:59
  • The main culprits were html5 canvases which I have now replaced with css / webkit masks and populating a db, which is now pre populated and included. I'm just going through the app again trying to optimise to the maximum and jquery is the obvious target. – mao Dec 08 '11 at 13:04

3 Answers3

1

Take a look at Zepto; it's probably what you're looking for.

Edit: I'd also recommend jQuery 2.0 if you dont' need to support IE8. Should be less bloaty.

Esteban Araya
  • 29,284
  • 24
  • 107
  • 141
1

I find jQuery very bloated, and I don't use a lot of its features. So I always use xui. I also find Uranium really useful (and Uranium includes xui) - you don't need to write any javascript, just add attributes to HTML.

michael
  • 209
  • 1
  • 7
1

If you still like using jQuery and just want to cut down the size, try jquip. It allows you to only include the features of jQuery you actually use.

seth.miller
  • 1,988
  • 17
  • 23