Live data from Hacker News

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

andregarzia.com

421–430 of 927 posts

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

#421

Earlier quoted context omitted.

Even web apps that you add to your home screen are subjected to this.

"Web applications added to the home screen are not part of Safari and thus have their own counter of days of use."[1] From WebKit: [1] https://webkit.org/blog/10218/full-third-party-cookie-blocki... A Note On Web Applications Added to the Home Screen As mentioned, the seven-day cap on script-writable storage is gated on after seven days of Safari use without user interaction on the site.” That is the case in Safari.…

> Web applications added to the home screen are not part of Safari and thus have their own counter of days of use. Their days of use will match actual use of the web application which resets the timer.

Can anyone explain this with an example?

So web apps added to the home screen will have their storage wiped under some scenarios? If not, what does "have their own counter" mean?

How are web applications added to the home screen not part of Safari in a way that's different from a regular URL you might visit?

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

#422
This headline rewrite does a disservice.

It editorializes away the point of the post, which is that, according to the author, "Apple just killed offline web apps while purporting to protect your privacy [by forcing WebKit to delete all local storage after 7 days]."

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

#423

Earlier quoted context omitted.

> Can PWAs not switch to using IndexedDB which seems like it’s more purpose-built for this use case? IndexedDB is also subject to the 7 day limit. Leaving no persistent storage for web apps at all.

Ah, I missed that in the original documentation and most of the discussion I've seen has been around localStorage. Thank you!

It's a bit confusing because there are two similar terms being used to describe this. First is "local storage" which refers to any of the storage, as long as it's on the local device. Second (which you used) is "localStorage", which refers to specifically the window.localStorage API (which you are right about, has been described as a volatile short-term memory for apps).

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

#424
post #360

It doesn't scale from device to device for settings or items that should stay for longer than a week. Local storage should be treated as cache.. it may get refreshed. What Apple did was fine. A backend isn't only for storage either.

It is not fine if you're creating apps that don't have a backend.

If you don't have a backend and don't want to use sqlite or something externally you can't save your data with the expectation it won't get erased. Before this change someone could manually clear storage, running out of space could trigger erasing this, etc. Now things clear after 7 days.

If you care about saving that data forever don't use local storage. Just like don't expect cookies you set on the client not to be modified by the client.

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

#425
Actually, Apple has crippled non-PWA apps. I agree that Apple does seem to not want PWAs to succeed based on my experiences with them on my iPhone, but on the other hand this effectively does not apply to PWAs that are added to the user’s home screen since the counter only runs every day Safari runs but homescreen sites have their own counters.

I worry that 7 days is too short of a period even then, but I do agree indefinite local storage does not make sense in most cases.

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

#426
Many web developers are turning to Electron in these cases but IMHO this is a waste of resources as the Electron runtime is not shared among the different apps running and there is only so many browser engines your computer can run before it has impact on its performance

Why? Why isn't the case that the code which runs Electron, and library code JIT-ted by Electron can't be reused by other processes on the same system?

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

#427
post #360

It doesn't scale from device to device for settings or items that should stay for longer than a week. Local storage should be treated as cache.. it may get refreshed. What Apple did was fine. A backend isn't only for storage either.

It is not fine if you're creating apps that don't have a backend.

It is fine if your apps use only 1st party scripts and not 3rd party scripts.

> If your web application does experience website data deletion, please let us know since we would consider it a serious bug. It is not the intention of Intelligent Tracking Prevention to delete website data for first parties in web applications.

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

#428
post #150

Earlier quoted context omitted.

This is also about IndexedDB. Imagine native apps had all their data wiped if you don't open them (with an active internet connection) every 7 days. Not just on an iPhone, but also on macOS.

This impacts an app I've built for reading academic papers but I imagine the work around here is to write to a file periodically and then load the file in if you don't detect indexedDB having the data you think it should. Obviously this has error cases all its own and makes it more difficult to manage but it doesn't seem like Apple is killing it to me, just making us jump through hoops and add extra complexity. Don't…

I apologise for being rude, but IMO you didn't build an app, you built a web page. Web pages are things people look at one time or maybe many times, but they are just web pages that exist in a web browser for the lifetime of the tab they're in, and then they're gone. They shouldn't expect to have any persistent storage from the browser, and if the browser does make small affordances for storage, it's not reasonable to have that persist indefinitely.

Apps are bundles of code/assets that people choose to install on a computer because they want to use them over time to do something. They have a clear lifecycle of installation and deletion that the user has complete control over.

I know the web app, PWA, offline app, etc. stuff is very popular, but it will never be as good as native apps, and it creates an expectation that every browser will expand its functionality until it is effectively a full operating system.

I think the only reasonable case for the web-as-app model, is things that get installed to the home screen, in the sense that the user is then again given control of the lifecycle, but I would still honestly prefer that people just write a native application.

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

#429

Earlier quoted context omitted.

Even web apps that you add to your home screen are subjected to this.

"Web applications added to the home screen are not part of Safari and thus have their own counter of days of use."[1] From WebKit: [1] https://webkit.org/blog/10218/full-third-party-cookie-blocki... A Note On Web Applications Added to the Home Screen As mentioned, the seven-day cap on script-writable storage is gated on after seven days of Safari use without user interaction on the site.” That is the case in Safari.…

How is this any better?? I don't expect apps I install - native or PWA - to clear their data if I don't use them every 7 days. That's crazy!

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

#430
post #369

Earlier quoted context omitted.

Sorry, I wrote this blog post too fast because I was/am a bit angry and didn't notice my usage of jargon without explanation. It is a “Progressive Web App”. Sorry for the jargon usage without explanation. Basically it is a marketing term used to place some new web APIs and best practices into an umbrella of a “near native UX on a Web App”. What it usually means is that your application is: * Served from a secure cont…

Thanks for your reply :) I recognize often articles are meant for a specialized audience and shared here without the author even being aware of the site, so it's unreasonable to expect that everything be described to a total neophyte, but sometimes I have to laugh at the buzzword articles that get posted here about how to implement foo in bar on baz, using a fizzbuzz framework running blarg, and I have no idea what A…

Also, I just updated the post with a definition and a link to learn more about PWAs.
Post reply on HN