Re:You half assed it. That is why your PhoneGap application ...
by apike on Wednesday June 06, 2012 @08:13PM
(#4076877)
The problem is absolutely not about initial download, but rather about runtime performance. Parsing and executing 500k of JavaScript on mobile is crazy slow, and it blocks the whole app while this is happening. You can mitigate this by loading the JS on demand, but you still need to pay the cost at some point. For the time being, the best approach is to only include what JavaScript you absolutely need.
Re:You half assed it. That is why your PhoneGap application ...
by joemoon on Thursday June 07, 2012 @12:18AM
(#4077580)
I just want to echo want apike is saying. There are several comments here incorrectly stating that this much javascript doesn't matter. It seems pretty obvious that those commenters have no experience developing mobile web apps. Loading jquery is a huge hit, taking anywhere from .5s to 1.5s to initialize, depending on the device and what else is eating up resources at load time.
Re:You half assed it. That is why your PhoneGap application ...
by sintaxi on Wednesday June 06, 2012 @05:07PM
(#4076232)
It's a footprint issue, not latency. A 94k jQuery file comes at a price and 99% of that codebase never gets hit for an application like this.
Re:You half assed it. That is why your PhoneGap application ...
by elliottkember on Wednesday June 06, 2012 @05:53PM
(#4076412)
That's not a big footprint for an app, especially compared with image assets, app code and CSS bundled alongside.
It also means being able to add more functionality at will without having to rebundle, or worse, work on basic functionality helpers. Just seems like wasted time for such a small improvement. These devices were built to have application code on them.
Re:You half assed it. That is why your PhoneGap application ...
by eli on Wednesday June 06, 2012 @06:54PM
(#4076623)
Seems mostly academic, no? Do you think fewer people will download a 1.4MB app versus a 1.2MB app?
Re:You half assed it. That is why your PhoneGap application ...
by cageface on Wednesday June 06, 2012 @09:08PM
(#4077051)
Zepto is 24k. Does that extra 70k really make that big of a difference? A single retina resolution png is going to be bigger than that. I think there are other reasons to consider a library that's tailored for mobile webkit but size doesn't seem like a dealbreaker.
Re:You half assed it. That is why your PhoneGap application ...
by ahrjay on Wednesday June 06, 2012 @06:20PM
(#4076506)
The ontouchstart issue can be avoided by using the ontouchmove/end to check of the user is scrolling. Infact zepto.js has a custom event called "tap" which does exactly that.
Re:You half assed it. That is why your PhoneGap application ...
by eli on Wednesday June 06, 2012 @06:53PM
(#4076616)
jQuery Mobile already handles taps and swipes for you: http://jquerymobile.com/test/docs/api/events.html
Second, ontouchstart is a tricky game. It's wonderfully fast, but breaks scrolling completely if you start scrolling from an ontouchstart-bound element.
Basically, it's a shortcut around learning Objective-C. You get a lot of quick wins, but the end product isn't quite as good - except if you're doing something unusual, like one-page apps with no scrolling. I find it's good for prototyping.