Going Offline
I’ve already read the first chapter (and potentially a few more chapters in a pre-release… it’s so good) and for me this is the best ABA book since the release of Edition 4 (RWD by Ethan). This article is the extract of that chapter which explains what Service Workers are and how they relate to the duck-billed platypus. It’s also the reason behind the survey this week.
The technology that makes this bewitching offline sorcery possible is a browser feature called service workers. You might have heard of them. You might have heard that they’re something to do with JavaScript, and technically they are…but conceptually they’re very different from other kinds of scripts.
Usually when you’re writing some JavaScript that’s going to run in a web browser, it’s all related to the document currently being displayed in the browser window. You might want to listen out for events triggered by the user interacting with the document (clicks, swipes, hovers, etc.). You might want to update the contents of the document: add some markup here, remove some text there, manipulate some values somewhere else. The sky’s the limit. And it’s all made possible thanks to the Document Object Model (DOM), a representation of what the browser is rendering. Through the combination of the DOM and JavaScript—DOM scripting, if you will—you can conjure up all sorts of wonderful magic.
An excerpt from Going Offline