-
Notifications
You must be signed in to change notification settings - Fork 17
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 #55 enable upload widget instance methods #78
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Getting an undefined on this column can we tidy up the spacing around the code blocks? you may be able to trim that in the component. also can we add a copy button for the snippet? the one in Next is available upon hover of the code block getting this post message error. i saw something similar in Next.js, are we tracking this here? is this new? the issue there was trying to pass in non-serializable data through the instance methods: cloudinary-community/next-cloudinary#261 |
Where and when that error shows up? |
@matiasfha it shows up when using the upload widget examples in the docs |
Really weird stuff because I can't see that error on production nor local |
} | ||
|
||
if (typeof widget?.[method] === 'function') { | ||
const validOptions = options.filter((option) => typeof option !== 'undefined').filter(option => !(option instanceof PointerEvent)); |
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.
do you think the specificity of filtering on PointerEvent
will be enough safeguard for the future? wondering if it's going to just wind up back here again 🤔 it may be worth checking what's being sent through thats not valid and make sure it doesnt get here in the first place
here's the latest in Next Cloudinary that handles this: https://github.com/cloudinary-community/next-cloudinary/blob/main/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.tsx#L166
the options need to be serializable so something must be getting through somehow thats not
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.
maybe we can add something like
const validOptions = JSON.parse(JSON.stringify(options))
That will remove all non-serializable data
not able to produce the postMessage error anymore but left a comment on the solution |
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Updates the CldUploadWidtet component to enable all of the cloudinary instance methods.
Also updates de CldUploadWidget documentation
Issue Ticket Number
Fixes #55
Fixes #67
Fixes #69
Fixes #75
Fixes #76
Type of change
Checklist