Progressive Web Application Development by Example
Develop fast, reliable, and engaging user experiences for
the web
Chris Love
BIRMINGHAM - MUMBAI
Progressive Web Application Development by Example
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Acquisition Editor: Shweta Pant
Content Development Editor: Onkar Wani
Technical Editor: Diksha Wakode
Copy Editor: Safis Editing
Project Coordinator: Devanshi Doshi
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Graphics: Jason Monteiro
Production Coordinator: Shantanu Zagade
First published: July 2018
Production reference: 1230718
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78712-542-1
www.packtpub.com
Thanks to my wife Beth for supporting and believing in me
as we journey through life together.
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Chris Love is a frontend developer with 25 years of professional experience. He has won the Microsoft MVP award for 12 years and has authored multiple books. He has helped over 1,000 businesses of all sizes and from various industries.
Chris regularly speaks at user groups, code camps, and developer conferences, and also writes articles and videos to help fellow developers.
When he's not working on frontend development, you can find him spending time with his step-kids, doing karate, and taking part in Spartan races.
I would like to thank members of the Microsoft Edge and Google Chrome teams for being so accessible to me when I needed to ask questions. Most of us don't consider the passion the people making browsers have for the web. They work tirelessly to bring us a platform that enables us to build great experiences for real people and to make their lives better.
About the reviewer
Amar Gharat has been working with various web technologies for the last 12 years, which includes developing creative and unique web applications using LAMP, open source, and cutting-edge technology, as well as delivering work on time with dedicated teamwork. He decided to contribute to this book as a reviewer while working on PWA projects. He has explored new technologies, such as Vuejs and Nuxtjs, to build PWA for our website and found them very interesting to work with. Another book he has reviewed is Progressive Web Apps with React.
I would like to thank Packt Publishing for giving me an opportunity as a reviewer to share my knowledge with others.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Table of Contents
Preface
Progressive web apps (PWAs) mark a new era in delivering user experience. Now supported by every major browser and platform, PWAs eliminate many of the missing capabilities previously reserved for native apps. If you are a developer who works on application frontends, you need to understand what progressive web apps are, their advantages, and how to effectively architect modern web apps.
You will learn the basic PWA requirements, such as the web manifest file and how HTTPS works through advanced service worker life cycle and caching strategies. The book covers web performance optimization practices and tools to help you consistently create high-quality progressive web apps.
Who this book is for
If you're a web developer and frontend designer who wants to create the best user experiences, then this book is for you. If you're an application developer with knowledge of HTML, CSS, and JavaScript, then this book will help you capitalize on your skills to develop progressive web applications, which is the future of app development.
What this book covers
, Introduction to Progressive Web Apps, explains what progressive web apps are and the advantages they offer.
, Creating a Home Screen Experience With a Web Manifest, introduces the web manifest file and explains how it is used by browsers to design the home screen and launch experience after a PWA is installed.
, Making Your Web Site Secure, explains why HTTPS is a modern web requirement and how it works.
, Service Workers - Notification, Synchronization, and Our Podcast App, introduces service workers, the Fetch API, and implementing push notifications.
, The Service Worker Life Cycle, demonstrates how service workers are installed and updated, and how to manage the process.
, Master the Cache API - Manage Web Assets in a Podcast Application, takes a deep dive into how the service worker cache API works.
, Service Worker Caching Patterns, reviews common caching patterns you can use in your applications.