mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #864] [MERGED] fix(shims): narrow runWith* return type when callback is async #905
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#905
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/864
Author: @fengmk2
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/21/2026
Merged by: @james-elicx
Base:
main← Head:fix/lint-await-thenable-overloads📝 Commits (2)
6c206a8fix(shims): narrow runWith* return type when callback is async673468cfix(shims): narrow remaining runWith* return types when callback is async📊 Changes
9 files changed (+43 additions, -0 deletions)
View changed files
📝
packages/vinext/src/shims/cache-runtime.ts(+2 -0)📝
packages/vinext/src/shims/cache.ts(+2 -0)📝
packages/vinext/src/shims/head-state.ts(+2 -0)📝
packages/vinext/src/shims/headers.ts(+5 -0)📝
packages/vinext/src/shims/i18n-state.ts(+2 -0)📝
packages/vinext/src/shims/navigation-state.ts(+4 -0)📝
packages/vinext/src/shims/request-context.ts(+8 -0)📝
packages/vinext/src/shims/router-state.ts(+2 -0)📝
packages/vinext/src/shims/unified-request-context.ts(+16 -0)📄 Description
Add
Promise<T>overloads to runWithRequestContext, runWithHeadersContext, and runWithNavigationContext so async callbacks don't widen the return type toT | Promise<T>. This clears 4 typescript-eslint(await-thenable) warnings wherePromise.allreceived the wider union.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.