-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make storage work #8
Comments
Can we maybe do this with signed urls? We would just need 2 async functions provided at some point by the user async function getSignedGetUrl(fileKey: string): string { return signedUrl } // for viewing
async function getSignedPostUrl(fileKey: string): PresignedPost { return post} // for posting and a const { url, fields } = await getSignedPostUrl((fileKey)
await fetch(url, {
method: 'POST',
body: formData(...fields...) ,
}) and similarly for the fetching images from the bucket. Would something like this workout? |
That should work We can probably just throw some server actions in there. We should probably reimplement something like https://github.com/farbenmeer/handbuch/blob/main/src/components/S3Image.tsx here. |
yes! like that looks verygood! Btw its very similar to how we do it too ^^ What I dont quite get, is when we get this info from the user (functions and what not). Is it something like: |
I'd expect something like <Editor getSignedImageUrl={...} getSignedUploadUrl={...} plugins={...} getMentions={...} /> I guess 🤷 |
Or maybe <Editor plugins={[
imagePlugin({ getSignedImageUrl, getSignedUploadUrl }),
mentionPlugin({ getMentions }),
...
]} /> |
alright I see.! We can always check at the end if it became annoying to have to pass in many porps everytime when one uses the RTE or if its actually ok. The second options looks nicer to me! |
if it gets annoying you can always pull out the plugin initialization const plugins = [imagePlugin(...), mentionPlugin(...)] and then use that wherever you use the editor <Editor plugins={plugins} /> or even wrap the editor function MyEditor() {
return <Editor {...} />
} |
I like passing parameters to the plugin that needs them better as well. |
For images we need some generic way to upload to and view images from S3-compatible storage.
The text was updated successfully, but these errors were encountered: