Wednesday May 25, 2016
Wednesday May 25, 2016
- Links: Introducing Pokedex.org: a progressive webapp for Pokémon fans, Mozilla's SW Cookbook, sw-toolbox (so much good stuff here), and Background Sync
- Tips: Sometimes it's just easier to disable registering SW in development. Just helps when you're trying to build/fix other parts of the site., It's very important to test your update process when deploying new versions of apps with SW. It's possible to “brick” a web app since if you successfully register a SW, then push an update that has a JS error that prevents your SW registration code from running. Pushing a new version won't fix it because it won't register the new SW and keeps serving the broken code from the previous SW. , and It's early to say this, but I think GraphQL will eventually replace REST as dominant http API approach for applications.
- Picks: I <3 reselect for Redux apps
- Links: Caching best practices & max-age gotchas by Jake Archibald, My stupidest webapp, and The FT’s webapp
- Tips: If you do 'network first' routes in the service worker, fallback set a timeout to wait for the response and if it fails respond with cached or fallback content. This keeps the app responsive when the device is "online" but no data is going anywhere this stops infinite loading spinners when connected to captive portals, or have low phone signal. I do 2-5s timeout usually.
- Picks: sw-toolbox, sw-precache, and lighthouse
- Links: Jake's article on appcache, Infographic on service worker, Paul Lewis on CORS, Ionic and PWAs, Differences between PWAs and AppCache apps, On URLs in Progressive Web Apps by Bruce Lawson, The importance of URLs by Stuart Langridge, Regressive Web Apps by Jeremy Keith, and Progressive Web Apps and the future of the Web (video) by Bruce Lawson
- Tips: Chrome Canary now has an “Application” tab showing PWA and storage information, Chrome Canary has a “clear all storage” button (so handy!), and sw-precache and sw-toolbox are awesome, see web-starter-kit for a full working app that uses them
- Picks: Hoop Dreams (1994 documentary)
- Links: CORS for Concern by Paul Lewis and Infographic on Service Worker
- Tips: Make sure you use waitUntil() for any async operations outside of respondWith(). Many examples will try to do things like cache resources after resolving the respondWith() promise without calling waitUntil(). The browser can kill the worker before these async operations complete. You may not see this in development, though, because the browser sometimes keeps the worker alive with devtools open.
- Picks: Sound Slice