Service Workers
hackernoon.com
hackernoon.com
First you have to design a service worker that can intelligently download new updates to your app, relay to the user there is a new version, and you have to make sure you support changing apis as clients can be using the old versions of an app for a long time.
You have to design self destruct logic because your service worker itself can have bugs and break your app. In addition your self destruct logic can break.
You also have to make sure you service worker does not infinitely cache an old version of you app, because it will never expire without correct logic. You cant just assume to download higher version numbers, some times you want to revert to an older version of your app.
I would assume you would republish the older version as a new higher version. It's not uncommon in regular software releases.
[1] https://webkit.org/blog/8090/workers-at-your-service/ [2] https://caniuse.com/#feat=serviceworkers
https://gist.github.com/ankita1910/1ff6c67a63c0f2d62a5c82c7d...
My biggest draw to PWAs was the ease of which I could deploy an intranet app on portable devices with spotty connectivity. This works fine with the appcache, which is what I currently use, but service workers require SSL and self-signed certificates are a no-go. This adds to the complexity of using service workers in a simple intranet hosted PWA. Also, back to Safari's poor implementation of service workers, the amount of time a PWA will reside in the browser is unspecified. I can only imagine the the headaches it will cause if the PWA drops randomly. So I'm avoiding service workers in my PWAs for now.
When appcache deprecates (it's slated to), maybe it will be time for me to go native if I am going to have to add complexity regardless.
Yes, as of iOS 11.3.[1][2]
[1] https://webkit.org/blog/8090/workers-at-your-service/ [2] https://caniuse.com/#feat=serviceworkers
I had to read this twice because I couldn't believe there's actually someone out there who prefers those "install the app" banner spam apps that the mobile web is littered with.
Not ready for primetime.
When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."
Person 2: "It worked for my single use case / environment / circumstances = the best thing ever, it's your fault"
:)
Note that service workers weren't really new when we used them, we deployed them carefully and with intent, with skilled developers.
Don't get me wrong- I like the idea behind service workers- I just found how they were implemented to be difficult.
A normal application will check if a file it needs is downloaded, and if not, download it.
An insane application would unconditionally attempt to download the file, except first it forks off a new child process, turns it into a network MITM proxy, and have it intercept the request. Because how else can you access local files on disk except through HTTP?