Skip to content

refactor(cli/unstable): remove previousTime and previousValue #6660

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: main
Choose a base branch
from

Conversation

timreichen
Copy link
Contributor

I don't see why they should be provided by the formatter object.
These values can easily be stored and accessed in variables as is demonstrated in the test that is removed.

@timreichen timreichen requested a review from kt3k as a code owner May 20, 2025 13:35
@github-actions github-actions bot added the cli label May 20, 2025
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.71%. Comparing base (e10c71a) to head (d3fc89c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6660      +/-   ##
==========================================
- Coverage   94.71%   94.71%   -0.01%     
==========================================
  Files         567      567              
  Lines       46778    46770       -8     
  Branches     6582     6582              
==========================================
- Hits        44305    44297       -8     
  Misses       2431     2431              
  Partials       42       42              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BlackAsLight
Copy link
Contributor

I don't agree with this change as these values are needed if one wants the progress bar to display the rate of progress being made. Forcing users to create additional variables to achieve this seems like a bad design choice.

@timreichen
Copy link
Contributor Author

I don't agree with this change as these values are needed if one wants the progress bar to display the rate of progress being made. Forcing users to create additional variables to achieve this seems like a bad design choice.

Could you give an example how that would look like? I compared it to cli-progress which doesn't provide previous values in formatter, so I thought this is probably very niche.

@BlackAsLight
Copy link
Contributor

Could you give an example how that would look like? I compared it to cli-progress which doesn't provide previous values in formatter, so I thought this is probably very niche.

A rate like x mb/s. Essentially these values makes it easy for you to communicate the speed at which progress is being made.

[===-------] [2 MiB/s]

@timreichen
Copy link
Contributor Author

Could you give an example how that would look like? I compared it to cli-progress which doesn't provide previous values in formatter, so I thought this is probably very niche.

A rate like x mb/s. Essentially these values makes it easy for you to communicate the speed at which progress is being made.

[===-------] [2 MiB/s]

Ah, I see. Would it make sense to have the speed as a separate property instead the need to calculate it by hand?
Maybe a delta that can be formatted into a unit?
[${formatUnit(delta)}/s]?
I think std would profit by a public UnitFormatter anyway.

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.

2 participants