fix: via.placeholder.com shut down in 2024 (now connection-refused)#751
Open
kiluazen wants to merge 1 commit intovercel:mainfrom
Open
fix: via.placeholder.com shut down in 2024 (now connection-refused)#751kiluazen wants to merge 1 commit intovercel:mainfrom
kiluazen wants to merge 1 commit intovercel:mainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test/image.test.tsxreferencesvia.placeholder.com/*. The service was shut down in 2024 and the DNS record no longer resolves.Why this is needed
via.placeholder.comwas shut down in 2024 and its DNS record no longer resolves — every request now hangs or returns a connection error. Any example that references it renders a broken-image icon (and any code that depends on a 200 from it silently breaks).Verify in any shell:
What this PR changes
Replaces every
https://via.placeholder.com/URL insidetest/image.test.tsx(20 occurrences: JSXsrcfixtures + their pairedexpect(requests).toEqual([...])assertions) withhttps://placehold.co/.Replacement details
placehold.coaccepts the identical/<W>x<H>and/<size>path shapes, and — crucially for this test file —placehold.co/150.svgstill serves SVG (same as the oldvia.placeholder.com/150.svgdid). Since every JSXsrcis paired with a correspondingexpect(...).toEqual([URL])assertion, a single replace-all keeps all pairs consistent. No runtime code touched, and no snapshot should change in meaning (satori rasterises whatever image the image loader returns; the mocked loader is asserted against URL equality, which stays consistent).Background
I'm tracking dead image-placeholder endpoints (
source.unsplash.com/*,via.placeholder.com/*,placekitten.com/*) across public repos as part of tteg, a tiny CLI/HTTP API I built so projects can drop in real Unsplash photos without registering an Unsplash app or managing API keys. tteg is not a dependency of this PR — the diff uses the dependency-free canonical replacement (placehold.co, which accepts the same path shape asvia.placeholder.com). If you want topic-matched real photos as a follow-up, the no-key HTTP API is athttps://tteg-api-53227342417.asia-south1.run.app/search?q=<query>&n=1(CORS-on, no auth).One extra artifact you may find handy: a public scanner at https://tteg.kushalsm.com/scan?url= that highlights dead-placeholder patterns in any landing page — useful for verifying the fix lands and for finding other places dead URLs slipped in. Source: https://github.com/kiluazen/tteg-landing/blob/main/scan.html.