Skip to content

fix(dev): polish and improve dev command output - #7249

Merged
serhalp merged 6 commits into
mainfrom
fix/cpla-2543-dev-cmd-polish
May 1, 2025
Merged

serhalp merged 6 commits into
mainfrom
fix/cpla-2543-dev-cmd-polish

Conversation

@serhalp

@serhalp serhalp commented May 1, 2025 •

Copy link
Copy Markdown
Member

Summary

  • Reword messages for clarity and consistency
    • I think "Netlify Dev" was a vestige of Netlify CLI's predecessor...? In any case, I dropped this wording.
    • e.g. Starting Netlify Dev with Astro → Starting Astro dev server
    • e.g. Waiting for framework port 4321 → Waiting for Astro dev server to be ready on port 4321
  • Remove the "🔸 Netlify Dev 🔸" first line (doesn't seem to add anything)
  • Attempt to address the common confusion around the two printed URLs (our dev server + framework server):
    • more distinctive box with Netlify-cyan and distinctive diamond
    • 'inverted' colour on the URL (cyan background) to make it stand out the most
    • Server now ready on http... → Local dev server ready: http...
  • Attempt to address the common confusion around this message: ✔ Waiting for framework port 4321. This can be configured using the 'targetPort' property in the netlify.toml
    • (Users often think this is an error message. I don't blame them.)
    • I changed this to Waiting for Astro dev server to be ready on port 4321 (where Astro is the framework name)
    • I added logic so that after 5 seconds of waiting the message changes to Still waiting for server on port 4321 to be ready. Are you sure this is the correct port for your Astro site? Change this with the targetPort option in your netlify.toml..
  • Collapse "Injected env var" messages into a single line per source
  • ◈ → ⬥
  • Fix one line being a yellow warn for no reason

Before

Screenshot 2025-04-30 at 13 48 36

After

Monosnap screencast 2025-05-01 10-01-51

Here's an accelerated demo of the waiting message changing after 5s:

Monosnapscreencast2025-05-0110-05-52-ezgif com-cut

serhalp added 3 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/cpla-2543-dev-cmd-polish branch from fdae15d to 5a99008 Compare May 1, 2025 14:00
serhalp added 2 commits May 1, 2025 10:14
- Reworded messages for clarity and consistency
  - I think "Netlify Dev" was a vestige of Netlify CLI's predecessor...? In any case, I
    dropped this wording.
  - e.g. Starting Netlify Dev with Astro → Starting Astro dev server
  - e.g. Waiting for framework port 4321 → Waiting for Astro dev server to be ready on port 4321
- Removed the "🔸 Netlify Dev 🔸" first line (doesn't seem to add anything)
- Attempted to address the common confusion around the two printed URLs (our dev server +
  framework server):
  - more distinctive box
  - 'inverted' colour on the URL (cyan background) to make it stand out the most
  - changed `Server now ready on http...` to `Local dev server ready: http...`
- Attempted to address the common confusion around this message: `✔ Waiting for framework
  port 4321. This can be configured using the 'targetPort' property in the netlify.toml`
  - (Users often think this is an error message. I don't blame them.)
  - I changed this to `Waiting for Astro dev server to be ready on port 4321` (where Astro is the framework name)
  - I added logic so that after 5 seconds of waiting the message changes to `Still waiting
    for server on port 4321 to be ready. Are you sure this is the correct port for your
    Astro site? Change this with the targetPort option in your netlify.toml.`.
- Collapse "Injected env var" messages into a single line per source
- ◈ → ⬥
@serhalp
serhalp force-pushed the fix/cpla-2543-dev-cmd-polish branch from 5a99008 to 714fb94 Compare May 1, 2025 14:14
@serhalp
serhalp marked this pull request as ready for review May 1, 2025 14:14
@serhalp
serhalp requested a review from a team as a code owner May 1, 2025 14:14
Base automatically changed from fix/spinner-7124 to main May 1, 2025 18:43
@serhalp
serhalp enabled auto-merge (squash) May 1, 2025 20:59
@github-actions

github-actions Bot commented May 1, 2025

Copy link
Copy Markdown

📊 Benchmark results

Comparing with d9523c7

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

@serhalp
serhalp merged commit 7a5b7c0 into main May 1, 2025
@serhalp
serhalp deleted the fix/cpla-2543-dev-cmd-polish branch May 1, 2025 21:16
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.

2 participants