Skip to content

Add plugin config items backends and frontends #8386

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
zuoez02 opened this issue May 29, 2023 · 8 comments
Closed

Add plugin config items backends and frontends #8386

zuoez02 opened this issue May 29, 2023 · 8 comments
Assignees
Milestone

Comments

@zuoez02
Copy link
Contributor

zuoez02 commented May 29, 2023

需要增加插件标签以便适配不同平台及用户过滤

In what scenarios do you need this feature?

  1. Desktop Only,Mobile Only等平台tag
  2. Windows、Mac、Linux等系统过滤
  3. Kernel、App等插件影响对象过滤。
  4. 其他标签如果能支持自定义更好,最好是思源内置一部分,其他的类似论坛一样进行定制。

Describe the optimal solution

  1. 插件package.json增加tag属性,字符串数组
  2. 云端提供可选tag
  3. 集市可以根据tag进行过滤,并针对系统、平台等属性自动隐藏不适配的插件。
  4. 插件系统装载时不装载不适配的插件
  5. 对于其他平台下载的插件,已下载中展示为”不适配“

Describe the candidate solution

No response

Other information

No response

@88250
Copy link
Member

88250 commented May 29, 2023

考虑新增两个配置项:

  • backends:后端环境,比如 windows, linux, darwin, docker, android, ios
  • frontends: 前端环境,比如 desktop, desktop-window(页签转换的新窗口), mobile, browser-desktop, browser-mobile

@zuoez02
Copy link
Contributor Author

zuoez02 commented May 29, 2023

一个是用户怎么用的问题,一个是开发者怎么写的问题。

对于用户来说,前端后端名词是否专业了一些?标签系统也许对于普通用户更容易理解,毕竟明白前端后端的,也就程序员群体了我觉得。
对于开发者来说,这个是属于白名单机制吗?具体设计的话可以再写详细一些方便开发者讨论这个问题。

配置项之外用户在集市上相关的操作建议也请考虑是否接受?

@88250
Copy link
Member

88250 commented May 29, 2023

暂时先不考虑用户端的过滤吧,后面用关键字搜索进行过滤。

这两个配置项是白名单,backends 主要是限定内核,比如有的插件需要 pandoc,但是 pandoc 只在桌面端环境上才支持,这时候就需要将后端能力限定在 windows, linux, macOS 上;frontends 主要是限定客户端,比如有的插件只能支持在桌面端上使用,不支持浏览器上使用。

@zuoez02
Copy link
Contributor Author

zuoez02 commented May 29, 2023

过滤是一方面,其他的比如非当前平台的插件展示为不可用这类的。已下载的也标为不可用这种,当然还可以保留用户删除的方法。

@88250
Copy link
Member

88250 commented May 29, 2023

对,这个实现的时候会考虑。

@terwer
Copy link
Contributor

terwer commented May 29, 2023

支持添加这个,这个太重要了。
不适配的平台最好不显示,要不然对用户会产生误解。
而且有时候受限于技术因素、开发者的时间精力等,某些功能只能在特定平台可用。
可以这样,已经下载的不适配的可以显示为不可用。后续不兼容的平台不让下呗。

@88250 88250 changed the title 需要增加插件标签以便适配不同平台及用户过滤 Add plugin config items backends and frontends May 29, 2023
@88250 88250 self-assigned this May 29, 2023
@88250 88250 added this to the 2.8.10 milestone May 29, 2023
88250 added a commit to siyuan-note/plugin-sample that referenced this issue May 29, 2023
Vanessa219 added a commit to siyuan-note/siyuan-ios that referenced this issue May 29, 2023
Vanessa219 added a commit that referenced this issue May 29, 2023
Vanessa219 added a commit that referenced this issue May 29, 2023
Vanessa219 added a commit that referenced this issue May 29, 2023
88250 added a commit that referenced this issue May 29, 2023
88250 added a commit that referenced this issue May 29, 2023
88250 added a commit that referenced this issue May 29, 2023
88250 added a commit to siyuan-note/plugin-sample that referenced this issue May 29, 2023
@Zuoqiu-Yingyi
Copy link
Contributor

Zuoqiu-Yingyi commented May 29, 2023

插件 API 最好能同时提供一下 isWindows, isDarwin, isLinux 等用于环境判断的工具函数

88250 added a commit to siyuan-note/plugin-sample that referenced this issue May 29, 2023
@Vanessa219
Copy link
Member

Vanessa219 commented May 29, 2023

插件 API 最好能同时提供一下 isWindows, isDarwin, isLinux 等用于环境判断的工具函数

#5066 getFrontend

88250 added a commit that referenced this issue May 30, 2023
@88250 88250 closed this as completed May 30, 2023
88250 added a commit to siyuan-note/plugin-sample that referenced this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants