I had this idea for an app to handle registration and results for kayak races. I had the following requirements in mind:
- It must work when off-line
- It must work on laptops and tablets
- Preferably, it will sync up with a server when it is on-line
- It must not require any installation or other technical futzing around because my target audience (the people who run kayak races) are not all very technically sophisticated.
I discovered PouchDB, which would take care of the storing information locally in the browser when off-line, and also would sync to a server when it came time to do that. And so off I went programming away. My little proof of concept was humming along, it could accept registrations and display and edit existing registrations, and I was well set to add results entry and display, when I thought to try it on the bane of every web developers lives, Internet Explorer.
First problem: IE reports the ‘fetch’ is not a valid function. Fortunately, the documentation for PouchDB warns you about that, and says to install a polyfill. So I install it, and now IE reports ‘Promise’ is not a valid function. Hmm, no mention of that in the PouchDB docs that I can find.
Can I just mention as an aside that the PouchDB docs do say that it supports IE 10 and IE 11? Yeah, about that…
Thanks to an answer on StackOverflow, I find another polyfill for Promise. Now IE reports that you can’t use IndexDB on web pages that are loaded as files rather than as URLs. Not sure what to do about that except tell people to stop using IE. It appears that with my polyfills and stuff, it does work in Edge, at least. Small mercies.