The core of PWA is 'Offline first!'.
In this workshop we build a mini commuter site that loads all its data on first load so that the entire site can be view with no internet connection.
We will also look at the new APIs that are becoming available to PWAs as Google's Project Fugu has the mission to make PWAs do everything Native Apps can do.
To understand the core concepts of PWAs, we build this site outside of the WP ecosystem as a decoupled site (HTML or PHP). This can them be used as a link from the main WP menu to an offline site in another window tab.
That being said, we will look at the architecture of a leading PWA plugin and examine how we can transfer what we have learnt into that plugin.
We use a number of features to do this:
IndexedDB is worthy of a special mention. Once we have pre-cached our template pages whilst online, we can use data stored in IndexedDB to create contentful pages. If we think of IndexedDB as our local MySQL and the Cache API as our local web server, once we have pre-cached our template pages and stored 'post' data in IndexedDB we can then create a rich site locally whilst the user is offline. We can also store any form data and using BackgroundSync, post the data to the server once the user is back onine even if the user has closed the browser.
There are a number of libararies that make using IndexedDB easier, yet even the raw API can be used in a boiler plate mode.
The workshop uses a series of 'Step by Step' examples combined with some theory. It is very much a code lab with attendees able to take away a fully functioning PWA.