Enhance WaniKani to be a PWA


#1

I’m sure this has already been spoken about within Tofugu.

Please consider adding Progressive Web App (PWA) enhancements to WaniKani.

Background
I’ve been pleading for an offline version of WK for around four years. The main reason for this is that my main time to use WK is during my commute which has very poor signal.

I can understand what a massive undertaking making WK offline would have been back in 2012.

Proposal
Please add webworkers service workers to cache files, and serve offline requests, as if it were never offline.


#2

If this has been discussed in Tofugu, then what makes you think the answer from WK/Tofugu developers would be different here?


#3

Server-rendered RoR stack to a full client-side PWA would still be a massive undertaking. They’d practically have to rewrite the whole thing. Caching files does not make an offline app; local storage != WK’s server setup. You could save all the vocab offline easily - but all the functionality would have to be completely changed to operate locally & offline.


#4

@plantron I had a quick search in the community, but couldn’t find anything to do with PWAs, but I can’t be certain, hence the disclaimer.


Caching files does not make an offline app;

I agree.

local storage != WK’s server setup.

I also agree.

@Subversity When I mentioned PWAs I was referring to the use of web workers (not localStorage) which allow a developer to keep the current server setup, but allow scripts, assets, data (like JSON) to be saved offline for access.

It would still be a significant upgrade, but with Samsung and other platforms promoting their use, I think it would be a good investment for WK.


#5

I suppose they could save a single (currently pending) review session for
offline completion and delayed submission. They’d have to do all sorts of
resolution like backdating the SRS scheduling to the item’s completion time
rather than its submission time etc.

Would certainly be a good investment, I’m behind this idea with you to be
honest!
Though I still think there is a huge amount of work (and non-obvious,
non-trivial conditions) that they would have to solve for to ensure
accurate local/server syncing.


#6

Hmm. Good points you do make.
Like Yoda I now sound.
Stop I must.


#7

Not necessarily. If you cache-up before leaving home, do your reviews on the commute, then upload results when you arrive at work, keeping the submission timestamp wouldn’t be much of a hit against your timeline.

Separate note… I think the OP means ‘Service Workers’, not ‘Web Workers’. I think Service Workers aren’t quite as well supported as Web Workers, but their use could easily be made conditional upon presence.


#8

@rfindley I do mean service workers. Nice spot.
I couldn’t remember their name, and got the wrong one.


#9

Probably going to have better luck using the templates and some modifications to make Anki behave like Wanikani than hoping/waiting that they make Wanikani offline.


#10

Yep… they’re working full-time on EtoEto now, which, honestly, makes more business sense.

On the other hand, there’s nothing stopping a software person from making their own app that caches review results and uploads at the next available opportunity. I considered doing that in the past, but I’m done with WK now, so I don’t have much motivation to do so.


#11

I have a long way to go yet. Also, this is also something that could be useful for new joiners.


#12

@rfindley You can’t “upload” data through the API wanikani provides, am I missing something?
It’s GET only.


#13

@T2RKUS you are correct.

I’m hoping that the WK platform itself will make the changes. Not a third-party.


#14

I think it would be easier for WK to make a GET and POST api using oauth or basic and leave a third party to implement their own solution. That seems more realistic.


#15

It’d more likely be oauth if anything. In my mind, an API is far more work than putting a service worker in between normal server requests.


#16

I hadn’t heard of a “service worker” before so I looked it up on google docs. So what you’re saying they should make is cache the WK site offline in some way with a service worker on that page. Then when a connection is found sync the changes like normal as if they were connected. like a delayed send (to water it down)?


#17

@T2RKUS yeah that sounds right… at least I think that’s what I am suggesting. :thinking:


#18

Not the API… just regular HTTP requests. You just have to implement a regular login via POST, and keep the session cookie. I’ve done this before for some automated scripts.


#19

What if the review changes since you last used it.
EDIT:
Though it would be nice in API form :’(


#20

I don’t think that it would matter.