[PR #509] [MERGED] chore: add missing __vinext globals to global.d.ts #631

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

📋 Pull Request Information

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

Base: mainHead: fix/global-types-vinext-missing-globals


📝 Commits (1)

  • 9465827 add missing __vinext globals to global.d.ts and remove (req as any) casts

📊 Changes

2 files changed (+25 additions, -2 deletions)

View changed files

📝 packages/vinext/src/global.d.ts (+23 -0)
📝 packages/vinext/src/index.ts (+2 -2)

📄 Description

Summary

  • Adds process.env.__VINEXT_BUILD_ID to the ProcessEnv interface — it was already injected via Vite define at build time and read in 6+ source files, but was missing from the declaration.
  • Adds a declare module "node:http" augmentation for IncomingMessage.__vinextRewriteStatus — previously accessed via (req as any) in two places in index.ts; both casts are now removed.

What was already covered

All __VINEXT_RSC_*, __VINEXT_ROOT__, __VINEXT_APP__, locale, manifest, and error-handler globals were already declared in global.d.ts. The __vinext_scrollX / __vinext_scrollY history-state properties don't need a global declaration since history.state is typed any in the DOM — the existing inline casts at those sites are appropriate.


🔄 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/509 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/12/2026 **Status:** ✅ Merged **Merged:** 3/12/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/global-types-vinext-missing-globals` --- ### 📝 Commits (1) - [`9465827`](https://github.com/cloudflare/vinext/commit/94658276a09272828f41ba4756b9e19d642d6f95) add missing __vinext globals to global.d.ts and remove (req as any) casts ### 📊 Changes **2 files changed** (+25 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/global.d.ts` (+23 -0) 📝 `packages/vinext/src/index.ts` (+2 -2) </details> ### 📄 Description ## Summary - Adds `process.env.__VINEXT_BUILD_ID` to the `ProcessEnv` interface — it was already injected via Vite `define` at build time and read in 6+ source files, but was missing from the declaration. - Adds a `declare module "node:http"` augmentation for `IncomingMessage.__vinextRewriteStatus` — previously accessed via `(req as any)` in two places in `index.ts`; both casts are now removed. ## What was already covered All `__VINEXT_RSC_*`, `__VINEXT_ROOT__`, `__VINEXT_APP__`, locale, manifest, and error-handler globals were already declared in `global.d.ts`. The `__vinext_scrollX` / `__vinext_scrollY` history-state properties don't need a global declaration since `history.state` is typed `any` in the DOM — the existing inline casts at those sites are appropriate. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:12 +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#631
No description provided.