Skip to content

fix: fix framework server loading spinner ("Waiting for framework port") - #7242

Merged
serhalp merged 3 commits into
mainfrom
fix/spinner-7124
May 1, 2025
Merged

serhalp merged 3 commits into
mainfrom
fix/spinner-7124

Conversation

@serhalp

@serhalp serhalp commented Apr 28, 2025 •

Copy link
Copy Markdown
Member

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

@github-actions

github-actions Bot commented Apr 28, 2025 •

Copy link
Copy Markdown

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

}
}
stopSpinner({ error: false, spinner })
spinner.success()

@serhalp serhalp Apr 28, 2025 •

Copy link
Copy Markdown
Member Author

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

Comment thread src/utils/shell.ts
// Clear the spinner, write the framework command line, then resume spinning
spinner?.clear()
writeStream.write(chunk, () => {
spinner?.spin()

Copy link
Copy Markdown
Member 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
Copy Markdown
Member 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
@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