Skip to content

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

Merged
merged 3 commits into from
May 1, 2025

Conversation

serhalp
Copy link
Collaborator

@serhalp serhalp commented Apr 28, 2025

Summary

This is a regression in the loading spinner shown before "Waiting for framework port", introduced in 19.0.3.

See:

  1. fix(deps): replace ora and log-symbols with tiny dependency nanospinner #7026
  2. fix: avoid starting and stopping spinner loops #7131
  3. Never ending "Waiting for framework" in 19.0.3 #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in from the underlying framework dev server, clear the spinner line, write the chunk, then resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of isSpinning.

Fixes #7124.

Thank you @Florian-Mt for spotting the (embarrassing!) fix.

Before

Monosnap screencast 2025-05-01 08-05-27

After

Monosnap screencast 2025-05-01 08-03-20

Copy link

github-actions bot commented Apr 28, 2025

📊 Benchmark results

Comparing with 5d70c98

  • Dependency count: 1,150 (no change)
  • Package size: 280 MB ⬇️ 0.00% decrease vs. 5d70c98
  • Number of ts-expect-error directives: 404 (no change)

@@ -68,7 +68,7 @@ export const startFrameworkServer = async function ({
throw new Error(`Timed out waiting for port '${settings.frameworkPort}' to be open`)
}
}
stopSpinner({ error: false, spinner })
spinner.success()
Copy link
Collaborator Author

@serhalp serhalp Apr 28, 2025

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

spinner.clear()
}
// Clear the spinner, write the framework command line, then resume spinning
spinner?.clear()
writeStream.write(chunk, () => {
spinner?.spin()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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)

@serhalp serhalp marked this pull request as ready for review May 1, 2025 12:07
@serhalp serhalp requested a review from a team as a code owner May 1, 2025 12:07
serhalp added 2 commits May 1, 2025 09:36
This is a regression in the loading spinner shown before "Waiting for framework port", introduced in 19.0.3.
See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
@serhalp serhalp force-pushed the fix/spinner-7124 branch from 7a7bbde to 3f367cf Compare May 1, 2025 13:36
@serhalp serhalp enabled auto-merge (squash) May 1, 2025 18:27
@serhalp serhalp merged commit 841d782 into main May 1, 2025
52 checks passed
@serhalp serhalp deleted the fix/spinner-7124 branch May 1, 2025 18:43
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.

Never ending "Waiting for framework" in 19.0.3
2 participants