Coder Social home page Coder Social logo

discord-tauri's Introduction

Discord Tauri

Discord Tauri is a work in progress Discord wrapper made in Tauri.


Purpose

I asked myself, how would Discord be if it was built in Tauri? I could only imagine super low memory usage so I got a PoC working in a week.

This project's purpose is to, not only know how Discord would be if it was built in Tauri; but also learn about Discord's inner workings and possibly get more people to know about Tauri!

Benchmarks

Made with same procedure and in the same system (WINDOWS).

Your results will probably vary, this benchmark was taken years ago.

If these results are good, they are thanks to Tauri, not because the Discord dev team is bad.

If these results are bad, Tauri is still a great library! Also, good job Discord!

Detail Discord Tauri Discord
Installer Size 2.83 MiB 67.57 MiB
Installed Size (without Cache) 20 MiB 326 MiB
Max. Memory Usage 650 MB 630 MB
Avg. Memory Usage (after load) 550 MB 535 MB
Min. Memory Usage (after load) 500 MB 490 MB
Launch Time 5.08s 7.41s

The following results were obtained with an almost brand new account: 3 servers, 1 friend.

Detail Discord Tauri Discord
Max. Memory Usage 580 MB 640 MB
Avg. Memory Usage (after load) 512 MB 516 MB
Min. Memory Usage (after load) 460 MB 450 MB
Launch Time 3.06s 2.83s

List of features

  • Wrapping of Discord
  • Expandability with Tauri plugins
  • Fast AF Loading
  • Desktop Tray
  • Rich Presence Support
  • Notifications
  • Window Resizing
  • File Dropping
  • Push To Talk
  • Custom Settings
  • Works on Linux

Building

You can find building instructions on the wiki!


FAQ

What is Discord Tauri?

It's a Discord wrapper that uses the lightweight library Tauri. In the current state of development, we are replicating the original Discord client behavior.

Is this against Discord's ToS?

Yes. Every Discord mod is against the ToS, altough, it seems like Discord still doesn't care too much about it. Quoting Wired's article about BetterDiscord: "BetterDiscord is not an officially sanctioned app; and likely it breaks Discord’s terms of service, which prohibit modifying Discord. But the software has been installed more than 5.3 million times since 2015, and its developers say they have not seen Discord take action against users for modifying the client".

Is this project abandoned?

No. But I'm a student and it's hard to add features and fix bugs while having to do homework.

Wait, this isn't that lightweight. What's up with that?

Well, think of Tauri and Electron as browsers. When you have some app like Discord, that has a lot of images, the RAM usage goes crazy. The only way to create a "really lightweight" Discord client would be to make a native interface in something like Qt.

discord-tauri's People

Contributors

p0ryae avatar realdrpuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

discord-tauri's Issues

No notifications

The system notifications don't work.
We can solve this overriding the Discord notification system with TAURI.notification.

Additional optimisations for the binary

I did a few more optimisations on the binary size by adding the following to the Cargo.toml file :

[profile.release]
strip = true
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"

Then I ran this to reduce the binary even more :

upx --best --lzma src-tauri/target/release/tauricord

All of this left me with a final binary that is just 656K.

(the optimisations come from here)

PS: It is worth noting that upx might make the initial load time of the app a bit slower because I think it has to decompress the binary in the RAM. Also I just noticed that this project is a bit more complex than I thought, so my project actually doesn't have all the things in the main.rs file and I'm on Linux too.

Decompressing asar ?

All the data on the normal Discord is stored in the app.asar file that can be decompressed using the command asar e app.asar out

It could also be possible to use the OpenAsar implementation of it which is ridiculously small however I don't know how it really works.

Generally speaking we can't just extract the thing because everything is in Javascript and uses the Electron API but it's just an idea, and maybe something could be done with that, it would avoid having to fetch all the assets and others from the website since everything would be bundled inside the binary.

File Dropping doesn't work

I can't make a video right now, this bug doesn't allow us to upload files dragging them into the window.
I don't know why, I need help with this one.

Push To Talk doesn't work

This image explains the issue better than any words:

We should override Discord's way to know if the client is a browser.

No Desktop Tray

We should have a desktop tray, like the original Discord client does.

Same thing but for Discourse?

We’d like to make a proof of concept of a Tauri-powered @discourse app.

Might you be interested in working on this for us as a paid gig? Sorry to use your issues for this, but I couldn’t find any other contact info. You can reach me privately via the email on my profile.

Build fails

   Compiling discord-tauri v0.3.0 (/tmp/discord-tauri/src-tauri)
    Finished release [optimized] target(s) in 26.64s
    Bundling discord-tauri_0.3.0_amd64.deb (/tmp/discord-tauri/src-tauri/target/release/bundle/deb/discord-tauri_0.3.0_amd64.deb)
    Bundling discord-tauri_0.3.0_amd64.AppImage (/tmp/discord-tauri/src-tauri/target/release/bundle/appimage/discord-tauri_0.3.0_amd64.AppImage)
       Error failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /tmp/discord-tauri/src-tauri/target/release/bundle/appimage/build_appimage.sh`

CSP

Discord's CSP is holding me back. We need to remove it before anything else, sadly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.