Adds a spinner when performing a lazy install#275
Conversation
⏱️ Benchmark Resultsgatsby install-full-cold
📊 Raw benchmark data (gatsby install-full-cold)Base times: 2.415s, 2.433s, 2.420s, 2.439s, 2.411s, 2.424s, 2.433s, 2.424s, 2.432s, 2.436s, 2.424s, 2.447s, 2.425s, 2.429s, 2.411s, 2.410s, 2.416s, 2.426s, 2.427s, 2.405s, 2.394s, 2.416s, 2.421s, 2.413s, 2.419s, 2.412s, 2.427s, 2.404s, 2.425s, 2.386s Head times: 2.412s, 2.399s, 2.394s, 2.394s, 2.396s, 2.417s, 2.405s, 2.408s, 2.383s, 2.360s, 2.403s, 2.397s, 2.391s, 2.380s, 2.394s, 2.402s, 2.410s, 2.414s, 2.444s, 2.399s, 2.414s, 2.414s, 2.408s, 2.417s, 2.413s, 2.421s, 2.426s, 2.420s, 2.415s, 2.399s gatsby install-cache-and-lock (warm, with lockfile)
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))Base times: 0.353s, 0.348s, 0.350s, 0.352s, 0.349s, 0.352s, 0.352s, 0.352s, 0.349s, 0.352s, 0.355s, 0.353s, 0.355s, 0.356s, 0.355s, 0.357s, 0.350s, 0.357s, 0.354s, 0.355s, 0.384s, 0.345s, 0.350s, 0.346s, 0.347s, 0.385s, 0.376s, 0.355s, 0.364s, 0.345s Head times: 0.349s, 0.350s, 0.350s, 0.352s, 0.348s, 0.348s, 0.358s, 0.344s, 0.352s, 0.355s, 0.351s, 0.351s, 0.347s, 0.349s, 0.348s, 0.348s, 0.350s, 0.350s, 0.351s, 0.348s, 0.351s, 0.369s, 0.353s, 0.356s, 0.353s, 0.354s, 0.351s, 0.354s, 0.352s, 0.353s |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 328144f. Configure here.
Most Yarn commands now silently run installs under the hood when they detect the project isn't in sync compared to the last modification time of package.json. Only problem is that it's a little too silent and it may look like the command is unexpectedly hanging.
To address this we now display a spinner if the install takes more than 200ms.
Note
Medium Risk
Touches the async lazy-install control flow with a new
tokio::select!timing branch and threaded terminal output, which could affect install completion timing or terminal behavior in edge cases.Overview
Improves UX for
lazy_installby showing a spinner message ("Installing dependencies...") only when running in a TTY and the install hasn’t finished within ~200ms; non-terminal contexts still run silently.Refactors
lazy_installto pin the install future, race it against a short sleep viatokio::select!, start/stop astart_progressspinner around the remaining work, and updates the progress thread to flush immediately after hiding the cursor to make terminal state changes visible promptly.Reviewed by Cursor Bugbot for commit 328144f. Bugbot is set up for automated code reviews on this repo. Configure here.