Live data from Hacker News

Mobile development with HTML5

engineyard.com

11–20 of 39 posts

Re: Mobile development with HTML5

#11

I recently visited a site from HN on my phone, but its text was a bit too small for me to read, so I tried zooming in. To my surprise, it didn't zoom at all! From this article, the website must have set user-scalable=no. I don't really see the point of this option. The website can (presumably) scale to many different devices already, surely it can then scale with zooming as well. I'd think you could use percentages t…

Setting user-scalable=no makes me RAGE at the developer, and then generally close the site.

Re: Mobile development with HTML5

#12

I recently visited a site from HN on my phone, but its text was a bit too small for me to read, so I tried zooming in. To my surprise, it didn't zoom at all! From this article, the website must have set user-scalable=no. I don't really see the point of this option. The website can (presumably) scale to many different devices already, surely it can then scale with zooming as well. I'd think you could use percentages t…

[deleted]

Re: Mobile development with HTML5

#13

Real-world web-app development is much different than the ideal of HTML5. jQuery? Just including that puts your mobile web-app at 86KB of JavaScript and you haven't even written a single line of your app's code. Rendering on the client-side with jQuery templates is not anywhere near practical for the majority of web-enabled phones – if not all of them except the iPhone. More than 100-150KB of JS and most phones will…

  > don't use CSS3
Be careful with your advice. Using CSS3 3D transforms gives you hardware acceleration.

Re: Mobile development with HTML5

#14

Real-world web-app development is much different than the ideal of HTML5. jQuery? Just including that puts your mobile web-app at 86KB of JavaScript and you haven't even written a single line of your app's code. Rendering on the client-side with jQuery templates is not anywhere near practical for the majority of web-enabled phones – if not all of them except the iPhone. More than 100-150KB of JS and most phones will…

Asking from nearly complete ignorance here but: with a JS compiler/optimizer like Google's Closure [1] wouldn't it be possible to still use jQuery but have all the unnecessary code that's not used striped out?

[1]: http://code.google.com/closure/compiler/

Re: Mobile development with HTML5

#15

Real-world web-app development is much different than the ideal of HTML5. jQuery? Just including that puts your mobile web-app at 86KB of JavaScript and you haven't even written a single line of your app's code. Rendering on the client-side with jQuery templates is not anywhere near practical for the majority of web-enabled phones – if not all of them except the iPhone. More than 100-150KB of JS and most phones will…

Asking from nearly complete ignorance here but: with a JS compiler/optimizer like Google's Closure [1] wouldn't it be possible to still use jQuery but have all the unnecessary code that's not used striped out? [1]: http://code.google.com/closure/compiler/

I'd take a guess that you need to write your JS with Closure in mind. I wonder how much jQuery code would be stripped out with the Closure compiler.

Re: Mobile development with HTML5

#16

Real-world web-app development is much different than the ideal of HTML5. jQuery? Just including that puts your mobile web-app at 86KB of JavaScript and you haven't even written a single line of your app's code. Rendering on the client-side with jQuery templates is not anywhere near practical for the majority of web-enabled phones – if not all of them except the iPhone. More than 100-150KB of JS and most phones will…

I'm curious what browsers you're supporting and experience you're aiming for with your hand rolled javascript.

Targeting phones outside of iOS and Android with anything but the most basic functionality is a difficult task without help. A prime example being the 500+ ms delay created when adding event listeners for click instead of touch events. Click covers everything but it creates a perceptibly slow ui for the user.

Re: Mobile development with HTML5

#17
post #11

I recently visited a site from HN on my phone, but its text was a bit too small for me to read, so I tried zooming in. To my surprise, it didn't zoom at all! From this article, the website must have set user-scalable=no. I don't really see the point of this option. The website can (presumably) scale to many different devices already, surely it can then scale with zooming as well. I'd think you could use percentages t…

Setting user-scalable=no makes me RAGE at the developer, and then generally close the site.

Shouldn't you rage at your browser for respecting the flag?

Re: Mobile development with HTML5

#18

Earlier quoted context omitted.

Asking from nearly complete ignorance here but: with a JS compiler/optimizer like Google's Closure [1] wouldn't it be possible to still use jQuery but have all the unnecessary code that's not used striped out? [1]: http://code.google.com/closure/compiler/

I'd take a guess that you need to write your JS with Closure in mind. I wonder how much jQuery code would be stripped out with the Closure compiler.

That might be the case. This blog post [1] shows some examples of what the advance optimizations do and it seems that, while it'll shorten everithing up, things that are put in the global namespace (window) will not be stripped even when they aren't called. As jQuery adds the 'jQuery' and '$' variable to the global namespace and all it's functions are attached to that object, I would assume that the Closure compile connot remove any of them.

Of course, this is all pure speculation, it'd be much better to test this out.

[1]: http://www.bitstorm.org/weblog/2010-8/Introduction_to_the_Go...

Re: Mobile development with HTML5

#19

I recently visited a site from HN on my phone, but its text was a bit too small for me to read, so I tried zooming in. To my surprise, it didn't zoom at all! From this article, the website must have set user-scalable=no. I don't really see the point of this option. The website can (presumably) scale to many different devices already, surely it can then scale with zooming as well. I'd think you could use percentages t…

user-scalable=yes breaks presentation on iPad when switching orientation

http://adactio.com/journal/4470/

Re: Mobile development with HTML5

#20

Earlier quoted context omitted.

I'd take a guess that you need to write your JS with Closure in mind. I wonder how much jQuery code would be stripped out with the Closure compiler.

That might be the case. This blog post [1] shows some examples of what the advance optimizations do and it seems that, while it'll shorten everithing up, things that are put in the global namespace (window) will not be stripped even when they aren't called. As jQuery adds the 'jQuery' and '$' variable to the global namespace and all it's functions are attached to that object, I would assume that the Closure compile c…

Closure can definitely remove functions that are never called - but I wonder if its static analysis can figure out jQuery style code. My guess is that it'll do a decent job, but jQuery would need many changes to get it to compile.
Post reply on HN