feat: parse and stream Vite stdout logs via SSE to show live progress in frontend - #53
Open
Devadakene wants to merge 1 commit into
Open
feat: parse and stream Vite stdout logs via SSE to show live progress in frontend#53Devadakene wants to merge 1 commit into
Devadakene wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.