Slide 1

Slide 1 text

Offline First, Made Easy! Gregor Martynus / @gr2m / #offlinefirst

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

image: plane

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Oh, you're not from here?

Slide 7

Slide 7 text

Don't make assumptions on anything beyond your user's device.

Slide 8

Slide 8 text

Our offline experiences suck! ... and we should do something about it

Slide 9

Slide 9 text

Good news, everyone: We can build web apps that work offline today. Plus it's easy. Gregor from Team @HoodieHQ

Slide 10

Slide 10 text

Hi, I'm Gregor.

Slide 11

Slide 11 text

I'm a both-end Developer & UX Designer

Slide 12

Slide 12 text

I've created minutes.io – Offline First since 2011

Slide 13

Slide 13 text

Initiator at Hoodie, an Open Source Architecture to build Offline First apps (and to stop worrying about the backend).

Slide 14

Slide 14 text

Talk to me: @gr2m Talk to us: @hoodiehq Discuss #offlinefirst

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

"Unlike the always-wired machines of the past, computers are now mobile and truly personal, and people move through online and offline seamlessly."

Slide 17

Slide 17 text

"Our apps should do the same." Commons sense.

Slide 18

Slide 18 text

Our Problem is ...

Slide 19

Slide 19 text

We live in a bubble.

Slide 20

Slide 20 text

We have been there before.

Slide 21

Slide 21 text

"More often than not, the mobile experience for a Web application or site is designed and built after the PC version is complete." Luke Wroblewski (2009)

Slide 22

Slide 22 text

1. Mobile is exploding

Slide 23

Slide 23 text

1. Mobile is exploding 2. Mobile forces you to focus

Slide 24

Slide 24 text

1. Mobile is exploding 2. Mobile forces you to focus 3. Mobile extends your capabilities

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Offline First It's not a feature. It's a mindset.

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

How to build Offline First?

Slide 36

Slide 36 text

Steps for Offline First 1. Separate Apps From Data 2. Deliver App Code 3. Save Data Offline 4. Detect Connectivity 5. Sync Data

Slide 37

Slide 37 text

Separate Apps from Data If you build JavaScript Apps today, you are there already. Backbone, Ember, Angular ... are your friends.

Slide 38

Slide 38 text

Deliver App Code And make it cacheable. Use appCache* today, ServiceWorkers tomorrow. *appCache is a Douchbag

Slide 39

Slide 39 text

CACHE MANIFEST # 2010-06-18:v2 # Explicitly cached 'master entries'. CACHE: /favicon.ico index.html stylesheet.css images/logo.png scripts/main.js # Resources that require the user to be online. NETWORK: * # offline.html will be served if search is inaccessible # offline.jpg will be served in place of all images in images/large/ FALLBACK: /search /offline.html images/large/ images/offline.jpg # MUST READ: http://alistapart.com/article/application-cache-is-a-douchebag

Slide 40

Slide 40 text

Sava Data Offline localStorage, IndexedDB, Wrapper of your choice

Slide 41

Slide 41 text

Detect Connectivity navigator.onLine, anyone?

Slide 42

Slide 42 text

Sync Data This is hard. Don't even think about inventing your own protocol. Build upon existing solutions.

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Offline First is hard.

Slide 48

Slide 48 text

Everything is hard before it is easy 1 Johann Wolfgang von Goethe

Slide 49

Slide 49 text

Offline First, Made Easy?

Slide 50

Slide 50 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'})

Slide 51

Slide 51 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'}) // create an account hoodie.account.signUp('[email protected]', 'secret')

Slide 52

Slide 52 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'}) // create an account hoodie.account.signUp('[email protected]', 'secret') // send an email hoodie.email.send( emailProperties )

Slide 53

Slide 53 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'}) // create an account hoodie.account.signUp('[email protected]', 'secret') // send an email hoodie.email.send( emailProperties ) But ... where is the Offline?

Slide 54

Slide 54 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'}) // create an account hoodie.account.signUp('[email protected]', 'secret') // send an email hoodie.email.send( emailProperties ) Offline? Why should you care?

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

// store an object hoodie.store.add('todo', {name: 'get the sun screen'}) // create an account hoodie.account.signUp('[email protected]', 'secret') // send an email hoodie.email.send( emailProperties ) // events hoodie.store.on('change', handleObjectChange) hoodie.account.on('signin', handleSignIn) hoodie.on('disconnected', handleConnectionError)

Slide 57

Slide 57 text

Hoodie Architecture

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

Example hoodie.email.send(properties)

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

Offline First extends your capabilities. Now come the good parts

Slide 74

Slide 74 text

Conversion?

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Scaling? You barely know someone is using your app.

Slide 77

Slide 77 text

Latency? Zero.

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

Save? All the time.

Slide 80

Slide 80 text

Server down? What do I care?

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

Backend? Swappable commodity.

Slide 83

Slide 83 text

Offline First is an ongoing discussion

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

Recap

Slide 86

Slide 86 text

Our Offline Experiences SUCK we have to do something about it.

Slide 87

Slide 87 text

Offline First is hard. if you need sync.

Slide 88

Slide 88 text

Take it easy use Hoodie <3

Slide 89

Slide 89 text

Questions? iOS/Android? Conflicts? Security? Administration? Hosting? Backbone/Ember/Angular? Production ready? Plugins? ...?

Slide 90

Slide 90 text

Offline First, Made Easy! Gregor Martynus / @gr2m / #offlinefirst Slides: go.hood.ie/jsonfbr-offlinefirst

Slide 91

Slide 91 text

Credits 4 CatDog 4 London tube station escalator 4 The Origin of Internet Cats