Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e optimizer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dress Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idth Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…loader The loader's ladder had w342 the size union lacked, and both files split a TMDB URL by hand. images.ts now owns the widths and splitImageUrl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#tmdb said nothing about why it is there; #same-size does. The loader's JSDoc now says Next's width warning flags a pass-through source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folder header now names the one browser file, pass-through sources are said to warn in dev, and AC-1/AC-2 expect the #same-size fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four files spelled https://www.themoviedb.org; TMDB_HOME_URL now does, and the boundary test fails if a copy reappears. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/privacy wrote Supabase, Vercel and TMDB's country in page text; each processor now carries its transfer sentence and the page renders them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
What
Every
next/imagenow loads straight from TMDB's CDN through a custom loader, so Vercel Image Optimization does no transformations. The privacy policy changes in the same PR, because visitors' browsers now talk to TMDB directly.Why
The Vercel Hobby quota is 5,000 image transformations a month, and we were at 5.1K. Each unique TMDB image counts once per
srcsetwidth and format, so a catalog this size passes the quota at any traffic level. TMDB already serves every image in fixed sizes (w92up tow1280) and returns WebP when the browser accepts it, so Vercel's resize added nothing.Plan: prompts/tmdb-image-loader.md.
Changes
The loader (
lib/tmdb/image-loader.ts, new)next/imageasks for onto the smallest TMDB size that fits, fromw92, w154, w185, w300, w342, w500, w780, w1280.lib/tmdb/images.tspinned for the field is the ceiling. Aw500poster is never upgraded on a dense screen, so no image gets heavier than it is today.originalis capped atw1280and never requested as is, since it can be several MB.h632,w45, the local logo) comes back unchanged, so the loader never builds a URL for a host it was not given.#tmdbfragment. Next warns in dev that a loader "does not implement width" whenever it returnssrcunchanged. The fragment never reaches TMDB, so the request and its cache entry stay the same.Config (
next.config.ts)images.loader: "custom"andloaderFile: "./lib/tmdb/image-loader.ts".remotePatternsstays as the record of the one image host.Privacy policy (
lib/legal/operator.ts,app/privacy/page.tsx)PROCESSORS: it delivers catalog images straight to your browser, which shares your IP address with it.LEGAL_LAST_UPDATEDmoves to 2026-10-16.Docs and tests
lib/tmdb/AGENTS.mdrecords the loader and its ceiling rule.image-loader.test.tscovers the width ladder, the ceiling,original, the#tmdbmark and pass through URLs.next.config.test.tspins the loader setting.page.test.tsxchecks the new privacy wording.How to test / verify
You may want to run these yourself:
pnpm typecheck && pnpm lint && pnpm test && pnpm build.pnpm dev, open/shows, and in DevTools, Network, Img: every poster comes fromimage.tmdb.org/t/p/w…/…, and nothing hits/_next/image. The console shows no "does not implement width" warning.<img>: itssrcsetlists TMDB sizes, none abovew500.w780orw1280, cast photos atw92tow185, episode stills at up tow300./privacy: TMDB is listed and "Last updated" reads 16 October 2026.Results recorded when this branch was built: typecheck, lint, test (168 files, 2722 tests) and build passed. Under
pnpm start,/showsand a show page had 0/_next/imageURLs and everysrcsetpointed atimage.tmdb.org; a sample of 40 URLs all returned 200. Underpnpm dev, the width warning count went from 52 to 0 after the fragment fix.Risk & rollout
Low code risk, no migrations, no flags. Layout,
sizes, placeholders and missing image states are untouched. The real change is that visitors' IP addresses now reach TMDB's image CDN, which the policy text covers. Rollback is reverting the PR: images go back through Vercel's optimizer and the old privacy text returns.Notes for reviewers
srcsetentries can collapse to the same URL. That is on purpose; the browser dedupes them.qualityis ignored, since TMDB has no quality parameter.🤖 Generated with Claude Code