Skip to content
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

fix(cli): reduce flicker in spinner render function #4835

Merged
merged 4 commits into from
May 23, 2024

Conversation

dsherret
Copy link
Member

No description provided.

@dsherret dsherret requested a review from kt3k as a code owner May 22, 2024 16:55
@github-actions github-actions bot added the cli label May 22, 2024
Comment on lines +145 to +148
const writeData = new Uint8Array(LINE_CLEAR.length + frame.length);
writeData.set(LINE_CLEAR);
writeData.set(frame, LINE_CLEAR.length);
Deno.stdout.writeSync(writeData);
Copy link
Contributor

Choose a reason for hiding this comment

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

An alternative using concat():

Suggested change
const writeData = new Uint8Array(LINE_CLEAR.length + frame.length);
writeData.set(LINE_CLEAR);
writeData.set(frame, LINE_CLEAR.length);
Deno.stdout.writeSync(writeData);
Deno.stdout.writeSync(concat([LINE_CLEAR, frame]));

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I missed that this was in a separate package. I'm not sure it's worth causing another package load to occur when importing this module.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

dsherret and others added 2 commits May 23, 2024 01:01
Co-authored-by: Asher Gomez <[email protected]>
Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 91.97%. Comparing base (d7424a2) to head (483d072).
Report is 9 commits behind head on main.

Files Patch % Lines
cli/spinner.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4835      +/-   ##
==========================================
- Coverage   91.97%   91.97%   -0.01%     
==========================================
  Files         486      487       +1     
  Lines       41459    41542      +83     
  Branches     5360     5365       +5     
==========================================
+ Hits        38131    38207      +76     
- Misses       3270     3277       +7     
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

It's no big deal omitting concat() for just two Uint8Arrays. LGTM.

@dsherret dsherret merged commit 42dc89c into denoland:main May 23, 2024
12 checks passed
@dsherret dsherret deleted the fix_cli_reduce_flickering branch May 23, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants