JSConf JP

Passing Context Beyond Promises: proposal-async-context

LTTrack BJapanese

As web applications attach trace IDs to logs, manage user sessions, and visualize LLM reasoning steps, the need to propagate context across asynchronous operations is growing. JavaScript loses the caller’s context whenever execution crosses an asynchronous boundary such as Promise or setTimeout. The traditional workaround—passing arguments through every function—is verbose and harms maintainability.

The Stage 2 proposal-async-context aims to solve this at the language level. This session explains AsyncContext.Variable and AsyncContext.Snapshot from the fundamentals, including automatic context propagation without argument passing, practical uses in distributed tracing and AI log management, and implications for future JavaScript and TypeScript architecture.