mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #451] Phase 1/2: Consolidate per-request ALS scopes and land initial Pages Router parity #101
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#101
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?
Originally created by @Divkix on GitHub (Mar 11, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/451
Problem
Every vinext request path historically relied on multiple nested
AsyncLocalStorage.run()calls from different shim modules. That adds measurable overhead on Workers and makes request-scoped state harder to reason about.Solution
Consolidate request-scoped state into a single
UnifiedRequestContextbacked by one ALS instance. Individual shims read from the unified store when inside the unified scope and fall back to their standalone ALS outside it for compatibility.Scope
Phase 1 (this issue / PR #450)
headers,navigation-state,cache,cache-runtime,fetch-cache, andrequest-contextrouter-state.tsandhead-state.tsread from unified context when inside the scopeDeferred to Phase 2 (#478)
#478is an umbrella follow-up issue and may span more than one PR.The first follow-up PR should focus on:
renderPage()entrycacheContextStorageand_unstableCacheAlsFallback cleanup is conditional after that validation work. Standalone fallback ALS code should only be removed where it is clearly unnecessary; otherwise it should be kept with rationale.
Related