3 ms·
There is literally no reason to distribute an electron app when you could simply run it as a web server using `npm start` and navigate to `http://localhost:[por
by Seirdy 7y ago
There is literally no reason to distribute an electron app when you could simply run
it as a web server using `npm start` and navigate to
`http://localhost:[port http://localhost:[port number]`. Electron is born out of a misplaced notion that
some apps are "special" and deserve a certain extra percentage of the users' CPU
cycles and battery life for a spot in a user's system tray. 10% of a user's battery
life multiplied by all their electron apps is not worth it when alternatives (like
starting a web server and launching the users' preferred browser) exist.
- imtringued 7y agoI once used this pattern and implemented the webserver using C++. It was quite interesting that I could read gigabytes worth of files and run a sqlite database in the same process and still not exceed 3MB of RAM. Of course the tab in the browser used a lot more RAM (maybe 25MB) but browsers can suspend or simply close tabs. With regular applications the GUI would always be loaded in memory.
- imtringued 7y agoI once used this pattern and implemented the webserver using C++. It was quite interesting that I could read gigabytes worth of files and run a sqlite database in the same process and still not exceed 3MB of RAM. Of course the tab in the browser used a lot more RAM (maybe 25MB) but browsers can suspend or simply close tabs. With regular applications the GUI would always be loaded in memory. The reason why this pattern isn't used more commonly is the fact that right now web browsers simply aren't designed to be used this way unless you start a new instance for just a single app. The second reason is that electron developers are lazy. They only want to test a single browser (or browser version) and are perfectly happy that this means Google can get away with shady things.