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

The pursuit of PWAppiness

The pursuit of PWAppiness

Thanks to modern web browsers, it is now possible to build (progressive) webapps that can integrate with device APIs, work without internet connectivity and offer incremental delivery thanks to code splitting.
However, how many aspects should a developer keep in mind to actually succeed in implementing a PWA that is performant and respects users' expectations regarding interactions?
In this talk, we will take a look at some of them and what is the complexity of achieving a great quality mobile web application.

Simone D'Avico

June 13, 2018
Tweet

More Decks by Simone D'Avico

Other Decks in Programming

Transcript

  1. Reliable “When launched from the user’s home screen, service workers

    enable a PWA to load instantly, regardless of the network state.”
  2. Fast “53% of users will abandon a site if it

    takes longer than 3 seconds to load! And once loaded, users expect them to be fast—no janky scrolling or slow-to-respond interfaces.”
  3. Reliable “When launched from the user’s home screen, service workers

    enable a PWA to load instantly, regardless of the network state.”
  4. addEventListener('fetch', fetchEvent => { fetchEvent.respondWith(caches.match(fetchEvent.request) .then(async cachedResponse => { if

    (cachedResponse) return cachedResponse; const response = await fetch(fetchEvent.request); const cache = await caches.open('whatever'); cache.put(fetchEvent.request, response); return response.clone(); }) ); });
  5. Reliability, aka consistency If there’s another active Service Worker on

    our site—if there’s an open tab under its control—the new Service Worker goes into a waiting state.
  6. • Service Worker Lifecycle • Cache API • Registration API

    • Clients API Reliability, aka consistency
  7. Fast “53% of users will abandon a site if it

    takes longer than 3 seconds to load! And once loaded, users expect them to be fast—no janky scrolling or slow-to-respond interfaces.”
  8. DOM Recycling Low-end devices will get noticeably slower if not

    completely unusable if the website has too big of a DOM to manage.
  9. Use absolutely positioned elements with transforms. Layout Cache the positions

    where each item ends up and immediately load elements from cache
  10. Reinvent the web •Ken Wheeler - Why we need a

    better browser •https://github.com/necolas/react-native-web •https://github.com/vincentriemer/react-native-dom
  11. References • Google Dev - Reusable Web Components • Google

    Dev - Progressive Web Apps • Google Dev - Complexities of an infinite scroller • Service Workers break the refresh button • React Native docs