rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.51k stars 104 forks source link

[Question] Progressive Web Apps with CLOG #86

Closed contrapunctus-1 closed 2 years ago

contrapunctus-1 commented 2 years ago

I was curious about whether one can make a PWA (Progressive Web App) with CLOG. In particular, to make a web app with CLOG which can be opened in a browser as usual, but which can also

  1. be 'installed', so assets don't need to be fetched again (decreasing subsequent load times) and users can have a desktop/homescreen shortcut to it (it still opens in a browser)
  2. work offline, possibly storing server side data locally, and/or saving database changes locally and synchronizing with the server when online.
  3. use OS sharing protocols (via Web Share API and Web Share Target API)

Thoughts?

rabbibotton commented 2 years ago

To create your PWA with clog you just create your boot file as a PWA with your resources in it and include the boot.js file and jQuery and will have access to everything in the PWA once it connects to your CLOG app, so you should account for in the PWA the possibility of not being able to reach the server and deal with that according to your apps needs, waiting icon etc

As for working offline, as just mentioned if boot.js can't reach the CLOG app then you will only have whatever you have programmed in to your PWA available.

The sharing protocols, or any other that are missing, are easily added to CLOG itself if needed.