Skip to content

wip: Add SSE endpoint for HMR cycle events#92482

Draft
huozhi wants to merge 1 commit intocanaryfrom
worktree-atomic-api
Draft

wip: Add SSE endpoint for HMR cycle events#92482
huozhi wants to merge 1 commit intocanaryfrom
worktree-atomic-api

Conversation

@huozhi
Copy link
Copy Markdown
Member

@huozhi huozhi commented Apr 7, 2026

No description provided.

AI agents editing files during `next dev` have no way to know when
compilation finishes or whether it succeeded. They must poll separate
endpoints and correlate results manually.

Add a Server-Sent Events endpoint at `/_next/dev/events` that streams
every HMR build cycle as it happens. Each event includes compilation
status, errors, duration, and which pages changed — giving subscribers
an atomic view of each edit cycle without polling.

Gated behind `NEXT_DEV_EVENTS=1` env var. Works with both Turbopack
and webpack.

```
NEXT_DEV_EVENTS=1 next dev
curl -N http://localhost:3000/_next/dev/events
```
@huozhi huozhi changed the title Add SSE endpoint for HMR cycle events wip: Add SSE endpoint for HMR cycle events Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants