[PR #435] [MERGED] perf: async I/O + cache for og-inline-fetch-assets transform #573

Closed
opened 2026-05-06 13:08:49 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/435
Author: @Divkix
Created: 3/11/2026
Status: Merged
Merged: 3/11/2026
Merged by: @james-elicx

Base: mainHead: perf/og-inliner-async-io


📝 Commits (4)

  • 50a073f perf: convert og-inline-fetch-assets transform to async I/O with per-build cache
  • 7d3f8cc fix: use strict undefined check in og-inline cache and restore spies via afterEach
  • 396795e fix: address og-inline review feedback
  • 7950f0d style: format og-inline test assertions

📊 Changes

2 files changed (+208 additions, -13 deletions)

View changed files

📝 packages/vinext/src/index.ts (+40 -13)
tests/og-inline.test.ts (+168 -0)

📄 Description

Closes #441

Summary

  • Converts vinext:og-inline-fetch-assets plugin's transform hook from synchronous fs.readFileSync() to async with fs.promises.readFile(), unblocking the Vite transform pipeline
  • Adds a per-build Map<string, string> cache so repeated reads of the same asset file (common with shared fonts across modules) hit memory instead of disk
  • Adds tests/og-inline.test.ts with 7 tests covering guard clause, both transform patterns, file-not-found handling, async assertion, and cache-hit verification

Test plan

  • pnpm test tests/og-inline.test.ts — 7/7 pass
  • pnpm test tests/deploy.test.ts tests/build-optimization.test.ts — 263/263 pass
  • pnpm run lint — 0 warnings, 0 errors
  • pnpm run typecheck — clean
  • CI full suite (Vitest + Playwright E2E)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/435 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `perf/og-inliner-async-io` --- ### 📝 Commits (4) - [`50a073f`](https://github.com/cloudflare/vinext/commit/50a073fca881a719285ac70b9f397e569326f492) perf: convert og-inline-fetch-assets transform to async I/O with per-build cache - [`7d3f8cc`](https://github.com/cloudflare/vinext/commit/7d3f8ccf5ed90d0b0346b36b67244001e07d9875) fix: use strict undefined check in og-inline cache and restore spies via afterEach - [`396795e`](https://github.com/cloudflare/vinext/commit/396795eb72a556168ea555a5386859c67f420bf3) fix: address og-inline review feedback - [`7950f0d`](https://github.com/cloudflare/vinext/commit/7950f0d5621ccf7bcd136f8a06cd8ad308b95f33) style: format og-inline test assertions ### 📊 Changes **2 files changed** (+208 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/index.ts` (+40 -13) ➕ `tests/og-inline.test.ts` (+168 -0) </details> ### 📄 Description Closes #441 ## Summary - Converts `vinext:og-inline-fetch-assets` plugin's `transform` hook from synchronous `fs.readFileSync()` to `async` with `fs.promises.readFile()`, unblocking the Vite transform pipeline - Adds a per-build `Map<string, string>` cache so repeated reads of the same asset file (common with shared fonts across modules) hit memory instead of disk - Adds `tests/og-inline.test.ts` with 7 tests covering guard clause, both transform patterns, file-not-found handling, async assertion, and cache-hit verification ## Test plan - [x] `pnpm test tests/og-inline.test.ts` — 7/7 pass - [x] `pnpm test tests/deploy.test.ts tests/build-optimization.test.ts` — 263/263 pass - [x] `pnpm run lint` — 0 warnings, 0 errors - [x] `pnpm run typecheck` — clean - [x] CI full suite (Vitest + Playwright E2E) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:08:49 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#573
No description provided.