• Tumblr for iPhone is now 100% native

    My appreciation for those who build web browsers has grown dramatically over the past few months.

    With today’s 3.2 release I’m happy to announce that Tumblr for iPhone is now 100% native. We love web technologies at Tumblr but believe this change provides a much better experience for this particular product.

    HTML is the first-class citizen at Tumblr. All posts, whether authored in plain text, Markdown, or using our WYSIWIG editor, are stored as HTML. This is what we use to build your dashboard both on the website and in the mobile apps, via our API.

    The decision to use a web view to render lists of posts in the 3.0 rewrite (June 2012) had nothing to do with cross-platform compatibility or ease of development and everything to do with needing to render (somewhat) arbitrary HTML, provided by our users. This makes building a Tumblr iOS app of the highest caliber an interesting challenge.

    As noted by Zach Williams, we used GRMustache to render the post lists and Zepto.js was used to implement the web view’s behavior, with some slight modications (the longTap event didn’t work exactly the way we wanted, tap wouldn’t play HTML5 audio, and we needed to prevent touches while scrolling). CSS classes were used instead of :active pseudo-classes so they could be removed programmatically, as scrolling began. Our JavaScript-native “bridge” was basically this example.

    Suitable scrolling performance was difficult to achieve in the web view as lists of Tumblr posts are usually extremely media-heavy. Some of the measures we took included using images in place of border-radius and box-shadow CSS and scaling/compressing photos on our servers, to the exact size needed on the phone.

    We considered writing a JavaScript dequeuing mechanism but didn’t end up doing so. Since our 3.0 release, Airbnb open-sourced their “UITableView for the web” in ∞.js and LinkedIn published a detailed overview of how they approached a similar problem in their iPad application. Anyone attempting to build a web/native hybrid application like we did should take a look at both of these resources first.

    I’m excited about the speed and stability that I believe going fully native has brought to our app, but please let me know how we can make the Tumblr iOS experience even better.