Skip to content

Use ipcRenderer to replace @electron/remote #9368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
88250 opened this issue Oct 8, 2023 · 15 comments
Closed

Use ipcRenderer to replace @electron/remote #9368

88250 opened this issue Oct 8, 2023 · 15 comments
Assignees
Labels
Milestone

Comments

@88250
Copy link
Member

88250 commented Oct 8, 2023

Background:

@88250 88250 added the Refactor label Oct 8, 2023
@88250 88250 added this to the backlog milestone Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
@88250 88250 modified the milestones: backlog, 2.10.9 Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
Vanessa219 added a commit that referenced this issue Oct 8, 2023
@Zuoqiu-Yingyi
Copy link
Contributor

Zuoqiu-Yingyi commented Oct 9, 2023

@Vanessa219 许多插件依赖 require("@electron/remote") 调用一些系统原生功能, 能否在思源本体与 @electron/remote 解耦的同时保留 @electron/remote 依赖❓

@Zuoqiu-Yingyi
Copy link
Contributor

我看 @electron/remote 在一小时前发布了 v2.0.12 版本, 可能已经修复了该问题

REF: Release v2.0.12 · electron/remote

@Vanessa219
Copy link
Member

这个解耦不了,需要在启动的时候就进行声明和注入。鉴于
image

只能让插件作者修改一下了,我这边尽量提供 ipcRenderer 的接口。

@Zuoqiu-Yingyi
Copy link
Contributor

Zuoqiu-Yingyi commented Oct 9, 2023

这个解耦不了,需要在启动的时候就进行声明和注入。

我使用 v2.0.12 版本的 @electron/remote 编译并注入后可以正常启动 (Ubuntu 22.04.3 LTS)

@Zuoqiu-Yingyi
Copy link
Contributor

只能让插件作者修改一下了,我这边尽量提供 ipcRenderer 的接口。

那最好提供一个支持反射的接口

@terwer
Copy link
Contributor

terwer commented Oct 9, 2023

这个为啥要删除。删除之后我的 PicGO 插件马上GG 。

@leolee9086
Copy link

我比较支持去掉remote尽早提供安全的ipc方案,依赖一个已经被声明会废止的特性其实也不是啥好事儿

@Zuoqiu-Yingyi
Copy link
Contributor

我比较支持去掉remote尽早提供安全的ipc方案,依赖一个已经被声明会废止的特性其实也不是啥好事儿

被废止的是 require('electron').remote

@Zuoqiu-Yingyi
Copy link
Contributor

我使用 v2.0.12 版本的 @electron/remote 编译并注入后可以正常启动 (Ubuntu 22.04.3 LTS)

v2.0.12 版本的 @electron/remote 确实已兼容 electron@26

REF: electron/remote#152

@leolee9086
Copy link

我使用 v2.0.12 版本的 @electron/remote 编译并注入后可以正常启动 (Ubuntu 22.04.3 LTS)

v2.0.12 版本的 @electron/remote 确实已兼容 electron@26

REF: electron/remote#152

是我的问题,但是它确实也是electron官方不建议使用的

@zuoez02
Copy link
Contributor

zuoez02 commented Oct 9, 2023

好大的改动,我这webapp插件也有影响,另外进程控制也很难实现了。

桌面端的插件能力就跟移动端差别不了什么了,这个很反对

@frostime
Copy link
Contributor

frostime commented Oct 9, 2023

这种大幅度的更新也不能这么激烈啊,就算要废除也给几周的缓冲时间。

这样直接废除的话,好多插件作者要加班加点肝好几天把代码重构——但是本来废除这个也不是什么十万火急的事情,何必把大家都搞得很紧张呢。

@88250
Copy link
Member Author

88250 commented Oct 9, 2023 via email

@Zuoqiu-Yingyi
Copy link
Contributor

等会可能要加回去 😅

我可以 PR 一波, 不需要回滚现有的更改👀

@88250
Copy link
Member Author

88250 commented Oct 9, 2023 via email

@88250 88250 reopened this Oct 9, 2023
@88250 88250 added Abolishment and removed Refactor labels Oct 9, 2023
@88250 88250 removed this from the 2.10.9 milestone Oct 9, 2023
@Vanessa219 Vanessa219 added this to the 2.10.9 milestone Oct 9, 2023
@Vanessa219 Vanessa219 changed the title Remove @electron/remote dependency Use ipcRenderer to replace @Electron/remote Oct 9, 2023
@Vanessa219 Vanessa219 changed the title Use ipcRenderer to replace @Electron/remote Use ipcRenderer to replace @electron/remote Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants