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

Migrate to new API in Colorette 2.0.x #2955

Closed
kibertoad opened this issue Sep 18, 2021 · 5 comments · Fixed by #2965
Closed

Migrate to new API in Colorette 2.0.x #2955

kibertoad opened this issue Sep 18, 2021 · 5 comments · Fixed by #2965

Comments

@kibertoad
Copy link

Currently webpack-cli relies on modifying global state, which potentially results in affecting other parts of the code that might rely on Colorette as well.

Describe the solution you'd like

jorgebucaran/colorette#70

Additional context

You can see how we migrated pino-pretty to a new API here: pinojs/pino-pretty#230

@alexander-akait
Copy link
Member

alexander-akait commented Sep 18, 2021

PR welcome, should not be hard to migrate

Note for me: need do it in webpack-dev-server too

@kibertoad
Copy link
Author

On it.

@ai
Copy link

ai commented Sep 21, 2021

If you do not want to add createColors call (colorette new API requires this call, exports like red do not have color auto-detection anymore) you can use nanocolors.

The same 0 dependencies, same colorette 1.x API, better loading time (benchmark). nanocolors will be used in PostCSS, Autoprefixer, and Browserslist if you want to sync tools and reduce node_modules size a little.

@alexander-akait
Copy link
Member

Yep, sounds good too

@ai
Copy link

ai commented Sep 21, 2021

I can prepare PR tomorrow to compare code changes

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

Successfully merging a pull request may close this issue.

3 participants