sindresorhus/electron-util

Replace built in `remote` module with `@electron/remote`

dertieran opened this issue ยท 6 comments

From Breaking Changes:

The remote module is deprecated in Electron 12, and will be removed in Electron 14. It is replaced by the @electron/remote module.

This package uses the built in remote module and also exposes it as api.
To be able to use it in the coming electron versions it should be replaced with @electron/remote.

I guess the main problem is that it needs to be initialized in the main process.
So electron-utils also needs to expose a initialize function?

An alternative would be to just not use the remote module anymore, but I guess that would be a big breaking change.

Happy to provide a PR if it is clear how the initialize step should work or if the remote module should be dropped completely.

So electron-utils also needs to expose a initialize function?

That would probably be the simplest solution, yes.

An alternative would be to just not use the remote module anymore, but I guess that would be a big breaking change.

Yeah, that would be too much of a breaking change.

Okay, will see if I can work on this in the coming days or over the holidays.

FYI: This also means that we would need to target electron 10.

NOTE: @electron/remote requires Electron 10 or higher.

So maybe #28 can then also be included after this.

Okay, will see if I can work on this in the coming days or over the holidays.

Awesome :)

FYI: This also means that we would need to target electron 10.

Yeah, that's fine.

So maybe #28 can then also be included after this.

๐Ÿ‘

Added an initial idea how to solve this in the PR above, but no sure about the solution.

More for you @sindresorhus I guess, you have 6 other repositories that also use remote

electron-is-dev is also required by electron-util itself.

Not sure if they all actually require remote to work or just to provide compatibility for the renderer process.
Maybe there is a general way to approach the deprecation of the build in remote module. ๐Ÿค”

Happy to discuss this, because I personally also use two of them ๐Ÿ˜… and would like to keep using them.
Not sure where the ideal place for this discussion is, so feel free to move this somewhere else.
(I already kind of split it between the PR and this issue ๐Ÿ™ˆ)

Feel free to use this issue for general discussions, and thanks again for the help.

If anyone wants to work on this, see #37 as a starting point.