Ditching electron in favour of more modern tools like Tauri

I’ve been wondering about ditching electron on narrat, mainly for those reasons:

  • It’s got a very tedious API and is kind of clunky and buggy to work with
  • It ships chromium with every game making games be hundreds of megabytes even if empty
  • It has a weirdly bad ecosystem of tools to make good apps.
  • I literally still can’t tell people to use pnpm despite npm being really bad, because electron does some weird arcane stuff in node_modules which for some reason doesn’t work when using pnpm
  • After having tried more modern alternatives to electron I’ve realised they’re so much better to work with, and a lot of the things I’m doing in the narrat IDE would tie together a lot better with the games themselves if everything used Tauri, rather than having games use electron and the IDE using Tauri

The narrat editor was made with Tauri as a test, and it’s been great to work with. It’s a much more modern workflow and enables lots of cool stuff. (There is still a test release of the narrat editor if anyone is interested, it’s kind of working but I haven’t had more time to work on it for the moment).

So I’m thinking of changing the game template to work with Tauri by default, and maybe also provides instructions or a separate template on how to use electron, I don’t know. Technically the majority of the work to support either is not really in narrat but just in the game template, as your game project is really what’s in control of electron.

There are a few problems with this though:

  • Alternatives to electron like Tauri work by using your native browser. This is great to not ship all of chromium, but it means different platforms behave differently. Instead of only testing on Chrome, for example, you’d have to test on Safari for macs.
  • I don’t think there is any functioning integration for the Steamworks API for Tauri. I could make one (or someone else could, if anyone knows Rust and wants a project :eyes: ) but that’s a whole thing. At the same time, no one is shipping on steam at the moment

So I don’t think it would be a good idea to completely ditch electron, but I am definitely tempted to at least make it not be the default setup anymore… any thoughts?

3 Likes

I honestly had no intention of using the Electron support because of my [negative] views of Electron.
My current project is 80mb, but with electron is 380mb. I had been evaluating other options for other reasons (happy to leave my game on itch and evaluate options for that later). Tauri was one I was going to pick to learn with friends. :smiley:

Regarding the problems:

  • I wanted to run in the browser too, so I’ve been testing across browsers anyway. A lot of people that ship on itch.io use the play in browser feature. Every game in the discord projects forum except for one seems to be using that feature, and is likely testing across browsers as a result.
  • if no one is using steamworks yet, maybe this is a good opportunity for the move. :grin:

Overall I think this is an exciting direction to go in.

Mixed feelings. I like the idea of exporting just like, an app instead of in-browser only but also every electron app is bloated as hell for the Chromium reasons noted above. (Also their export process really sucks, it’s awful. This is absolutely why I ended up just doing play-in-browser, I could get mac builds reliably exporting from my mac but not windows.)

It’s already using electron, and in either case it’d still export to web.

Yeah, I know. It’s a question of what I’d rather it be using instead.

I don’t know much about this stuff but I know some people are put off by how bloated electron can be, so at least the option for an alternative could be good for them…

1 Like