Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to use tauri instead of electron #36

Open
christophemarois opened this issue Dec 24, 2024 · 3 comments
Open

Proposal to use tauri instead of electron #36

christophemarois opened this issue Dec 24, 2024 · 3 comments

Comments

@christophemarois
Copy link

First of all, thank you for your work and for making it free to use.

Tauri uses the OS builtin webview to produce bundled cross-platform apps, which produces much leaner binaries. It took me less than 5 minutes to build a test tauri app for macOS and the uncompressed app size is only 9.1MB. The memory usage is also significantly lower, at under 300MB under heavy use.

Screenshot 2024-12-24 at 11 34 22

Would you consider implementing a build script using tauri?

@allen-garvey
Copy link
Owner

Thanks for your interest in Dithermark and taking time to look into this. I have taken a cursory look at Tauri, and most likely I will not be going in this direction, however I also plan to move away from Electron as well. To better understand the reasons for this, here is some background.

A while back I got some requests for the ability to run Dithermark offline. I created an Electron version, not due to any experience or affinity with Electron, but because that seemed the default way to create an offline version of a web app. However the following problems soon became apparent, in both the dev and user experience.

  • Limited ability to cross-compile (requires access to Mac). Different executables have to be created for different Linux distributions.

  • OS warnings / errors due to binaries not being signed.

  • Electron behaves slightly differently to Chrome. This mostly affects the batch image export, as each image must be manually saved, making the feature mostly pointless.

When looking at Tauri, while it might have better performance than Electron, it mostly has those same problems.

  • No ability to cross-compile.

  • Binaries will still not be signed.

  • A web view might behave the same as a browser, but it would require extensive testing, since each platform would use a different browser engine.

I got an idea for a different direction when hearing how a colleague was distributing a fork of Dithermark for offline use as a single HTML file to bypass these problems. The problem with that is that when an HTML file is opened locally instead of via a web server, some features (such as web workers), are not available. It got me thinking of distributing the compiled files with a web server to get around these problems.

My plan for this is:

  • Python 3 is installed by default on macOS, most Linux distributions and FreeBSD. So I can include a simple shell script to start a static HTTP server using Python 3.

  • Windows does not include Python or any HTTP servers I could find, however Go allows cross-compilation and can be used to create a simple static HTTP server with no external dependencies. So use Go to create binaries for Windows on x64 and ARM (would still have code signing warnings).

While it is less polished than distributing an Electron or Tauri app, it serves the purpose of allowing users to use Dithermark offline. It also gets rid of code signing warnings everywhere except Windows, is guaranteed to work the same as the online version, allows support on more platforms, requires the least user resources, and offers the best development experience (since only Windows binaries need to be created, and can be done from any platform).

@christophemarois
Copy link
Author

It makes a lot of sense. Thank you for the explanation. Have you considered setting Dithermark up as a PWA? This would allow offline usage with no change to your code using most modern browsers.

Once again, thanks for the work!

@allen-garvey
Copy link
Owner

A PWA or something like that would be ideal, however as it stands now PWAs only work on desktop with Chrome. And to show how little awareness there is for PWAs, neither of us were aware until this moment that Dithermark already works as a PWA. I just tried it in Chrome and it is installable, and everything works, even when offline. So any changes I would make shouldn't change that, and people that want to install it as a PWA should be able to continue to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants