Live data from Hacker News

Private client-side-only PWAs are hard, but now Apple made them impossible

andregarzia.com

381–390 of 927 posts

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#381

I’m a little confused by this and maybe I’m missing something. Wasn’t localStorage always intended to be treated as a volatile storage mechanism for non-critical data and caching? The advice I’ve seen for several years says to avoid storing sensitive or critical data there. Can PWAs not switch to using IndexedDB which seems like it’s more purpose-built for this use case? No snark intended. I’m legitimately curious wh…

In the original post from Apple[0] announcing these measures, they've listed all script-writable locations are subject to cache clearing:

- Indexed DB

- LocalStorage

- Media keys

- SessionStorage

- Service Worker registrations (I guess this means service worker caches)

[0]: https://webkit.org/blog/10218/full-third-party-cookie-blocki...

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#382
That is terrible if you are working on a pwa game to cache assets offline. There should be some opt-in approach similar to location tracking in the background like some apps do. That seems way worse than simply having local data be relied upon. Not cool.

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#384
I don’t remember ever seeing this usage pattern in the wild? As far as I understand, it would always have resulted in data loss whenever users chose to clear browsing data. There also wouldn’t have been any natural way for backups or synchronization.

A browser plugin might be one way to achieve something like this. Personally, I really don’t care about the data my feed reader has, so I wouldn’t mind even public data storage backends, like gist. Or steganographically encoding my list of feeds and uploading it to porn sites :)

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#385
What are private client-side PWAs anyway?

Good question. The definition of a "progressive web app" is vague. What they seem to mean is a web page which, once you visit it, is cached locally, and thereafter runs locally. The web page accesses various servers, not necessarily ones from the same domain as the web page. Persistent state, if any, is stored locally. The page gets its own icon on the home screen somehow, so it sort of looks like an "app".

Apparently "progressive web apps" are supposed to have a browser service worker so they can get notifications pushed to them from somewhere, although it's not clear why that's essential. That would seem to depend on whether the function performed requires being notified of something happening elsewhere.

Apple apparently dislikes this because they don't get to force people to use their store, with their big cut of the revenue.

Is that about right?

Does this only apply to pages read through Apple's browser, or does it impact Firefox, too?

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#386
post #381

I’m a little confused by this and maybe I’m missing something. Wasn’t localStorage always intended to be treated as a volatile storage mechanism for non-critical data and caching? The advice I’ve seen for several years says to avoid storing sensitive or critical data there. Can PWAs not switch to using IndexedDB which seems like it’s more purpose-built for this use case? No snark intended. I’m legitimately curious wh…

In the original post from Apple[0] announcing these measures, they've listed all script-writable locations are subject to cache clearing: - Indexed DB - LocalStorage - Media keys - SessionStorage - Service Worker registrations (I guess this means service worker caches) [0]: https://webkit.org/blog/10218/full-third-party-cookie-blocki...

Thank you for outlining that! I missed the impact on Indexed DB in my original read of the issue. It makes more sense, now.

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#387

Maybe I'm being cynical here -- I'm not a web developer but have lots of experiencing managing web-based products -- but if you want to have state you should store it in the cloud, because local devices are volatile. Xbox Live, for example, uses a fairly simple service for cloud saves for games; local saves still happen but any developer has the option to push saves to the cloud. The author definitely raises good poi…

The problem is (at least for me) offline apps, or for customers who have poor or intermittent / unpredictable internet access.

They threw LocalStorage and etc out with the bathwater that are cookies.

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#388
On one hand, I don't like this direction from Apple because it's meant to boost Apple's proprietary app store business -- which directly competes with the open web -- but masquerades as a privacy issue.

On the other hand, this direction keeps web devs honest: local storage, service worker, cookies and other script-writable areas are meant to be temporary.

Re: Private client-side-only PWAs are hard, but now Apple made them impossible

#389

I think this is a good idea. Developers should not be able to store something on my computer indefinitely without my consent. This doesn't apply to applications users add to their home screen. This doesn't "destroy" the PWA ecosystem. Just makes a user's intention explicit when they save a PWA to their home screen, rather than continuing to use it within the browser. From the WebKit Blog ( https://webkit.org/blog/102…

Your browser is already caching a whole lot of stuff that you don't know about just by visiting a site.

A little LocalStorage isn't going to hurt you.

Cookies I get, but I don't know of any dark patterns with localstorage / the benefits are pretty great.

Post reply on HN