Exploring Progressive Web Apps

Progressive Web Apps are just simple websites that can be reached using the web. However, they can also work as native apps on devices. They are fast, reliable, and engaging. You can add them to the home screen of your device (mobile/desktop), and can also work offline so that a user who has a weak network connection doesn't have to worry about network connectivity. 

Let's look at what makes a website a Progressive Web App:

  • Service worker: A service worker is a JavaScript worker that acts as a network proxy in your browser. Your application can communicate with the service worker using the postMessage interface.
  • manifest.json: manifest.json is a JSON file that contains details about the application, as well as details about different assets that the application needs so that it can be saved on any device's home screen. The manifest.json file is linked in the HTML file of your website.

If you are writing a service worker from scratch, you need to be familiar with the service worker API and its life cycle. In this chapter, we will be utilizing the Angular service worker, which will make it easier to convert an existing Angular app into a service worker. 

If an Angular service worker doesn't fulfill all your requirements, then you might want to look for Workbox. Alternatively, you can write your own service worker JavaScript file. 

Now that we understand what PWAs are and what we need to do to create one, let's look at what project we want to create before adding PWA functionality to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.126.241