Now, the preferred way to communicate between processes is to use @wexond/rpc-electron package.
Example:
Handling the IPC message in the main process:
src/main/network/network-service-handler.ts
Sending the IPC message to the main process:
const { data } = await networkMainChannel.getInvoker().request('http://localhost');Common RPC interface
As Electron will be deprecating the remote module, we are migrating to our RPC solution.
We are going to turn off nodeIntegration, enable contextIsolation and sandbox in the UI webContents,
therefore we prefer not having requires to node.js built-in modules in renderers.
Common interfaces, constants etc. should land into the common directory.