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

PWA: A replacement for your native mobile app?

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

PWA: A replacement for your native mobile app?

With this presentation I focus on 3 chapters about Progressive Web Apps;

1. What web can do today?
2. How to build a PWA today.
3. Is PWA a replacement for your native mobile app?

Avatar for Önder Ceylan

Önder Ceylan

June 18, 2018
Tweet

More Decks by Önder Ceylan

Other Decks in Programming

Transcript

  1. @onderceylan PWAs Agenda • Chapter 1: What web can do

    today? • Chapter 2: How can I build a PWA right away? • Chapter 3: Is PWA a replacement for my native mobile app?
  2. @onderceylan PWAs A quick PWA primer • A modern web

    app that uses new APIs to provide an app-like experience for users. • It involves a few web standards, namely; • Service Worker. Which enable true reliability on the web. What I mean by that is I can build an app that as long as you loaded it while you were online, from then on it will always open, even if you’re not. This puts it on equal footing with other apps. • HTTPS. Requires encrypted connections • Web App Manifest. A simple JSON file that describes your application. What icons to use is someone adds it to their home screen, what its name is, etc
  3. @onderceylan PWAs • PWAs can be fast and robust. •

    PWAs can offer push notifications, integration with other apps (and the web), location services. • PWAs can use device features like cameras, data storage, GPS and motion sensors, face detection, and more. • The point is to create something that will work when there’s no internet connection, and make it possible to launch it right from the Home screen, just like a native app.
  4. @onderceylan PWAs The facts • 53% of users will abandon

    a site if it does not load within 3 seconds on a mobile device. • Sites that loaded within 5 seconds earned twice as much ad revenue as slower sites. • Most sites take about 19 seconds to load on a 3G network. * According to an expansive Doubleclick by Google user study.
  5. @onderceylan PWAs Start with service workers • Improve performance of

    your application/site • Make your app "offline-first" • Act as the base for advanced features • Notifications API • Push API • Background Sync API • Channel Messaging API
  6. @onderceylan PWAs Service worker lifecycle • A service worker goes

    through three steps in its lifecycle: • Registration • Installation • Activation
  7. @onderceylan PWAs Libraries to code service workers • Development with

    the service worker is not necessarily a trivial process. It is, by design, a low-level API and there can be a fair bit of code involved. While you could write your own service worker code, there are some libraries provided that automate many of the details for you while also following the best practices and avoiding common gotchas. • Earlier versions of PWA used the sw-toolbox library and sw- precache module that are built on top of the service worker primitives, like the Cache and Fetch APIs. These tools abstract low- level complexities and make it easier for developers to work with service workers.
  8. @onderceylan PWAs Libraries to code service workers Workbox is the

    successor to sw-precache and sw-toolbox. It is a collection of libraries and tools used for generating a service worker, precaching, routing, and runtime-caching. Workbox also includes modules for easily integrating background sync and Google analytics into your service worker.
  9. @onderceylan PWAs Application shell • Reliable performance that is consistently

    fast • Application-like interactions • Economical use of data Benefits
  10. @onderceylan PWAs Caching strategies • Stale-While-Revalidate • Cache first, Network

    fallback • Network first, Cache fallback • Cache/network race • Network only • Cache only
  11. @onderceylan PWAs Ionic PWA toolkit • Ionic • Stencil •

    Workbox • Firebase http://bit.ly/pwa-tkit
  12. @onderceylan PWAs Gartner predicts that by 2020, 50% of general-purpose,

    consumer-facing mobile apps will be PWAs. http://bit.ly/pwa-gartner
  13. @onderceylan PWAs Let’s get one thing out of the way:

    PWAs vs. native apps isn’t a winner-take-all battle.
  14. @onderceylan PWAs Forward looking statements • PWA-only startups • PWAs

    listed in App Stores • PWAs on iOS • PWAs everywhere