digidem / mapeo-desktop

Local-first mapping and monitoring in remote environments
https://mapeo.app
GNU General Public License v3.0
261 stars 33 forks source link

Evaluate current usage of Electron IPC and Node in renderer and update to follow better practices #731

Open ximenabb opened 1 year ago

ximenabb commented 1 year ago

Description

The goal of this work is to disable Node integration and enable context isolation in the app renderer window, as well as improve the readability for maintenance purposes.

There are various items to addresss:

  1. Electron renderer IPC usage is scattered all over the place and would be better to consolidate into the preload, as recommended.

  2. Our usage of @electron/remote is discouraged by the project and should be removed so that features relying on this are using the recommended IPC mechanisms.

  3. Our usage of Node APIs is scattered and if possible, we should consolidate it in either the preload (which has access to some Node APIs) or at least in a dedicated file/directory to make it easier to migrate if necessary.