Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

A year with progressive web apps! #webinale

100 vues

Publié le

About a year ago, we started using Progressive Web Apps (PWAs). The idea behind PWA was to replace native mobile apps. In this talk, I will show you what is possible to build with PWA, what kind of limitations exist, and what we learned in our journey. Along the way, you will see where progressive web apps can be a good fit for your own projects.

Publié dans : Logiciels
  • Identifiez-vous pour voir les commentaires

  • Soyez le premier à aimer ceci

A year with progressive web apps! #webinale

  1. 1. A year with progressive web apps! Antonio Perić-Mažar, Locastic 06.04.2019., #webinale
  2. 2. Antonio Perić-Mažar CEO @ Locastic Co-Founder @ Tinel Meetup Co-Founder @ Blockada antonio@locastic.com @antonioperic
  3. 3. Locastic • We help clients create amazing web and mobile apps (since 2011) • mobile development • web development • UX/UI • Training and Consulting • Shift Conference, Symfony Croatia • www.locastic.com t: @locastic
  4. 4. Stop call progressive web apps trendy!
  5. 5. Our world today
  6. 6. MOBILE
  7. 7. UX
  8. 8. MOBILE.UX.
  9. 9. https://www.morevisibility.com/blogs/analytics/setting-up-and-reporting-on-site-speed-in-google-analytics.html October 2016
  10. 10. Mobile web (UX) is broken!!!
  11. 11. And trust me… you will never had enough cheese
  12. 12. “I don't care how many kick-ass Visio architecture diagrams you have; as far as the user is concerned, the UI is the application. I know UI US HARD, but you have to build an impressive UI if you want to be taken seriously. Give your UI the high priority it deserves.” Jeff Atwood, Coding Horror blog
  13. 13. “I don't care how many kick-ass Visio architecture diagrams you have; as far as the user is concerned, the UI is the application. I know UI US HARD, but you have to build an impressive UI if you want to be taken seriously. Give your UI the high priority it deserves.” Jeff Atwood, Coding Horror blog
  14. 14. Capebility Reach
  15. 15. “A Progressive Web App uses modern web capabilities to deliver an app-like user experience.”
  16. 16. “A Progressive Web App uses modern web capabilities to deliver an app-like user experience.”
  17. 17. PWA is: • Progressive - Works for every user, regardless of browser choice because it's built with progressive enhancement as a core tenet. • Responsive - Fits any form factor: desktop, mobile, tablet, or whatever is next. • Connectivity independent - Enhanced with service workers to work offline or on low-quality networks. • App-like - Feels like an app, because the app shell model separates the application functionality from application content . • Fresh - Always up-to-date thanks to the service worker update process.
  18. 18. PWA is: • Safe - Served via HTTPS to prevent snooping and to ensure content hasn't been tampered with. • Discoverable - Is identifiable as an "application" thanks to W3C manifest and service worker registration scope, allowing search engines to find it. • Re-engageable - Makes re-engagement easy through features like push notifications. • Installable - Allows users to add apps they find most useful to their home screen without the hassle of an app store. • Linkable - Easily share the application via URL, does not require complex installation.
  19. 19. Fast Integrated Reliable Engaging 4 things to focus on
  20. 20. Fast Integrated Reliable Engaging
  21. 21. Fast • No junky scrolling • No slow load performance • Measure and improve all the time • Bad connection (or no connection) is not excuse
  22. 22. 53% of users abandon sites that take longer than 3 seconds to load
  23. 23. https://cloudfour.com/thinks/ios-doesnt-support-progressive-web-apps-so-what/
  24. 24. App shell model • Reliable performance that is consistently fast • Native-like interactions • Economical use of data
  25. 25. Fast Integrated Reliable Engaging
  26. 26. Integrated • User should not reach browser to reach your app • They should be able to interact same as with any other app on their device • They expect to have all possibilities as other apps • Users should be able to start app from their home screen
  27. 27. https://www.mobigyaan.com/android-8-0-oreo-vs-ios-11-which-is-better
  28. 28. https://techcrunch.com/2017/08/25/majority-of-u-s-consumers-still-download-zero-apps-per-month-says-comscore/
  29. 29. https://techcrunch.com/2017/08/25/majority-of-u-s-consumers-still-download-zero-apps-per-month-says-comscore/
  30. 30. https://www.technology.org/2017/07/28/progressive-web-apps-vs-native-which-is-better-for-your-business/
  31. 31. 80% users intentionally moved apps to their home screen
  32. 32. Broken experience • Required user interaction • Where it will start? • Would it work offline? https://medium.com/@saigeleslie/how-to-create-a-progressive-web-app-with-react-in-5-mins-or-less-3aae3fe98902
  33. 33. Web manifest • Simple JSON file • Tell browsers about your app and how it should behave once app is ‘installed’ • Having manifest is required to show add to home screen pop-up • Works for desktop and mobile apps (chrome) • https://manifest-validator.appspot.com/ • https://app-manifest.firebaseapp.com/
  34. 34. {    "background_color":"#ffffff",    "display":"standalone",    "icons":[  …    ],    "name":"Twitter",    "short_name":"Twitter",    "start_url":"/",    "theme_color":"#ffffff",    “scope":"/" } <link rel="manifest" href="/manifest.json"> You can add it now to 
 your app
  35. 35. https://ponyfoo.com/articles/progressive-app-serviceworker
  36. 36. 40% higher interaction rate from Home screen
  37. 37. Web Payment API!
  38. 38. 66% of purchases on mobile are on the mobile web
  39. 39. 1/3 of purchases on Web are via mobile That means the UX 
 is BROKEN!
  40. 40. Checkout forms today: • Manual • Tedious • Slow • N-taps http://www.alyssatucker.com/improving-hollars-ios-checkout-process/
  41. 41. Autofill - step forward • Autocomplete attributes • 30% faster • Automatic • Simple • Slow • n-taps http://www.alyssatucker.com/improving-hollars-ios-checkout-process/
  42. 42. Web Payment API!
  43. 43. Web Payment API! • Automatic • Simple • Fast • 1-tap • Supportes payment gatway,
 or some applications payment 
 (Google Pay) https://paymentrequest.show/images/pr-woocommerce.gif
  44. 44. More APIs • Media Session • Media Capture API • Casting support • Web bluetooth • Web Share
  45. 45. More APIs • Media Session • Media Capture API • Casting support • Web bluetooth • Web Share
  46. 46. Remember users expect to be able to interact with your app in the same way that they do all of the other apps on their device
  47. 47. Fast Integrated Reliable Engaging
  48. 48. Reliable Reliability means, never showing the Downsaur
  49. 49. Reliable • The quality of a network connection can be affected by a number of factors such as: • Poor coverage of a provider. • Extreme weather conditions. • Power outages. • Users travelling into “dead zones” such as buildings that block their network connections. • Travelling on a train and going through a tunnel. • Internet connection is managed by a third party and time boxed when it will be active or inactive like in an airport or hotel. • Cultural practises that require limited or no internet access at specific times or days.
  50. 50. Reliable • We need instant loading offline • 60% of mobile connection is 2G • Fast Application is UX • 14 sec to load average website on 4g • 19 sec to load average website on 3G
  51. 51. Service Workers
  52. 52. Service Workers
  53. 53. Service WorkersService Workers
  54. 54. Service Workers • Rich offline experiences • Background syncs • Push notifications • …
  55. 55. Service Workers • Script that browser runs in background, separated from web page • It is Javascript worker, so it cannot access to DOM directly • Service worker is a programmable network proxy, allowing you to control how network requests from your page are handled.
  56. 56. Service Workers • It's terminated when not in use, and restarted when it's next needed, so you cannot rely on global state within a service worker's onfetch and onmessage handlers. • Service workers make extensive use of promises • Service worker is for second load
  57. 57. Service Workers lifecycle
  58. 58. Register a Service Worker if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('/sw.js').then(function(registration) { // Registration was successful console.log('ServiceWorker registration successful with scope: ', registration.scope); }, function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }); }); }
  59. 59. Service workers Events • On install - as a dependency • On install - not as a dependency • On activate • On user interaction • On network response • Stale-while-revalidate • On push message • On background-sync
  60. 60. On install - as a dependency
  61. 61. On install - as a dependency self.addEventListener('install', function(event) { event.waitUntil( caches.open('mysite-static-v3').then(function(cache) { return cache.addAll([ '/css/whatever-v3.css', '/css/imgs/sprites-v6.png', '/css/fonts/whatever-v8.woff', '/js/all-min-v4.js' // etc ]); }) ); });
  62. 62. On install - not as a dependency
  63. 63. Update Service Worker • Update your service worker JavaScript file. When the user navigates to your site, the browser tries to redownload the script file that defined the service worker in the background. If there is even a byte's difference in the service worker file compared to what it currently has, it considers it new. • Your new service worker will be started and the install event will be fired. • At this point the old service worker is still controlling the current pages so the new service worker will enter a waiting state. • When the currently open pages of your site are closed, the old service worker will be killed and the new service worker will take control. • Once your new service worker takes control, its activate event will be fired.
  64. 64. On activate
  65. 65. Update Service Worker • self.skipWaiting() • Skips waiting for refresh to start using new SW
  66. 66. On User Interaction
  67. 67. On Network response
  68. 68. State-while-revalidate
  69. 69. On Background Sync
  70. 70. SW: Serving suggestions - responding to requests • Cache only • Network only • Cache, falling back to network • Cache & network race • Network falling back to cache • Cache then network • Generic fallback
  71. 71. Cache only
  72. 72. Network only
  73. 73. Cache, falling back to network
  74. 74. Cache & network race
  75. 75. Network, falling back to Cache
  76. 76. Cache, than Network
  77. 77. Generic fallback
  78. 78. Reliable conclusion • Think how you design for the success, failure and instability of a network connection • Data may be expensive, so be considerate to the user • Make sure performance is part of your design process and UX • Try to provide offline by default if your app doesn't require much data • Inform users of their current state and of changes in states • https://serviceworke.rs/ - different examples
  79. 79. https://serviceworke.rs/ - different examples
  80. 80. Your goal is to provide a good experience that lessens the impact of changes in connectivity
  81. 81. Fast Integrated Reliable Engaging
  82. 82. Engaging • Charming and Attractive • Shift way how we think in patterns and designs from web patterns to some native patterns • Push notifications (browser doesn’t need to be opened) • Push Notification API
  83. 83. Engaging
  84. 84. What makes good notification Push. Push. Back upon now. (Courtesy Enrique Iglesias)
  85. 85. What makes good notification • Timely - I feel I need and it matters now • Precise - specific info, what happens • Personal - make it personal
  86. 86. What makes good notification
  87. 87. https://www.slideshare.net/SeulgiChoi4/pwa-push-notification
  88. 88. https://www.slideshare.net/SeulgiChoi4/pwa-push-notification
  89. 89. Push Notifications { "body": "Did you make a $1,000,000 purchase at Dr. Evil...", "icon": "images/ccard.png", "vibrate": [200, 100, 200, 100, 200, 100, 400], "tag": "request", "actions": [ { "action": "yes", "title": "Yes", "icon": "images/yes.png" }, { "action": "no", "title": "No", "icon": "images/no.png" } ] }
  90. 90. 43% agrees to an app’s request to allow push notifications
  91. 91. Tools!
  92. 92. Lighthouse
  93. 93. http://mobilehtml5.org/ http://mobilehtml5.org/ts/ http://mobilehtml5.org/tests/http://mobilehtml5.org/tests/ te http://mobilehtml5.org/tests/ t http://mobilehtml5.org/tests/
  94. 94. Some show case!
  95. 95. 65% increase in page per session 75% increase in Tweets sent
 20% decrease in bounce rate Twitter Lite
  96. 96. 76% higher conversation across browsers 4x higher interaction rate from Add to screen Increased usage of native apps also Alibaba
  97. 97. 80%+ conversation 54% smaller than Android app 120% smaller than iOS app BookMyShow
  98. 98. Cut load times from 11.91 to 4.69 seconds 90% smaller than Native Android App https://medium.com/@addyosmani/a-tinder-progressive-web-app-performance- case-study-78919d98ece0 Tinder
  99. 99. Myths about PWA!
  100. 100. PWAs are only for offline apps
  101. 101. PWAs are a mobile thing
  102. 102. PWAs are a Google-only thing
  103. 103. PWAs are not ready yet
  104. 104. https://pwa.rocks/
  105. 105. Don’t be driven with hype, choose the best fit for your project
  106. 106. It is not about PWA vs Native apps, it is about Users
  107. 107. Thank you!
  108. 108. antonio@locastic.com @antonioperic www.locastic.com Questions?

×