[PR #706] [MERGED] refactor: extract OG asset plugins into src/plugins/og-assets.ts #786

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

📋 Pull Request Information

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

Base: mainHead: refactor/split-og-assets-plugin


📝 Commits (1)

  • a885d1c refactor: extract OG asset plugins into src/plugins/og-assets.ts

📊 Changes

2 files changed (+225 additions, -188 deletions)

View changed files

📝 packages/vinext/src/index.ts (+6 -188)
packages/vinext/src/plugins/og-assets.ts (+219 -0)

📄 Description

Summary

  • Extracts vinext:og-inline-fetch-assets and vinext:og-assets out of the monolithic index.ts into packages/vinext/src/plugins/og-assets.ts
  • createOgInlineFetchAssetsPlugin() factory: the per-build Map<string, string> cache and isBuild flag become closure state inside the factory, removing two module-level variables that previously leaked into the outer vinext() closure
  • ogAssetsPlugin constant: the writeBundle-only plugin has no mutable state, so it exports directly as a plain plugin object
  • index.ts imports and delegates to these, removing ~190 lines of inline plugin code

Testing

  • vp check passes on both changed files (no type errors, no lint errors, no format issues)
  • pnpm test tests/features.test.ts — 264/264 pass

🔄 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/706 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/28/2026 **Status:** ✅ Merged **Merged:** 3/28/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `refactor/split-og-assets-plugin` --- ### 📝 Commits (1) - [`a885d1c`](https://github.com/cloudflare/vinext/commit/a885d1ce104ebf0c46536a1a5482310c67f3ff66) refactor: extract OG asset plugins into src/plugins/og-assets.ts ### 📊 Changes **2 files changed** (+225 additions, -188 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/index.ts` (+6 -188) ➕ `packages/vinext/src/plugins/og-assets.ts` (+219 -0) </details> ### 📄 Description ## Summary - Extracts `vinext:og-inline-fetch-assets` and `vinext:og-assets` out of the monolithic `index.ts` into `packages/vinext/src/plugins/og-assets.ts` - `createOgInlineFetchAssetsPlugin()` factory: the per-build `Map<string, string>` cache and `isBuild` flag become closure state inside the factory, removing two module-level variables that previously leaked into the outer `vinext()` closure - `ogAssetsPlugin` constant: the `writeBundle`-only plugin has no mutable state, so it exports directly as a plain plugin object - `index.ts` imports and delegates to these, removing ~190 lines of inline plugin code ## Testing - `vp check` passes on both changed files (no type errors, no lint errors, no format issues) - `pnpm test tests/features.test.ts` — 264/264 pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:06 +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#786
No description provided.