Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Putting The Web Back In Web Applications

Putting The Web Back In Web Applications

As delivered at TXJS 2012

danwrong

June 14, 2012
Tweet

More Decks by danwrong

Other Decks in Programming

Transcript

  1. • W3C has many failed specs • CAN I CENTER

    SOME SHIT?? • Media is complicated • JavaScript WTF?!? Thursday, June 14, 12
  2. If you want to build apps then HTML5 is not

    the best tool for the job Thursday, June 14, 12
  3. Web applications are a series of trade-offs Shit Crap Passable

    We need to know the web and make trade-offs Thursday, June 14, 12
  4. “Everything that can be done on the client is done

    on the client” - Lea Verou Thursday, June 14, 12
  5. • Removed JavaScript (Hashbang) routing • Render all content on

    the server • Endpoints deliver rendered HTML • Defer loading of JavaScript What we’ve done Thursday, June 14, 12
  6. “I'm not happy with the new path of twitter, is

    a retro-revolution managed by an anti-SPI engineer” “Next, twitter will optimise by rendering HTML from PostgreSQL prepared statements.” “Client-side apps, templating engines and CPUs get faster. The only way to reduce latency to the server is to increase the speed of light.” Why can't u make it so the tweets can be longer? “Sanity prevails! @Twitter are ditching the "#!" and reducing JavaScript! #win #DoingItRight” Thursday, June 14, 12
  7. “I'm not happy with the new path of twitter, is

    a retro-revolution managed by an anti-SPI engineer” “Next, twitter will optimise by rendering HTML from PostgreSQL prepared statements.” “Client-side apps, templating engines and CPUs get faster. The only way to reduce latency to the server is to increase the speed of light.” Why can't u make it so the tweets can be longer? “Sanity prevails! @Twitter are ditching the "#!" and reducing JavaScript! #win #DoingItRight” Thursday, June 14, 12
  8. Time To First Tweet From navigation to the user seeing

    the timeline Thursday, June 14, 12
  9. • Could be improved across the board • Giant outliers

    from old machines and browsers • Big differences between countries Time To First Tweet needed work Thursday, June 14, 12
  10. 1. Get initial page 2.Get CSS 3.Get JavaScript 4.Get data

    5. Render template Rendering on the client Thursday, June 14, 12
  11. 1. Get initial page 2.Get CSS 3.Get JavaScript 4.Get data

    5. Render template Rendering on the client Thursday, June 14, 12
  12. 1. Get initial page 2.Get CSS 3.Get JavaScript 4.Get data

    5. Render template Rendering on the server Thursday, June 14, 12
  13. 1. Less to send over the wire 2.Less variance across

    browsers/devices 3.Less tests to run across multiple browsers 4.Less hard to track down errors Less code running on the browser Thursday, June 14, 12
  14. • Consume the REST API • Less hardware required •

    Less data over the wire • Faster navigation once app has loaded But if we render on the client-side... Thursday, June 14, 12
  15. • Consume the REST API • Less hardware required •

    Less data over the wire • Faster navigation once app has loaded But if we render on the client-side PJAX and caching Thursday, June 14, 12
  16. Making appropriate use of all the tools you have is

    the future Thursday, June 14, 12
  17. • HTTP Caching • History API • In Memory Caching

    • Streaming response bodies • Concurrent data fetches • Lazy loading • and so much more... Thursday, June 14, 12