Thoughts on Mapeo as a PWA (Progressive Web App) #554
gmaclennan
started this conversation in
Ideas
Replies: 3 comments
-
npmjs.org/random-access-web chooses the fastest web backend based on the browser, it's pretty good. |
Beta Was this translation helpful? Give feedback.
0 replies
-
What's the USB access story for PWAs? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hypercore in a PWA is still pretty experimental. It would be a technical bet that would likely be slower rendering (webgl?) than electron, also I think you may also need to download a separate app anyway to do the networking properly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been thinking about how we could package Mapeo as a Desktop PWA and the potential advantages:
I think (3) running on Chromebooks is big advantage. Good quality Chromebooks are less than $300, and maintenance is much easier than Windows machines. I've been experimenting / waiting for solutions for using Chromebooks in the past, including:
None of these options are ideal. Users could not just pick up a chromebook and get started, they require a fair amount of tech knowledge to set up. They also don't support hardware accelerated graphics, which will really affect performance of webGL maps.
Desktop PWAs are making significant progress, with more and more native API access. Filesystem access is scheduled by Chrome v77:
I think a version of Mapeo without filesystem access would be possible, using browser storage for the DB, but syncfile handling would not be possible.
The big disadvantage of PWAs is offline installs. I don't know of a way to install PWAs offline - a device needs to connect to the internet for the initial install. We could still use Electron for offline installs, where Electron is just a shell for the PWA code with minimal extra code.
Steps to get Mapeo working as a PWA
We would need to get Mapeo Core working with indexeddb storage. Should be possible with existing
abstract-*
storage modules.For reasonable performance, we would probably need to run Mapeo Core in a web worker, otherwise indexing would lock up the app. This would need an API that works over postmessage between the worker and the main process.
Some APIs need to run over http:
We could use a ServiceWorker to proxy http requests to Mapeo Core in a web worker, or just directly read indexedDb storage from the ServiceWorker. Note that we cannot run Mapeo Core completely in a service worker because service workers can be terminated by the browser at any time, which would break indexing. We can't rely on global state in a service worker, so we would need to restart Mapeo Core for every request.
I'd be interested in thoughts about how much work this might be, and whether it might be worth it.
Beta Was this translation helpful? Give feedback.
All reactions