mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #364] [CLOSED] feat(image): build-time image optimization via Sharp #513
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#513
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/364
Author: @Divkix
Created: 3/9/2026
Status: ❌ Closed
Base:
main← Head:feat/image-optimization📝 Commits (10+)
0c0103cfeat(image): add build-time image optimization via Sharp7cc2890fix: remove static sharp type imports to fix CI typecheckd002b7frefactor(image): use manifest-based optimization matching Next.js API39ba58cdocs: update documentation to reflect build-time image optimization5cb1682test(image): add isSafeImageContentType, manifest lookup, and parseImageParams edge case tests3a18927test(image): add comprehensive handleImageOptimization and parseImageParams tests87a9f0dtest(image): add 29 tests for security, parity, and robustness gaps0abe485feat(image): add detectContentType, bypass types, and validation parity with Next.js5a0ccccfeat(image): add AVIF quality offset and Content-Disposition filenameebeb774feat(image): add overrideSrc, data:image/* placeholder, deprecated props, blurWidth/blurHeight📊 Changes
17 files changed (+4408 additions, -257 deletions)
View changed files
📝
.agents/skills/migrate-to-vinext/SKILL.md(+9 -9)📝
.agents/skills/migrate-to-vinext/references/compatibility.md(+26 -26)📝
.agents/skills/migrate-to-vinext/references/troubleshooting.md(+9 -9)📝
AGENTS.md(+10 -8)📝
README.md(+31 -31)📝
packages/vinext/package.json(+6 -0)📝
packages/vinext/src/config/next-config.ts(+2 -0)📝
packages/vinext/src/entries/app-rsc-entry.ts(+53 -1)📝
packages/vinext/src/index.ts(+333 -26)📝
packages/vinext/src/server/image-optimization.ts(+514 -41)📝
packages/vinext/src/server/prod-server.ts(+205 -3)📝
packages/vinext/src/shims/image.tsx(+163 -63)➕
packages/vinext/src/utils/sharp.ts(+15 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+258 -6)📝
tests/image-component.test.ts(+395 -19)➕
tests/image-optimization.test.ts(+2362 -0)📝
tests/shims.test.ts(+17 -15)📄 Description
Summary
.webpat multiple responsive widths via?vinext-optvirtual modules. Static imports getoptimizedSrcSetwith direct asset URLs instead of/_vinext/imageruntime routing.vinext-image-cache/)Edge cases handled
metadata.pages > 1Files changed
packages/vinext/src/utils/sharp.tspackages/vinext/src/shims/image.tsxStaticImageDatawithoptimizedSrcSet, updated renderingpackages/vinext/src/index.ts?vinext-optresolver/loader, build-time transform, dev server handlerpackages/vinext/src/server/app-dev-server.tspackages/vinext/src/server/prod-server.tspackages/vinext/package.jsonsharp >=0.33.0as optional peer deptests/image-optimization.test.tstests/image-component.test.tsoptimizedSrcSetrendering testsTest plan
pnpm test tests/image-component.test.ts tests/image-imports.test.ts tests/image-optimization.test.ts— 60 tests passpnpm devin fixture, verify/_vinext/imagereturnsimage/webpContent-Type.webpfiles indist/client/assets/.webpassets, not/_vinext/imageURLspnpm run typecheckandpnpm run lintpass in CICloses #363
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.