I have an idea for a hobby project that I would like to package as a Desktop App.
There have been a few posts in the past regarding solutions, such as Electron, for building desktop apps with Elm, but I’m wondering what the current lay of the land is.
If anyone would be kind enough to share their experiences I’d be very grateful.
Are there any specific solutions you would recommend? Or any that you would never use again!?
I think @jxxcarlson likely has the most experience around this right now, and is using Tauri. I’ve been using Electron and have been very comfortable and productive with it and will likely continue using it for at least the near future. I’ll probably give Tauri another shot at some point, but I’ve used Electron enough that I’m just so much more productive in it.
I think first and foremost you should use what you’re most familiar with, and if you’re familiar with neither then I’d try Tauri first.
I think there are some other options out there as well, with Go and possibly other backends, but those 2 are likely to have the best documentation as of right now, that I’m aware of.
I developed a desktop application with Elm and Tauri and was decently satisfied. Obviously Tauri itself knows nothing about Elm (although there are a few other frameworks that are officially supported), but the integration is not harder than with your typical Elm web page.
There is a fundamental issue that I believe spans all tools like Tauri or Electron in the fact that Browser.application doesn’t understand URLs that don’t start with http or https - i.e. what most of those frameworks end up doing. Basically your Elm application will not work outside of a real browser if you base it on Browser.application. This has been known for a while https://github.com/elm/url/issues/10
There are some workarounds, I just ended up using Browser.document instead.
Not related to the choice of platform, but if I were making a Desktop app with Elm I would consider writing a CSS reset specifically for Desktop conventions.
For example, on the web dragging the mouse selects stuff by default. Often in quite buggy ways. Desktop applications the default is the other way around - dragging to select is something applications opt in to. So I would consider user-select: none for inclusion in a Desktop CSS reset. Perhaps someone has already compiled such a thing?
Also you will typically need some Javascript parts to this reset. For example, CTRL+mouse wheel resizes the page. Doesn’t seem like a behaviour many desktop applications do.
I also did no framework in the past. Just native platform directly. Like Xcode on IOS, Android studio, or rust / .net. As long as you can spin up a browser and that language has a json package you can use anything you like with just a simple fullscreen webview and ports. But port to native instead of javascript. And not be limited by the typical framework api’s. you can Even host the elm part on internet, super Easy to Update the app when there is only internal elm changes. With a webworker it will still load app when offline.
This was super Nice bypassing the apple AppStore approval prosess anytime you have small changes.
I wrapped kakuro-dojo.com in an iOS app wrapper, don’t remember which one. It works good, but nowadays I just build a progressive web app (PWA) in Elm, and save it as an app from Brave or Chrome, e.g. mammudeck.com
Both of those are open source, with a GitHub link at the bottom of the page.