In theory PWA’s make tons of sense for nostr apps but I’m noticing the primal and kiwi apps just seem to struggle to load and display content in comparison to the native apps. Is that a fundamental tech issue? Native apps have access to local db’s and different network options?
Discussion
PWA’s can use indexdb, LocalStorage and SessionStorage. There’s quite a few limitations though.
Using indexedDB to store cache.
Only the first load would need loading. Especially with all the user profiles to populate first load. That should similar to native apps.
And like native apps, feeds are cached too, so will see old feed on subsequent app launches, and take a few seconds to get latest feed.
Primal runs much better than both Damus and Nos in terms of rendering the feed.
I’m on iOS though where Safari is just incredibly performant. Idk how it is this way
The main feed for primal PWA works well but notifications tab never loads.
Which isn’t to say I don’t like and admire kiwi and primal. More people keep asking for web and android versions of nostr:npub1pu3vqm4vzqpxsnhuc684dp2qaq6z69sf65yte4p39spcucv5lzmqswtfch but I’m debating the right way to build it.
I'm trying around with this idea: GitHub.com/nostrocket/PWAstr
BTW for some reason I never see you in my feed on amethyst, I was just thinking to myself "hmmmmmm, I wonder what Rabble is up to" and I see I've missed a lot!
«JavaScript is single-threaded in the same execution context.»
https://www.red-gate.com/simple-talk/development/javascript/javascript-single-threaded/
Apple makes sure that PWAs are a inferior experience on iOS. But they will always be at a performance disadvantage compared to native code on any OS because browsers are essentially their own operating systems and that comes with a lot of overhead. Fundamentally they have to do extra work to keep the host operating system safe from malicious websites whereas native code is assumed to be trusted. Kind of like trying to run a video game in VirtualBox, it just won’t run as smoothly.
Nostr is a pretty wasteful protocol in terms of resources which compounds the problem. But that’s not to say we can’t have fast Nostr PWAs. It’s just going to take more effort to get there.