Skip to content
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

[feat] 支持插件策略类型扩展 #16

Open
hyj1991 opened this issue Apr 14, 2022 · 4 comments
Open

[feat] 支持插件策略类型扩展 #16

hyj1991 opened this issue Apr 14, 2022 · 4 comments

Comments

@hyj1991
Copy link
Member

hyj1991 commented Apr 14, 2022

许多场景下,私有化部署时需要基于开源 Plugin 进行扩展(例如生命周期),需要提供扩展 Plugin 私有化的能力,而非只能 fork 代码全量修改后发包。

例如开源版本的 @artus/mysql,本土化部署时 mysql 连接前需要进行一些异步定制操作再继续,希望无需 fork @artus/mysql 代码,而是编写一个 @private/mysql 继承 @artus/mysql 进行扩展,这样开源版本的 @artus/mysql 即作为 Npm 依赖位于 @private/mysql 中,只需要关注扩展的私有定制逻辑即可。

@fengmk2
Copy link
Member

fengmk2 commented Apr 14, 2022

有意思,之前我们只想了框架的继承和扩展,看起来插件也应该是可以继承和扩展的。

@whxaxes
Copy link
Member

whxaxes commented Apr 15, 2022

赞,这个是非常强的诉求

@whxaxes
Copy link
Member

whxaxes commented Apr 15, 2022

这种依赖注入的方式还是很适合做插件的继承和拓展的,因为没有目录规范,就按照标准的 npm 模块 export ,然后内部的 import 进来再 extend 就行。

只是看一下应该要先把依赖注入方式下的插件实现规范确定了或者给个 poc ?

@hyj1991
Copy link
Member Author

hyj1991 commented Apr 15, 2022

具体的 Plugin 继承形式我还在构思中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants