This document discusses designing websites to work offline. It argues that offline experiences should not be treated as errors, and that offline capabilities provide benefits like privacy, security, performance and robustness. Modern techniques like service workers, app caching, CouchDB and PouchDB enable offline-first websites. The document proposes that Drupal 8 could provide a remote database backend using its REST API and modules like Relaxed and Replication, allowing frontend apps to access content offline using standard synchronization tools.
3. Agenda
1. How we think about users and connectivity
2. What's an “offline” website?
3. Reasons to design for offline
4. Are we there yet?
5. Where's Drupal 8?
4. 1. How we think about users and
connectivity
Attribution: https://www.flickr.com/photos/kansirnet/
5. Users on latest technology and robust connection
People are getting newer faster phones
Connectivity will solve itself over time
8. “Once out of bed, Internet and apps are used almost
constantly, peaking during the daily commute with
around 70 percent usage”
- Ericsson
Traffic and Market Report, June 2012
Attribution: https://www.flickr.com/photos/59949757@N06/
11. “We live in a disconnected & battery powered world,
but our technology and best practices are a leftover
from the always connected & steadily powered past.”
- offlinefirst.org
12. It's about putting the user first
and not think about her position or connectivity
as a state of error
17. Privacy
Users controll their own data, literally
Often no need to share preferences and personal data
with the central database
Decentralization is a good thing
18. Security
Do you really need all the data everywhere?
Minimizes the attack vector of your app
19. Performance
We put things on CDNs to get closer to the user
Put it in my pocket instead!
20. Robustness
In the Tube? Or server maintenance?
Your app doesn't care
21. So far
1. How we think about users and connectivity
2. What's an “offline” website?
3. Reasons to design for offline
23. What's required?
A. The app itself (e.g. html, css, js)
B. Remote database (that syncs over HTTP)
C. Local database (that syncs over HTTP)
D. Runtime (e.g. web browser)
24. “Any application that can be written in JavaScript, will
eventually be written in JavaScript”
- Jeff Atwood
“Atwood's Law”
25. A. The app itself
Angular JS
Ember JS
React JS
Hood.ie
etc. etc...
26. B. Remote database
CouchDB
Remotestorage.io
both standardizes synchronization over HTTP
27. C. Local database
PouchDB (works with CouchDB)
Hood.ie (works with CouchDB)
28. “At some point in time recently, the browser
transformed from being an awesome interactive
document viewer into being the world's most advanced
and widely-distributed application runtime”
- Tom Dale
Progressive Enhancement is Dead
36. But the REST API in Drupal 8 core is missing
Revisioning
Synchronization
File attachments
37. Relaxed Web Services
http://drupal.org/project/relaxed
Replication Web Service
http://drupal.org/project/replication
These modules implement the same
HTTP and sync API as CouchDB
38. When we standardize the HTTP API
the frontend app can use standard tools, such as
PouchDB (works with CouchDB)
Hood.ie (works with CouchDB)
40. Conclusions
Offline is a non-negotiable part of normal life
Don't treat offline as an error
Privacy, security, performance, robustness
Possible to build offline capable websites
with Drupal 8
Emphazise WHY this is for the user
- Ex: We can control cookies, why not the same with more granular data?
- We need less of FB, Google and the like
- Ex: User pref can be local and fetched anon
php.net as an example
The whole industry, not just the Drupal community,need to reimagine how we build things