paint-brush
Why Developers Love Progressive Web Appsby@dominik.t
2,126 reads
2,126 reads

Why Developers Love Progressive Web Apps

by Dominik TarnowskiFebruary 21st, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Think about it. Most native apps don’t need all the native features of an app, such as bio-metrics, access Bluetooth and etc., so why not write an app once and be able to use it on any device? ← introducing Progressive web apps

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Why Developers Love Progressive Web Apps
Dominik Tarnowski HackerNoon profile picture

Slide from “Progressive WebVR Apps by Samsung”

And why they might be better than native IOS, Android and maybe even Windows apps

Think about it. Most native apps don’t need all the native features of an app, such as bio-metrics, access Bluetooth and etc., so why not write an app once and be able to use it on any device? ← introducing Progressive web apps

What are progressive web apps

PWAs are basically normal web apps with a manifest file and a service worker telling the browser how to cache files, what icons to use, splash screen to use, app’s name on the home screen and etc.. A service worker can also add offline support for your web app!

Why not just use a native app?

Why would e.g. a news app need anything other than your location or push notifications? Guess what, your web browser can ask for permission to use both of them. Although push notifications require a secure connection (https) and a service worker, it’s so much more convenient to write a single app for all platforms than having to rewrite and maintain code for all the different platforms. Many companies such as Twitter, NASA and Starbucks are already using PWAs and they look great:

PWA vs Native: Features and APIs

what web can do today, running on chrome 63, Feb 2018

Advantages of PWAs:

  • Multi-platform — developers only have to develop one code base, decreasing the cost and improving the quality of the final product
  • Frictionless — almost no download time, prompted to add to home screen when viewing the website. About 60% of mobile users don’t download a single any new apps each month.
  • Easily discoverable — from visiting a website to an installation prompt and installation that takes less than 10 seconds
  • Small download size
  • Instant updates — service workers allow new scripts / stylesheets to be used as soon as they are deployed to the server so the user doesn’t even need to press an update button.
  • Run on any device with a browser

Advantages of native apps:

  • Fast, smooth animations
  • Native looking UI
  • Almost instant load

Platform support for PWAs

Android

Google has been actively pushing the concept of PWAs and they recently started to get a lot of attention from Apple, Samsung, Firefox and even Microsoft. Android now fully supports all PWA features and has been the first platform to do so.

iOS

Safari already experiments with service worker support which will probably lead to PWA support later this year. Although you can’t “add to homescreen” on an iOS, you can still use push notifications.

Windows

Microsoft has already announced that Edge will support PWAs out of the book very soon. In fact, the most recent insiders version already supports it. However, only about 2% of users use Edge so we will need to rely on Chrome and Firefox implementing this feature. Fortunately, Chrome canary already contains a flag in chrome://flags that allows you to do this:

Developer Perspective

Deployment

If you even produced a native app, you know that the deployment process is painful and time consuming:

compile (production version) → create private keysign the app → publish

With a progressive web app, all you need to do is:

build the web app (npm run build)→ upload to server

Does this mean native apps will eventually die out?

No, not happening. Some types of apps will always require more features or great performance so a PWA simply wouldn’t be a suitable option.

Conclusion

If you’re a developer and you’re planning on building a native app in 2018/2019, consider building a PWA instead of separate apps for each platform. You won’t have to maintain each version, the development version can be reduced by about 3 times and you don’t need to learn all languages. You’ll love it. I will also have a few more tutorials on building a fully featured PWA with push notifications, offline support and caching with both angular and react, so if you’d like to see this, follow me so you don’t miss a story.