Skip to content

cleanup(core): migrate to nanospinner #29138

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Dec 2, 2024

Migrates from ora to nanospinner, a much lighter package.

this should roughly be a drop in replacement and will be faster/lighter

@43081j 43081j requested a review from a team as a code owner December 2, 2024 01:41
@43081j 43081j requested a review from Cammisuli December 2, 2024 01:41
Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Apr 26, 2025 3:37pm

Copy link

nx-cloud bot commented Dec 2, 2024

View your CI Pipeline Execution ↗ for commit 356e47f.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-ci ❌ Failed 42m 57s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 15s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded 1m 24s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-26 16:15:40 UTC

@JamesHenry
Copy link
Collaborator

@43081j I was thinking we would go for nanospinner for this, but found an issue that I linked to from the umbrella cleanup issue: e18e/ecosystem-issues#117 (comment)

Please could you confirm this library does not have this issue? (Should be able to modify the linked stackblitz) and how the two libraries compare?

@43081j
Copy link
Contributor Author

43081j commented Dec 3, 2024

I'll take a look when I can 👍

The two libraries are pretty well aligned, so it comes mostly down to personal preference. picospinner is a bit more customisable

Both maintainers are active in our community too, so you really could just flip a coin here 😅

Copy link
Collaborator

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

@43081j I added picospinner to my comparison with ora and nanospinner:
https://stackblitz.com/edit/stackblitz-starters-dmnx9n?file=package.json&view=editor

It seems like it doesn't actually allow for the error handling at all. Maybe it is calling process.exit itself?

  • ora: works as expected but bloated
  • nanospinner: has double printing issue on exit
  • picospinner: does not allow for exceptions to be handled

We cannot proceed until one of nanospinner or picospinner matches the functionality/robustness of ora I'm afraid

@43081j
Copy link
Contributor Author

43081j commented Dec 5, 2024

All good, I'll look into this today or tomorrow 👍

I'm mobile at the minute so can't dig into it but I'll figure it out once I'm at a laptop

@JamesHenry
Copy link
Collaborator

Hi @43081j,

Following up on this one:

With the latest versions of picospinner and nanospinner, it's nanospinner that seems to best match ora for our usage:

image

It's because usmanyunusov/nanospinner#32 was explicitly addressed.

tinylibs/picospinner#5 remains in limbo somewhat. I think we could probably press ahead with nanospinner for now, but remain open to picospinner in future?

@43081j
Copy link
Contributor Author

43081j commented Feb 15, 2025

its been a while so i forget what the disagreement was, but as far as i remember, it was because none of these spinners should really allow output while they're enabled

when the spinner is enabled, you wouldn't expect output to occur (because we're outputting the spinner frames).

errors are no different and shouldn't output either.

picospinner seems to be doing the right thing here and we're wrong for not stopping the spinner before outputting errors.

however, that does make your try/catch a little more verbose, so i understand why ora and nanospinner would add special behaviour for it.

we should go with nanospinner for that reason

@43081j 43081j requested a review from a team as a code owner February 15, 2025 12:30
@43081j
Copy link
Contributor Author

43081j commented Feb 15, 2025

i've rebased and updated to use nanospinner 👍

@43081j 43081j changed the title cleanup(core): migrate to picospinner cleanup(core): migrate to nanospinner Feb 15, 2025
@JamesHenry
Copy link
Collaborator

Awesome, thanks! Please can we add the usual lint import check to prevent regressions

43081j added 2 commits April 26, 2025 16:25
Migrates from `ora` to `nanospinner`, a much lighter package.
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