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

chore: swap color lib #1327

Merged
merged 2 commits into from Jun 19, 2020
Merged

chore: swap color lib #1327

merged 2 commits into from Jun 19, 2020

Conversation

lukeed
Copy link
Contributor

@lukeed lukeed commented Jun 19, 2020

Now uses the same, small color library as postcss (recently updated).
Made sure to use the same kleur/colors variant so that the same file is loaded/reused.

You were surprisingly using chalk@^2.4, which is/was a different version than the postcss@^7.0.30 range used, so users were juggling two copies of chalk in their dependency tree.

Performance numbers, comparing kleur/colors to chalk@2.4

# All Colors
  chalk@2.4        x  12,373 ops/sec ±2.19%
  kleur/colors     x 862,421 ops/sec ±0.19%

# Stacked colors
  chalk@2.4        x   2,690 ops/sec ±2.32%
  kleur/colors     x 103,509 ops/sec ±0.30%

# Nested colors
  chalk@2.4        x   5,882 ops/sec ±1.34%
  kleur/colors     x 143,956 ops/sec ±0.25%

@ai
Copy link
Member

ai commented Jun 19, 2020

Does it work on Node.js 6? https://github.com/lukeed/kleur/blob/master/package.json#L35

@lukeed
Copy link
Contributor Author

lukeed commented Jun 19, 2020

Yes, let me send a quick patch. I raised it to 10 because 6 is dead for a long time ... and I didnt want me CI cluttered 😇

@lukeed
Copy link
Contributor Author

lukeed commented Jun 19, 2020

Here are updated benchmark results running on Node 6.17.1

# All Colors
  chalk@2.4     x   8,155 ops/sec ±2.07% (82 runs sampled)
  kleur/colors  x 588,589 ops/sec ±0.87% (92 runs sampled)

# Stacked colors
  chalk@2.4     x  1,913 ops/sec ±2.04% (80 runs sampled)
  kleur/colors  x 79,234 ops/sec ±0.78% (93 runs sampled)

# Nested colors
  chalk@2.4     x   4,072 ops/sec ±1.19% (84 runs sampled)
  kleur/colors  x 160,093 ops/sec ±1.21% (91 runs sampled)

# Load time
  chalk: 18.526ms
  kleur/colors: 0.431ms

@ai ai merged commit b221f4a into postcss:master Jun 19, 2020
@ai
Copy link
Member

ai commented Jun 19, 2020

Released in 9.8.1

@lukeed lukeed deleted the chore/colors branch June 19, 2020 21:33
@lukeed
Copy link
Contributor Author

lukeed commented Jun 19, 2020

That was fast 😅 thank you!

@Jogai
Copy link

Jogai commented Jun 26, 2020

Well, that didn't last long: 255deab

@ai
Copy link
Member

ai commented Jun 26, 2020

Kleur is still very good. It was a subjective reasons for me to switch to colorette. They are both a good options.

@lukeed
Copy link
Contributor Author

lukeed commented Jun 26, 2020

Haha, was a matter of preference. Important part was that chalk is out

@lukeed
Copy link
Contributor Author

lukeed commented Jun 26, 2020

Dang you're fast

Dan503 pushed a commit to Dan503/autoprefixer that referenced this pull request Jul 11, 2020
* chore: swap color lib

* chore: bump version
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.

None yet

3 participants