-
Notifications
You must be signed in to change notification settings - Fork 393
fix: fix framework server loading spinner ("Waiting for framework port") #7242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { stripVTControlCharacters } from 'util' | |
|
||
import execa from 'execa' | ||
|
||
import { stopSpinner, type Spinner } from '../lib/spinner.js' | ||
import { type Spinner } from '../lib/spinner.js' | ||
|
||
import { chalk, log, NETLIFYDEVERR, NETLIFYDEVWARN } from './command-helpers.js' | ||
import { processOnExit } from './dev.js' | ||
|
@@ -61,15 +61,9 @@ export const runCommand = ( | |
|
||
// Ensure that an active spinner stays at the bottom of the commandline | ||
// even though the actual framework command might be outputting stuff | ||
if (spinner?.isSpinning) { | ||
// The spinner is initially "started" in the usual sense (rendering frames on an interval). | ||
// In this case, we want to manually control when to clear and when to render a frame, so we turn this off. | ||
stopSpinner({ error: false, spinner }) | ||
} | ||
const pipeDataWithSpinner = (writeStream: NodeJS.WriteStream, chunk: string | Uint8Array) => { | ||
if (spinner?.isSpinning) { | ||
spinner.clear() | ||
} | ||
// Clear the spinner, write the framework command line, then resume spinning | ||
spinner?.clear() | ||
writeStream.write(chunk, () => { | ||
spinner?.spin() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this still isn't quite right — spin() renders a single frame, but here we want to keep looping even when we aren't receiving chunks from the framework server. But this fix is worth getting in now and I'll follow up when I get the full fix working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (In that follow-up I'll also look into how we can add test coverage for this) |
||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to draw the ✔️, not erase it