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(upload-extension): improve upload extension #2096
base: main
Are you sure you want to change the base?
Conversation
|
export interface PlaceholderPluginMeta { | ||
added: Array<Omit<AddPlaceholderAction, 'type'>>; | ||
removed: Array<Omit<RemovePlaceholderAction, 'type'>>; | ||
updated: Array<Omit<UpdatPlaceholderAction, 'type'>>; | ||
} |
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.
If PlaceholderPluginMeta
is just an array of PlaceholderPluginAction
, it seems both the typing could be simpler (e.g. no Omit
is needed anymore).
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.
Even though the type property in PlaceholderPluginMeta
doesn't have much use, keeping it directly can make the code look a bit simpler. I'll have a try.
Your change for |
I agree with your perspective. It seems like we need to separate the functionality into three methods: |
Current
By using |
1afcce1
to
d62be92
Compare
I noticed your PR #2100. The modifications in this PR caused some of my current test cases to fail. So I think there is a tight coupling between the current upload-extension and file-extension, so I believe that the file-placeholder-plugin should exist as a plugin for file-extension rather than being a built-in extension.In this case, the file-placeholder-plugin can be used as a specific placeholder for the file-extension, while users can utilize the relevant methods from the decoration-extension when they need to use general placeholder functionality. |
In my project, the use case for the upload-placeholder is in scenarios where asynchronous requests are needed. A typical example is when I need to call a backend API to re-sign copied resource nodes, ensuring that the permissions of the resource nodes are not compromised. |
It's worth noting that currently, the uploadImage in the |
8919e06
to
7a280e2
Compare
7a280e2
to
59e02c3
Compare
Description
Checklist
pnpm fix
completed successfully.pnpm test
.Screenshots