dom-testing-library icon indicating copy to clipboard operation
dom-testing-library copied to clipboard

Replace `chalk` with `picocolors`

Open Fuzzyma opened this issue 1 year ago • 2 comments

Describe the feature you'd like:

I want to propose to replace the chalk dependency with the smaller and faster picocolors package. As part of the e18e initiative (ecosystem cleanup), we try to reduce the burden of old or big libs and modernize the ecosystem. Considering that chalk is used for exactly one style in the console output in this lib, it might be worthwhile to think about geeting rid of it at all :D. chalk alone accounted for a whopping 907.93 GB of traffic last month whenever it got installed as part of dom-testing-library. The tar size of 13.40Kb doesn't seem much (dom-testing-librarys tar is 434.14KB) but every bit counts :).

Suggested implementation:

Either use picocolor or inline the one styling you have. In your case it would be a full drop-in repacement.

I would be willing to create the PR for you

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

Fuzzyma avatar Nov 19 '24 19:11 Fuzzyma

Thanks @Fuzzyma for raising this. I'm open to reviewing a PR that either removes the library or replaces it with picocolors :)

MatanBobi avatar Nov 19 '24 19:11 MatanBobi

@MatanBobi there you go https://github.com/testing-library/dom-testing-library/pull/1341

I wasnt able to run the tests because I hit an error. Details in the PR

Fuzzyma avatar Nov 19 '24 20:11 Fuzzyma