feat(addons): add upload transform provider hook#25
Open
Jiosanity wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
现有 upload provider 的
uploadFile()可以由插件完整接管文件存储,但插件无法在继续使用宿主内置 local / S3 存储的前提下,仅对上传图片进行压缩、缩放或格式转换。这使图片处理类插件必须重复实现存储逻辑,也无法自然复用宿主现有的文件配额、内容去重和上传记录。
修改
transformFile()runtime hooktransformFile()示例兼容性
transformFile()是可选钩子。未实现该钩子的现有 upload provider 行为不变;provider 返回
null或undefined时会跳过当前转换并继续原有流程。现有uploadFile()存储接管能力保持不变。验证