Update the package using the clsx implementation?
See original GitHub issueclsx by @clsx provides an interesting improvement over the actual classnames
package implementation, it’s faster and lighter. He has done an awesome job!
However, given how popular classnames is and the relatively small performance improvement of clsx
compare to the other dependency we are dealing with (often ~10 kB gzipped & ~10k ops/s). I have some doubt about the advantage of migrating from classnames to clsx: https://github.com/mui-org/material-ui/pull/14152. It’s very likely that people will see classnames
and clsx
in their bundle, resulting in a negative outcome.
@JedWatson Do you have any plan updating this package implementation using clsx as inspiration? I think that it’s a path that would really benefit the React community. Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:17 (4 by maintainers)
Thanks for raising this @oliviertassinari
I’ve read through the
clsx
implementation and have some questions - it is probably faster because it does a lot less safety checks (e.g skipshasOwnProperty
andArray.isArray
in favour of detecting.push
on objects)Things like that make me concerned because although it’s faster and lighter, it’s pretty easy to imagine those shortcuts causing problems out there in the real world.
So I wouldn’t take the implementation directly but will see if any other optimisations can be made safely. If anyone else wants to suggest something please do.
As a side-note, someone kindly reached out to me and pointed out that I’ve been missing a bunch of notifications from this repo and it really deserves some love, so I’m fixing that ❤️
Oh i get the point right… Changes i’ve planned to make were equal to creating whole thing from scratch (codebases completely different).
So I’m wasting my time - while working i’m getting money for it, while open-source developing i’m getting… lets call it “the fame”.
If i’ll make a PR - i wont be in collaborators or elsewhere on front page, only in commits and PR history. If there wont be my name on it - it completely does not worth my time.
The point of opensource is to workfor credits, instead of money. Work for completely nothing even if you joy it… well… it’s quite stupid when you can have some benefit from it. Even if it wont work out - at least you’ve tried.