-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
chore: migrate to colorette
v2
#2965
Conversation
our tests failed, need to check |
Colorette, which is already being used, works exactly the same, what's the reason behind this change? |
@jorgebucaran better API |
It's the exact same API. jorgebucaran/colorette#70 |
@jorgebucaran no extra |
@alexander-akait Nope, that's incorrect. It's exactly the same API. Literally. |
hm, as I can see nanocolors is faster:
|
Those are loading benchmarks, measuring loading performance is tricky. Except for |
Are you sure, these benchmarks is very new and nanocolors wins |
Yes. Because nanocolors is essentially a copy of Colorette, the numbers tend to fluctuate. |
But time of startup is faster as you can see |
That was a result of importing chalk 14.422 ms
cli-color 111.140 ms
ansi-colors 2.554 ms
kleur 2.903 ms
kleur/colors 0.791 ms
colorette 0.754 ms
nanocolors 1.146 ms |
Now we have two same projects 😄 |
#2966 is using |
Running the benchmarks in a CI you'll see that measuring loading time is not worthwhile. Import order, top-level vs nanocolors 5.27ms
colorette 1.68ms
nanocolors 0.01ms
colorette 0.01ms
nanocolors 0.01ms
colorette 0.00ms nanocolors 10,468,299 ops/sec
colorette 10,637,481 ops/sec
nanocolors 10,497,637 ops/sec
colorette 10,494,131 ops/sec
nanocolors 10,463,827 ops/sec
colorette 10,266,131 ops/sec The idea that we are considering switching to nanocolors, essentially a dupe of Colorette that was published just a few days ago, is problematic and discouraging. Not in the true spirit of open-source software. |
I think we should stick with |
Yep, I vote for sticking with colorette too, been in active development since last few years and nanocolors feels like a copy |
nanocolors
colorette
v2
5f92b3d
to
2c0371f
Compare
const { green } = utils.colors.createColors({ useColor: utils.colors.isColorSupported }); | ||
|
||
return console.log(`[webpack-cli] ${green(val)}`); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very bad idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was now required for --no-color
support.
Codecov Report
@@ Coverage Diff @@
## master #2965 +/- ##
==========================================
- Coverage 95.13% 94.96% -0.17%
==========================================
Files 31 22 -9
Lines 1684 1650 -34
Branches 483 484 +1
==========================================
- Hits 1602 1567 -35
- Misses 82 83 +1
Continue to review full report at Codecov.
|
@jorgebucaran the new version has a very inconvenient api:
Maybe I am missing something? |
Does jorgebucaran/colorette#77 fix this? I can release a new patch right away. |
Yes, that would be helpful. Otherwise we will need to write some extra code. |
@webpack/cli-team I do big refactor our utils:
Also I will refactor loadConfig logic and processing options for better performance in the next PRs |
What kind of change does this PR introduce?
chore
Did you add tests for your changes?
Already present
If relevant, did you update the documentation?
No
Summary
Fix #2956
Fix #2955
migrate to
nanocolors
Does this PR introduce a breaking change?
No
Other information
No