Hacker News new | ask | show | jobs
by howscrewedami 1008 days ago
While I don't have a strong preference for electron, I do have some thoughts and answers to your questions I'd like to share.

> Electron no longer allows Node.js to be called from renderer processes, all communication with Node.js is done via IPC.

I don't think calling Node.js from the renderer was a huge selling point for Electron - as it is not recommended due to security concerns. However, I still believe you can achieve this if you want - by using contextIsolation: false and nodeIntegration: true. But, even if this is not possible, it looks to me that using IPC with contextBridge still allows for pretty flexible Node.js use.

> Why does it have to be tied to V8/Node.js?

Some people prefer to have a Node.js backend (backend here being Electron's main Node.js process). There are multiple advantages to this:

- If using typescript: shared types between the frontend and backend

- Shared utilities, functions and constants

- If utilities and functions are shared, that means we can write some tests once, and the tests will work for both the backend and frontend

- Less context switching

These are just a few, I'm sure there are more.

> In this case, why do we still need Electron?

Besides the reasons I listed above, the alternative you listed (Tauri) seems to be relatively newer, have a smaller community, and with less online resources available (tutorials, stack overflow questions, etc).