-
Notifications
You must be signed in to change notification settings - Fork 565
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
Update the package using the clsx implementation? #187
Comments
The lighter link should include the |
If we don't think of this as replacing a package with another one, I think the concept here is pretty uncontroversial right? As in if someone showed up to one of my libs with a PR that made the package smaller and faster without changing the public API in any way, I'd likely merge it in, unless it made the code siginficantly harder to maintain. In this case the existing code is already so minimal and fairly static at this point I don't think maintenance is a big concern, tho I won't presume for @JedWatson It's always weird and presumptuous when someone shows up to your project say we should replace something. I hope tho in this case it stikes us like that because the library is so small already. Obviously also this package is HEAVILY depended on so any change should be thought through :) |
It's easier for one project to go with something else, it's infinitely harder for the whole ecosystem to switch, which is what is required for there to be anything other than a net lose for most people Like if the problem here is maintaince lets see if anyone is willing to transfer ownership? All I'm getting it is the market share of this package is such that evolving it's going to far more effective in the outcome than the alternatives. At least worth exhausting those options yeah? I mean we are all looking for the same practical outcome :) |
There is also classcat package with the same purpose and benefits (size, speed, esm build, etc) so we might end up with bundles with |
@vladshcherbin classcat has a different API. I wouldn't consider it a viable option. |
@oliviertassinari yep, the api is different, but my point is same as yours - if there will be many packages with same purpose, a package creator can take any of them (depending on what google/npm/etc will give you first) so we might end up with bundles bloated with packages doing the same thing. It would be really nice to see this package updated with best solutions from other packages instead of being replaced by |
I don't see a problem here. Package authors should update to new major version of classnames (if it will be ever changed) or change it to clsx. In both cases you will get "bundle bloat". |
@vladshcherbin or cnbuilder same API with classnames, ESM build, size, and speed comparable or superios the classcat. |
@xobotyi Why did you created it? Why not contribute to clsx? Why pollute npm with one more package? |
They exist because classnames cannot accept new features and new distributions. We already tried. Nothing stopped you from talking with maintainer of clsx. |
@TrySound shit%) instead of "edit" pressed "delete" =\ for the history, my comment was:
The answer is because their authors thought that they creating something better than original lib.
|
You probably missed the point of open source. |
Oh i get the point right.. 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. |
Thanks for raising this @oliviertassinari I've read through the 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 ❤️ |
@JedWatson This sounds awesome! |
For people interested in performance, they might enjoy https://github.com/merceyz/babel-plugin-optimize-clsx. We are using it on Material-UI, it has yielded a nice free small bundle size reduction. |
clsx 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: mui/material-ui#14152. It's very likely that people will seeclassnames
andclsx
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.
The text was updated successfully, but these errors were encountered: