Hands-on Offline First! with Hoodie

πŸ™Œ

Markus Dobmann

What actually is offline?

1. Offline as in "offline"

screenshot of the chrome offline dino

2. Offline as in "only very very slow connection"

3. Offline as in "no stable connection"

πŸš‚πŸšƒofflineπŸšƒonlineπŸšƒofflineπŸšƒonline

4. Offline as in "pretend there would be a connection (but there isn't)"

device showing a blank screen

A note about Progressive Enhancement

"To get our minds in an Offline First state, we need to assume that a user will not have connectivity, and design the experience around that. Then, if we detect that a user connects to the internet, we can add features that take advantage of that and prepare us for the next time we go offline." - Nick Kasten

How to prevent this "offline"?

We have the technologies to do so.

Service Worker

What's in a ServiceWorker?

How do ServiceWorkers interact with our application?

Browser Support lookin' good

Feels like cheating


        $ npm i -g create-react-app
        $ create-react-app awesome-application
      
Cache all our application files by default

hoodie.js logo

How to store data with Hoodie?

        
          const hoodie = new Hoodie({ /* ... */ })

          const apple = { type: 'apple', image: '...' }
          const banana = { type: 'banana', image: '...' }

          hoodie.store.add([apple, banana]) // => Promise
          hoodie.store.remove(apple) // => Promise

          // add, update or remove events
          hoodie.store.on('change', renderItems)
        
      

Ok, but.. how does Hoodie actually work?

How does Hoodie actually work - part one: Frontend

Demo πŸ‘¨πŸ»β€πŸ’»

Store data offline with Hoodie

Synchronisation

How does Hoodie do sync?

How does Hoodie work - part 2: Sync

Demo πŸ‘¨πŸ»β€πŸ’»

Sync

Things to consider

There's still loads of work to do...

Community

There is a huge Offline First! community. Join us!

Offline Camp Berlin 2017

Questions?

Thank you for having me!

πŸ‘‹