-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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: replace classnames with clsx #7245
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I honestly don't see a difference between the packages, 200B during build really isn't too much imo, but we'll see what other members say |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @RedYetiDev , I think I am in favor of using whatever is best for newcomers
Also, It would be nice to add why we use this utility package to COLLABORATOR_GUIDE
@@ -61,7 +61,7 @@ | |||
"@vercel/otel": "~1.10.0", | |||
"@vercel/speed-insights": "~1.1.0", | |||
"autoprefixer": "~10.4.20", | |||
"classnames": "~2.5.1", | |||
"clsx": "^2.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"clsx": "^2.1.1", | |
"clsx": "~2.1.1", |
IMO we should keep ~
; https://github.com/nodejs/nodejs.org/blob/main/DEPENDENCY_PINNING.md?plain=1#L23
I'm ambivalent about this change unless there is appreciable:
|
I feel like if I personally had a choice, I would choose
but those arguments aren't very persuasive, as 8k stars is still a lot, ditto for deps. |
You mean classnames is used by more people? |
Lighthouse Results
|
Yes. |
Description
clsx
is a drop-in replacement forclassnames
, a tad (~200B) smaller, and a bit more popular (overtook classnames 1.5 yr ago). A no brainer, really.Validation
The only errors could be me forgetting to change some
classnames
imports toclsx
(which would have triggered a lint error), or forgetting to update someclassNames()
calls toclsx()
(which would have triggered a lint error). So as long as ESLint is happy, I am too!Related Issues
Check List
npm run format
to ensure the code follows the style guide.npm run test
to check if all tests are passing.npx turbo build
to check if the website builds without errors.