-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Swap chalk for turbocolor. #544
Conversation
@jorgebucaran The most important CI builds failed. This way your PR can't be merged. Please take a look at the CI results from travis (failure) and fix these issues. |
Hi @jorgebucaran, thanks for the attention and PR! I'm going to ask the team first, let me get back to you once we're decided! |
Hi @ev1stensberg, thanks sounds good :) |
Any comparison regarding the sizes of the packages? |
@ematipico I usually go to bundlephobia to find out:
|
@jorgebucaran any difference between the two packages? API wise ? |
@ev1stensberg Feature-wise chalk has more options, but webpack-cli is using none of them and some of those options are not widely supported by terminals. API-wise, they're virtually the same, but let's see one thing. Chalk supports variadic arguments like: console.log(chalk.red("Hello", "World")) ...whereas turbocolor is a unary function by design. (There are so many ways that console.log(color.red("Hello" + "World"))
// or
console.log(color.red("Hello %s"), "World")
// or
const name = "World"
console.log(color.red(`Hello ${name}`)) You can see all the features supported by turbocolor in the usage section. Hope that answers your question :) |
Hi @jorgebucaran. Just a little hint from a friendly bot about the best practice when submitting pull requests:
You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR. |
Hi @jorgebucaran . Me and my team have discussed a bit, and we don't really see the point of swapping chalk for another library. Chalk is stable and good enough for us as of this date. Thanks for the PR 👍 |
@ev1stensberg No problem! Cheers! |
Hello webpack-cli maintainers! 👋
This PR basically swaps chalk for Turbocolor.
What kind of change does this PR introduce?
Swaps one library for another that uses the same API, but it's lighter (no deps) and has significantly better load/runtime performance (~>20x faster).
Did you add tests for your changes?
Same tests pass, so should be good.
If relevant, did you update the documentation?
I did, is it good?
Summary
It should give you a small perf boost as turbocolor loads >20x faster and applies styles >18x faster than chalk for the same API (see benchmarks). Node.js >=v4 supported.
Does this PR introduce a breaking change?
No!
Let me know if this is acceptable to you and if I need to change anything. Cheers!