Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So, how to improve Electron?

Does it use a new instance for every app, or it loads the engine once and reuses some of it for every instance? ie. can Electron be made to work like a system shared library, similar to GTK/Qt ?



The only improvement I see is to move away from electron. For alternatives everyone should take a look at Revery-ui written in Reasonml. Its starts in milliseconds, few megs of RAM usage, very low CPU usage and has most of the modern developer experience associated with Electron!!


MS probably knows. VSCode without any extension is pretty reactive and light. It becomes heavy when you have 20 tabs open with linters, languages servers, formatters and so on.

So maybe we CAN make electron lighter.


The real solution is of course to use the web browser as the "shared library", and develop a true PWA.

I know it's not always possible, but the web now offers a lot of powerful API's.


PWA are very limited:

- can't (realistically) use an alternative runtime. You are stuck with the JS ecosystem.

- can't start when the OS starts

- can't integrate with the UI (task bar, explorer menu, etc)

- can't run a server in the background for native perfs (like most electron apps actually do)

- can't open a server or a communication bus to allow apps cooperation, or playing well with the OS

- can't access the file system in any meaningful way to provide any kind of scanning ability

- can't store data reliably, or in any reasonable quantity

- can't call other local apps, run commands, etc

- can't access local libraries: so you do the crypto, hashing, dataprocessing in pure js

- can't access any non standard peripherics

- can't use the network, forget about avahi/bonjour, broacasting, capturing packets or doing CORS


Like I said, it has limitations.

But your comparison is also not really fair, since you assume everything runs and is stored on your local computer. This is not the case anymore at all.

Plus, the web browser is probably the first application that is started by a user.

Following applications all run in my browser: - email - video conferencing with screen sharing - (persistent) chatting - Office applications (word processor, spreadsheet, ...) - photo storage - games - development sandboxes - ...

In fact most Apps I have on my phone could just be PWA's.

I'm not saying we should all go web, but I'm saying that most things where you want to use electron, you could let it run on the web.


You listed a whole bunch of "downsides" but they look more like good security measures for running an app inside a browser.


Half of the softwares installed on my computer would not run because of those good security measures.

The browser let you do CRUD apps, with a hint of medias handling. That's it.

And not even good ones since your storage can be wiped out an any moment.


That makes sense!


< Does it use a new instance for every app >

Unfortunately, yes.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: