-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Feature: dynamic proxy getter with ctx.Request.request
ISSUES CLOSED: #64
- Loading branch information
1 parent
b10b963
commit 687805f
Showing
5 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const CONFIG_CHANGE = 'CONFIG_CHANGE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { EventEmitter } from 'events' | ||
|
||
const eventBus = new EventEmitter() | ||
export { | ||
eventBus | ||
} |
687805f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问这里对request库的替换是无痕的吗?
插件只需要将原来的
ctx.Request.request
替换成ctx.request
即可? 还是需要后期做一些额外的适配性工作?687805f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
理论上是的,会尽可能保持一致性的输入和输出。如果遇到实在无法保证的属性,也会在文档中标识出来。1.5.0会发个beta版本,届时会替换上got
687805f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,谢谢,
别忘了同时替换官方库中这些的写法,以作为最新 request 用法的示例.
建议在某个版本中将默认的图床完全从 PicGo 中移除,作为插件存在.
687805f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未来会考虑,之后要做web版本适配的话,会考虑做一些抽离。