Announcing "Tauri Elm App" - A template for building desktop apps with Tauri

I wanted to build a desktop app and I had heard great things about Tauri. Unfortunately the existing templates for combining Elm with Tauri either didn’t work for me, or used different components than what I’d have picked.

So I developed my own template: :tada:

It took me quite a few tries to find a setup that worked well. (Elm Land didn’t work, Parcel crashed regularly, pure Elm is missing hot reloading, …). In the end I settled with:

  • elm-watch for hot reloading and bundling. (Since desktop apps don’t have to handle a URL, plain Elm is good enough.) Thanks @lydell for building it! :man_bowing:
  • elm-tailwind-modules for styling the app with Tailwind CSS

Next steps are adding a CI script with GitHub actions, and maybe adding a second example app which interfaces with a rust backend.

Thanks to Tauri the resulting apps work really weil.
I hope you all will use it to build some Elm desktop apps! :grin:

21 Likes

Sweet. I’ve used Tauri at work for our desktop app. It’s quite nice.

Is there a reason you don’t use vite in your template considering tauri uses vite by default? I haven’t had an experience with bun, but I noticed you chose that.

Vite would have been the next I thing I would have tried if elm-watch hadn’t worked :smile:. But I was happy with elm-watch, so I kept it. Is there anything I would gain by using Vite?

Bun is just for installing dependencies and executing the CLI tools. It’s really fast at that, so I like to use it for that nowadays. However, when setting up CI, I realized that it’s not working properly with Windows. So for the Windows build I’m actually using node.js now.

I haven’t used elm-watch either, does it do bundling of javascript? Your template repo doesn’t seem to have any js files or require any bundling of js files/assets.

So for instance how would you call a tauri command from your elm app?

Vite gives you the proper bundling

Sure, the bundling happens here: https://github.com/Airsequel/tauri-elm-app/blob/3d183768b22e2d58b5c55dcc4a9cab6eda21fef5/makefile#L20

An example for calling the rust backend isn’t included yet, but it will work as seen in this project: GitHub - eaon/tauri-elm-counter: Tauri (Vanilla) + Elm based counter example, where the counter is incremented/decremented/reset by Tauri's Rust backend (Mirror)

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.