Skip to content
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

Feature Request: Support Cloudinary CDN #209

Open
theMasix opened this issue Jun 21, 2020 · 2 comments
Open

Feature Request: Support Cloudinary CDN #209

theMasix opened this issue Jun 21, 2020 · 2 comments
Assignees

Comments

@theMasix
Copy link

theMasix commented Jun 21, 2020

Hello. I use this package for my entire avatar serving in React. Today, I got acquainted with Cloudinary CDN. I wonder if we could have cloudinray-specific support: Give the image name and image config to the package, then the package make the correct image url and serve it. I think it would be useful.
I know the Cloudinary has its own React SDK. So what we might do is only merge the SDK with this package.

@JorgenEvens
Copy link
Member

JorgenEvens commented Jul 11, 2020

Hi @theMasix,

I'm hesitant to include this in react-avatar core because of the dependency on the javascript library of Cloudinary.

I see three options to move forward with Cloudinary support in react-avatar.

  • The first would be you created a wrapper component yourself and you would use the javascript SDK to build the URL and pass it into react-avatar.

  • We create a Cloudinary source that imports the library but is not included by default. You'd have to import it explicitly and configure react-avatar to use it, similar to the bundle reduction code.

  • We create a Cloudinary source that accepts instances of the cloudinary.Cloudinary class from the Cloudinary javascript SDK and a set of transformations.

Would it be possible for you to let me know which would / wouldn't fit your use-case?

@theMasix
Copy link
Author

I finally came up with the first solution. I use javascript SDK and build the URL. then pass it to the react-avatar as src prop.
Your second solutions looks good. I love it too.
But the third one is not my favorite solution. It's kind of a putting the cart before the horse I think...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants