Zombie service workers

a tale from the cachekeeper

Service workers are a cool technology; they make it possible to build fully offline apps on the web by acting as a persistent cache. However, this also creates a tricky problem: cache invalidation. If a cache is not refreshed often enough, users will be served old files. I experienced this at work a few months ago; pushing changes to an internal web app sometimes had no effect. A hard refresh would fix the issue, but it was easy to forget if the change was subtle. [Read More]

Redux is React's version of global variables?

portals through the component hierarchy

I’ve been digging into a React/Redux project at work recently. The React parts were easy to pickup, but the Redux part was a bit mysterious at first. What is this folder of exported strings called “actionTypes”? What are all these “reducers” and why do they not seem to do anything? What is mapStateToProps and mapDispatchToProps doing at the bottom of all these components? Two things helped me understand: [Read More]

Spotify doesn't have a playlist importer

so I made my own

The podcast “Uhh Yeah Dude” has interesting musical intros and outros, I wanted to have all these songs in a Spotify playlist. A fan of the show had maintained such a playlist until 2016, but more recent picks were missing. What to do? Getting and transforming the data The first step was scraping the UYD website to build a list of episodes–not too difficult! The code for this is kind of boring, but it’s on GitHub if you’re interested. [Read More]