Run Ionic (or other web-based) apps on Librem 5

Hey! I’m developing an Ionic based app which is currently optimized for Android with help of capacitor. Are there any ideas how to provide a build for Linux / Librem 5? For people not familiar with Ionic: Esentially the build artifacts are HTML, CSS and JS.

Ionic supports PWA. I could host the app and let users install it through a browser. But it is developed as a local app which does not use any server connection - so that would be really strange? Also I’m not sure about implementing background services and data persisting for PWA’s. I also would like to get my Ionic based app within some app store, which could be a problem making it a PWA?

Electron is also supported by Ionic. But isn’t it a bit too heavy for a Linux based mobile phone? Plus we would have to wait for Wayland and small form factor support.

Are there any ideas on this topic? What about making a small webview GTK wrapper and serve the app somehow?

Librem 5 ships with Xwayland, so you don’t necessarily need to wait for native Wayland support.

Okay! But electron apps would drain the battery faster than the blink of an eye wouldn’t they?

One way to do it instead of using electron would be to make a GTK Application that only has a WebView.
What you would be losing with that though would likely be things like support for notifications and so on.
But since Ionic already supports Electron, I’d just go that route in the sake of simplicity.

I remember someone saying a couple of months ago that Xwayland was “work in progress”, does this mean that it’s supported now?

1 Like

A lot happens in a couple of months in the PureOS world! I think it’s “supported”, but at the same time “discouraged”: if you absolutely need something that uses Xwayland, we’d rather you do, but if you can avoid Xwayland, that makes our lives easier (and will enable extra features like typing suggestions in the future).

3 Likes

Yeah, XWayland apps don’t render at full resolution (they’re scaled up 2x to make up for hidpi screen), but otherwise should work fine. A few months ago they weren’t integrating very well (didn’t automaximize and virtual keyboard input was broken), but those things are already fixed by now.

2 Likes

Okay, thanks to you all! I think I’m gonna try out electron and the Webview approach.