cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]. Supports IMAP/SMTP, JMAP and soon EWS
http://cypht.org
GNU Lesser General Public License v2.1
1k stars 161 forks source link

Cypht as a Progressive Web App (PWA) for offline use, etc. #395

Open marclaporte opened 4 years ago

marclaporte commented 4 years ago

If not 2020, let's try for 2021 ;-)

https://en.wikipedia.org/wiki/Progressive_web_application https://doc.tiki.org/Progressive-Web-App

dumblob commented 4 years ago

Hm, I think Cypht was deliberately designed to be so minimal, that PWA doesn't make any sense here. And the only thing I can think of where PWA could make sense is the GPG functionality (due to the GPG JavaScript library), but that's already covered IIRC.

All in all I don't think there is anything to do on this front. But of course, I might be missing something :wink:.

jasonmunro commented 4 years ago

Meeting the guidelines to be considered a "Progressive Web app" (as outlined in Wikipedia) seems like mostly marketing fluff. We can and should do our best to deal with network interruptions, but Cypht was not designed to work offline. If that was the intention, it would be a desktop app :)

dumblob commented 4 years ago

There is one thing I found PWA mandates, but Cypht can't. Namely loading Cypht offline (e.g. from local storage). Not to be confused with offline access which basically means Cypht should deal with network interruptions gracefully, but that's already partially covered (I didn't test longer interruptions though - e.g. 2 days off).

I do agree that offline loading could come handy (I myself work very frequently offline, so I actually really write emails offline - please don't call me a dinosaur :wink:). But I'm afraid it'd need non-negligible developer work. But maybe I'm wrong and someone will make a PR.

Now the workaround seems to be to load Cypht somewhere with internet connection, pin the browser tab and don't close it :wink:. I can live with that.

marclaporte commented 4 years ago

@jasonmunro "it would be a desktop app :)" Many web apps do so. Here are great examples: https://github.com/jgraph/drawio-desktop https://github.com/jitsi/jitsi-meet-electron

jasonmunro commented 4 years ago

@marclaporte Many web apps != Cypht :) Seriously however those examples are basically JavaScript apps leveraging Electron to run as a desktop program (don't get me started on my disdain for Electron).

Cypht by design is as lightweight in the browser as possible so we use very little JavaScript compared to most modern web applications. This aspect alone is a large barrier to some sort of PWA functionality. There are features that utilize more client side code than others for various reasons (advanced search for nicer form interaction, PGP for better key security, etc), but I have no desire to port core functional logic that would be required for any decent offline experience (like page routing) to the client side code.

I'm aware my opinions on this are a bit curmudgeony, and a lot of current web development is focused on doing as much as possible client side instead of as little as possible. I'm comfortable dissenting from the majority opinion in this case :) With all of that said, I will leave this issue open and tag it "enhancement" and consider any PRs, but with a heavy does of skepticism.

marclaporte commented 4 years ago

Got it.

Let's see PWA as a toolbox, and we'll pick and choose stuff that benefits our use case.

marclaporte commented 2 years ago

https://git.kolab.org/diffusion/RPK/browse/dev%252Fpwa/plugins/pwa/ https://archive.fosdem.org/2020/schedule/event/are_pwas_ready_to_take_over_the_world/ https://blog.etesync.com/announcing-the-etesync-progressive-web-app/ https://github.com/pwa-builder/PWABuilder