Skip to content

Fix picospinner migration issues, clean up Logger API - #3109

Merged
fredrikekelund merged 2 commits into
trunkfrom
f26d/fix-logger-api-after-picospinner
Apr 16, 2026
Merged

Fix picospinner migration issues, clean up Logger API#3109
fredrikekelund merged 2 commits into
trunkfrom
f26d/fix-logger-api-after-picospinner

Conversation

@fredrikekelund

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Not at all.

Proposed Changes

#3035 migrated from the ora library to picospinner. There are some subtle differences in how these two libraries behave that weren't addressed there, and this PR tackles them.

  1. picospinner throws if we call .start() when the spinner is already running. Fix 'Spinner is already running' error when creating sites via CLI #3093 fixed that for the site create command specifically, but this PR generalizes the fix so we can safely call any Logger method without worrying about a crash.
  2. With ora, the Logger.reportSuccess method would log a new success line. This behavior disappeared in Replace ora with picospinner #3035, which removed some messages from the logging output. This PR brings back that behavior.

Lastly, I removed the shouldClearSpinner argument from the Logger.reportSuccess method. This was introduced in #1306 to address some CfT feedback on the first version of the CLI, but the better solution is to just not call Logger.reportSuccess at all (which is what we've been doing in most new code we've added since then).

Testing Instructions

  1. npm run cli:build
  2. node apps/cli/dist/cli/main.mjs export --path PATH_TO_SITE and ensure the command completes successfully
  3. node apps/cli/dist/cli/main.mjs preview create --path PATH_TO_SITE and ensure the command completes successfully
  4. node apps/cli/dist/cli/main.mjs site create and ensure the command completes successfully

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@fredrikekelund fredrikekelund self-assigned this Apr 16, 2026
Comment thread apps/cli/logger.ts
Comment on lines -63 to +61
progressCallback!( message );
return;
} else if ( progressCallback ) {
progressCallback( message );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-null assertions on progressCallback were superfluous, so I took this opportunity to remove them.

@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 16fb816 vs trunk

app-size

Metric trunk 16fb816 Diff Change
App Size (Mac) 1282.23 MB 1282.23 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk 16fb816 Diff Change
load 1556 ms 1893 ms +337 ms 🔴 21.7%

site-startup

Metric trunk 16fb816 Diff Change
siteCreation 8109 ms 8128 ms +19 ms ⚪ 0.0%
siteStartup 4306 ms 4315 ms +9 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and works as expected 👍

@fredrikekelund
fredrikekelund merged commit f708074 into trunk Apr 16, 2026
12 checks passed
@fredrikekelund
fredrikekelund deleted the f26d/fix-logger-api-after-picospinner branch April 16, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants