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.

Advertisement

0 Responses to “PastryKit – Why?”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




About

I’m David Illsley, I’m a Software Engineer, currently working for Morgan Stanley in London. In the past I worked for IBM developing products in the WebSphere family, and before that I studied at Edinburgh University. I'm also a PMC member @TheASF, and outside the realms of technology, enjoy skulking around the dark corners of theatre...

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 my employer.

Twitter Updates

  • *aaah* Another long weekend. I could get used to this. #fb 3 days ago
  • @ajdaniel what is now crap? Have you played with the new built in dev tools? 6 days ago
  • Frustrating not to make it to either fosdem or monkigras this week... It's like 3 buses at once or something 6 days ago
  • Wow, Danish crematoria are are pretty, uh, matter of fact… #borgen 1 week ago
  • @sd_nicholas it's a hedge against changes as it predates the final spec. Unprefixed version I think is due soon. 2 weeks ago

Follow

Get every new post delivered to your Inbox.