mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1074] [MERGED] refactor(plugins): dedupe og-asset read-to-base64 wrapper #1071
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#1071
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/1074
Author: @james-elicx
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @james-elicx
Base:
main← Head:refactor/dedupe-og-asset-read📝 Commits (1)
bbb30b4refactor(plugins): dedupe og-asset read-to-base64 wrapper📊 Changes
1 file changed (+20 additions, -26 deletions)
View changed files
📝
packages/vinext/src/plugins/og-assets.ts(+20 -26)📄 Description
Summary
packages/vinext/src/plugins/og-assets.ts(one for thefetch(new URL(...))rewrite, one for thereadFileSync(fileURLToPath(...))rewrite) read a file from disk, base64-encoded it, populated the build cache, and silently skipped on error. Both branches were structurally identical apart from the surrounding regex match and the inline replacement string.readAsBase64(absPath)helper that closes over the existingcacheMap anduseCacheflag. Returnsstring | nullso call sites can short-circuit with a singlecontinue. No behavior change: same cache semantics, same silent-on-error fallback, same return type on miss.Files changed
packages/vinext/src/plugins/og-assets.ts(-26 / +20)Test plan
pnpm vp test run tests/og-inline.test.ts— 8/8 passpnpm fmt --writecleanpnpm knipclean🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.