Skip to content

refactor: replace colors with colorette#812

Merged
kjetilk merged 1 commit into
nodeSolidServer:developfrom
jorgebucaran:master
Oct 1, 2018
Merged

refactor: replace colors with colorette#812
kjetilk merged 1 commit into
nodeSolidServer:developfrom
jorgebucaran:master

Conversation

@jorgebucaran
Copy link
Copy Markdown
Contributor

👋 Hello maintainers.

Summary

This PR replaces colors with colorette. Disclaimer: I'm the author of colorette. This is a refactor change and does not intend to introduce breaking changes. Please let me know if this looks good or not and if you'd like me to make any changes.

Colorette is both lighter and faster than the colors packages. It's also "safe" by default, it doesn't mutate the string prototype. Terminal color support is autodetected, so our console output will not contain unreadable symbols if the target terminal does not support color.

Tests and coverage are at 100%.

Size Comparison

Package Size
colors install size
colorette install size

Runtime Performance

All tests run on a 2.4GHz Intel Core i7 CPU with 16 GB memory. Complete benchmark results here and implementation here.

# Using Styles
colors × 64,999 ops/sec
> colorette × 709,733 ops/sec

# Combining Styles
colors × 246,004 ops/sec
> colorette × 2,049,555 ops/sec

# Nesting Styles
colors × 144,403 ops/sec
> colorette × 389,825 ops/sec

Colorette is lighter and faster than the colors package.
It's also "safe" by default; it doesn't mutate the string
prototype. Terminal color support is autodetected, so our
console output will not contain unreadable symbols if the
target terminal does not support color.
@kjetilk
Copy link
Copy Markdown
Member

kjetilk commented Oct 1, 2018

OK, so my knee-jerk reaction was to get it into the next 5.0.0 release, and that's why I set base to that. But that was just a knee-jerk reaction, no particular opinion here. :-)

So, @RubenVerborgh you feel comfortable about merging it for a semver patch release that we do directly on develop?

@kjetilk kjetilk changed the base branch from master to develop October 1, 2018 14:32
@RubenVerborgh
Copy link
Copy Markdown
Contributor

@kjetilk It should just be a minor thing, no strong opinion.

@kjetilk kjetilk merged commit b35a04f into nodeSolidServer:develop Oct 1, 2018
@kjetilk
Copy link
Copy Markdown
Member

kjetilk commented Oct 1, 2018

OK, great! Thanks a lot @jorgebucaran , you're in! :-)

@jorgebucaran
Copy link
Copy Markdown
Contributor Author

Thank you, @kjetilk & @RubenVerborgh! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants