-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
refactor(image): deprecate avatarLegacy for removal #3109
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3109 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 2776 2776
Lines 226338 226341 +3
Branches 937 944 +7
=======================================
+ Hits 226253 226268 +15
+ Misses 85 73 -12
|
Could we make it an alias to avatar for the time being? |
I wouldn't do that, since that takes away some of the incentive to actually migrate. |
Shipping a version with urls we know to be broken doesn't seem ideal either though. |
If someone uses the legacy method, they very intentionally used that method because they wanted that image set and not the GH avatars. I agree that this situation is not ideal, but I don't see a solution that wouldn't break our tests or specification. We should add a test, to ensure that our generated links are still valid (if they are expected to be). |
Potential Workaround: faker.image.urlLoremFlickr({ category: 'portrait', width: 400, height: 400 }) |
Nah, this wont work for the data they need. They need real human faces. Like ID card pictures. And this.... is not something like that XD |
We could consider pointing to a static image with a message that avatarLegacy is deprecated? More useful than a broken image. |
I'd like to get a basic version of #465 implemented for 9.1.0 so we have a more useful replacement to point people to. |
Sounds like a quick good work around for the moment.
Not sure if 9.1, but potentially a 9.X. |
Maybe like this?
|
could be a compromise maybe |
The fact that you have to put a dictionary there kind of disqualifies that abbreviation. |
Maybe open a new GH discussion and just embed the full URL to that discussion in the image. Easier to edit that with a longer description of possible alternatives than trying to squeeze it into an image. |
I discovered the images are still available on an alternative IPFS endpoint at https://gateway.pinata.cloud/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/ if we want to retrieve the images from there. |
Those images have too many issues. We wont bring them back. |
Team Decision We will deprecate the method without changing the target urls.
|
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.
I would like to add, that I was at a conference while the "team decision" was made.
return `https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/${this.faker.number.int( | ||
1249 | ||
)}.jpg`; |
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.
suggestion: @matthewmayer had a potentially good idea here: #3109 (comment)
Should we consider it? If not, why?
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.
Are you referring to the discussion or the image/the link within?
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.
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.
Changing the current link breaks our tests and might be breaking for some of our users.
This isn't meant as a strict rejection, just a reminder that every change breaks someones workflow (similar to how avatar() would break the usecase for needing portraits, even though it isn't defined anywhere).
That's one of the reasons, why I would to be very specific with the expectations we have for the results of a method.
(aka should we provide metadata or would these serve a purpose not aligned with the method that serves the images)
On the other hand, if the users don't even look at our docs and their own logs, why would they read a random link in the browser?
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.
Did not considered these points 👍👌
So we could then instead throw a runtime warning with a link 🤔
Makes #2934 obsolete
The
faker.image.avatarLegacy()
method no longer produces useful results, so we should remove it soon.Theoretically, we could just remove it, but I'm not sure that is a good solution since it is technically a breaking change.
https://deploy-preview-3109.fakerjs.dev/api/image.html#avatarlegacy