Skip to content

feat: parse and stream Vite stdout logs via SSE to show live progress in frontend - #53

Open
Devadakene wants to merge 1 commit into
Ender-Stellar:mainfrom
Devadakene:main
Open

feat: parse and stream Vite stdout logs via SSE to show live progress in frontend#53
Devadakene wants to merge 1 commit into
Ender-Stellar:mainfrom
Devadakene:main

Conversation

@Devadakene

Copy link
Copy Markdown

This PR closes #27
Description
When Vite dev server builds or restarts within the sandbox, the UI formerly displayed a generic spinner with no insight into compilation progress or startup status. This PR introduces live progress reporting by parsing and streaming Vite stdout logs to the frontend using Server-Sent Events (SSE).

Key Changes
Vite Log Streaming API: Created an SSE handler at GET /api/vite-logs-stream that checks the active sandbox (E2B or Vercel), reads the last lines of /tmp/vite.log, runs heuristic log parsing (to detect starting, building, ready, or error stages), and streams JSON status messages.
Provider Alignment: Updated e2b-provider.ts to output stdout and stderr to /tmp/vite.log upon starting or restarting, matching the Vercel sandbox provider.
Live Progress Overlay: Added a React state listener in app/generation/page.tsx connected to the SSE stream, showing a premium, glassmorphic compile overlay over the preview iframe containing live log outputs whenever Vite is compiling or restarting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: Show detailed progress steps during Vite compilation stages

1 participant