PastryKit – Why?

Recently, John Gruber publicised the PastryKit JavaScript framework which Apple uses to give a ‘Native’ iPhone experience in iPhone WebApps published by Apple (see the DF post for example videos). What I haven’t seen anywhere is an explanation of why Apple would take this route (a JavaScript framework) to provide this experience.

The alternative approach would be for Apple to build support for this functionality into the MobileSafari browser. This could be done with, for example, Vendor Specific CSS Properties. They could introduce -iphone-app, -iphone-header, -iphone-toolbar, and -iphone-momentumscroll. These could be applied to specific <div> elements, allowing the MobileSafari to suppress Safari chrome and place elements in the correct place. There would be a few advantages to this. Firstly, the performance would be far superior. The performance on the iPhone and iPhone 3G of PastryKit isn’t quite good enough. Implementing the functionality within the browser engine would have far superior performance. Even where PastryKit performs acceptably today, it’s still chewing unnecessary battery. Secondly, extending MobileSafari would allow the functionality to be easily used by developers outwith Apple, without having to include a lot of additional JavaScript in their appliation. Thirdly, it would be iPhone specific. As it stands, I assume that PastryKit webapps running on Firefox mobile (Fennec) will behave like an iPhone app, even running on other platforms. That seems like something that Apple wouldn’t want to encourage. There are more advantages to xtending MobileSafari, but those are the main ones.

So why might Apple have developed PastryKit, and what might they be planning? I can’t help but think that this is a skunkworks or R&D project that’s escaped, without any strategic thought on Apple’s part. In that case, use of it is probably a tactical move, which I think will over time by building the support into MobileSafari. How long that takes will, IMO,  depend on the AppStore, and the competition it and the iPhone receive from Android and Pre. I think it’s only when webapps become popular on those platforms that Apple will take the step to improve the iPhone web SDK.

Another possibility is that Apple want to provide the iPhone experience on non-iPhone hardware. I can’t quite get my head around this possibility. But Apple do have a knack for surprises.

0 Responses to “PastryKit – Why?”



  1. Leave a Comment

Leave a Reply




About

I’m David Illsley, I work in Web Services development at IBM Hursley, which involves work on the Apache WS Project, where I am a committer and PMC member. When not working with technology, I spend a lot of time on the backstage aspects of theatre, and a sadly decreasing amount of time reading.

Archives

c

Disclaimer

The postings on this site solely reflect the personal views of the author and do not necessarily represent the views, positions, strategies or opinions of IBM or IBM management.

Twitter Updates

  • @katshann methinks someone's playing referrer games... (not me)... I'm barely in the top 30 search terms for my blog in the last 30 days 2 hours ago
  • @goodgravy Good luck! Sounds hopeful... 14 hours ago
  • Struggling to 'Open Link in New Tab' in recent Firefox nightlies. Muscle memory is just too strong 3 days ago
  • Dice games... what's the worst that can happen... #fb 5 days ago
  • Apparently one of my colleagues is 'prepared for DELETION'. That's a little more Logan's Run than I think he's expecting. 6 days ago