BeaconServers / Beacon-Frontend

0 stars 0 forks source link

Create a Desktop App Using React-Nodegui or Electron #10

Open billyb2 opened 3 years ago

billyb2 commented 3 years ago

Electron is the much easier option, though it's well known for hogging memory. React-NodeGui seems like an interesting option, with a very similar syntax to normal React JS.

Susorodni commented 3 years ago

Honestly, I believe we should go with electron. It's the best choice in mind, and for what we're making at such a low scale, I think we should be fine with memory usage

billyb2 commented 3 years ago

Ik man, but 300 mb for a game launcher is insane imho

Susorodni commented 3 years ago

I highly doubt it would be 300. Discord almost never goes above 300MB for me

billyb2 commented 3 years ago

Electron basically runs a stripped down Chromium under the hood, so it's a lot of excess memory that we don't really need. Here's some more info on it.. A basic hello world script takes up a solid 70mb, which is just some html tags w no images, CSS, or JavaScript. Including React JS would make it way, way bigger.

Beautiful sexy React NodeGUI on the other hand, binds to QT, a desktop application framework that's made to look lightweight while still looking good, since it is meant to use a framework already on most desktops (including linux ;)). It also compiles to a native app, but the code is written in JavaScript (it basically kinda sorta turns the JavaScript into C, then compiles it) to get that skrrt skrrt speed and memory usage. It's still a lot bc JavaScript, but still less than Electron.

Susorodni commented 3 years ago

Well then it looks like I´m gonna have to rewrite the entire frontend again since it looks like it uses proprietary rendering elements

billyb2 commented 3 years ago

Wdym lol, it's just React JS, but you need to render it slightly differently. We'd have to do the same for Electron.

Susorodni commented 3 years ago

Screenshot 2021-01-13 at 11 13 46 AM I'll say otherwise (aka this looks nothing like the React I know)

Susorodni commented 3 years ago

The other problem is that NodeJS does not have browser support with Chromium. This means that we can't export the normal frontend stuff like the website, login page, etc.

billyb2 commented 3 years ago

Wdym we can't export the normal stuff tho? We can just load the next page, we'd just have to do it slightly differently. The code that you've been working w. is NodeJS.

billyb2 commented 3 years ago

Also, that's definetly very React, like. You'd just have to import from different JS files, and modify them slightly.

billyb2 commented 3 years ago

Okay so me and @Susorodni talked, and we're most likely gonna use React Native, since it's basically React with like slightly different tags. I got the inital login page done in 1494abab3e97deea443876b2ec45a7b215f733b2. Will probably add some milestones to keep track of what's been ported. This commit should be closed when everything written in ui-dev is 100% working, then the react-native branch can be closed and merged into u-dev.