fix(image): emit /_next/image URLs#1562
Conversation
Closes #1513 The default image loader and optimization endpoint switched from the vinext-specific /_vinext/image path to Next.js's canonical /_next/image. This unblocks the deploy suite tests that import Next.js's expected URL shape (/_next/image?url=...&w=...&q=...).
|
/bigbonk review |
commit: |
|
There was a problem hiding this comment.
Clean, mechanical rename — LGTM.
Verified:
- Zero remaining
/_vinext/imagereferences in production code. The 3 remaining occurrences intests/image-component.test.tsare intentional negative assertions (regression guards for #1513). IMAGE_OPTIMIZATION_PATHconstant updated correctly.- TPR filter change in
tpr.tsis correct: the old single-underscore/_vinext/prefix no longer exists anywhere in the codebase, so replacing it with/__vinext/(double underscore, used for internal prerender endpoints) keeps the filter accurate. - All hardcoded comparison sites (
index.ts,deploy.ts,app-rsc-handler.ts) are updated consistently.
One minor observation (not blocking): index.ts:2800, deploy.ts:505,641, and app-rsc-handler.ts:447 hardcode "/_next/image" instead of importing IMAGE_OPTIMIZATION_PATH. prod-server.ts already uses the constant. Not worth blocking on since this PR is a focused rename, but worth consolidating later to avoid future drift.
|
Review posted and approved on PR #1562. Here's the summary: Approved — clean, mechanical rename with no issues found. Key things verified:
Left a non-blocking note about consolidating the hardcoded |
Refs #1513 — URL prefix rename only. Follow-up issue: #1570.
Summary
next/imageloader, optimization endpoint route match, and generated Cloudflare Workers entries from/_vinext/imageto/_next/imageso emitted URLs and the server route match Next.js canonical behavior.IMAGE_OPTIMIZATION_PATHconstant now exports/_next/image.apps/web,examples/app-router-cloudflare,examples/app-router-playground) and README updated to the new prefix.Out of scope (tracked in #1570)
/_next/image(or Cloudflare Images proxy). The endpoint currently still returns 400 /text/html; only the URL rename is in this PR.Do not close #1513 when this PR merges — close it when #1570 also lands.
Test plan
tests/image-component.test.ts→ "default loader emits /_next/image URLs (issuenext/image: default loader emits/_vinext/imageinstead of/_next/imageoptimization endpoint #1513)") assertingimageOptimizationUrl()and<Image>SSR src use the/_next/imageprefix.tests/shims.test.ts,tests/image-component.test.ts,tests/image-optimization-parity.test.ts,tests/deploy.test.ts, andtests/pages-router.test.ts.vp checkpasses.