-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
removing usage of componentWillReceiveProps #3487
Conversation
PS: This obviously implies that |
@JedWatson can we get the ball rolling on this? This warning is making me sad |
This is why we try to minimize our dependency footprint. Have to either keep a library up to date or give it up for someone else to maintain. We'll probably abandon this and build our own unfortunately. I need libraries to be clean in the logs so I can find real app errors that need attention. |
Rebased. |
If someone forks this and publishes to npm I'll give them $10 and a GitHub star |
There you go: https://www.npmjs.com/package/@saboya/react-select Have no idea if this actually works correctly, but give it a shot. |
LMAO let me try this out. Send me your venmo |
@saboya |
@saboya does this fix look correct to you? If so, I'll merge and publish, and you can update your deps |
@ranneyd Just published version |
@saboya still getting the error Use mine: |
Thanks for the PR @saboya We've now comprehensively fixed the warnings with new releases of react-select and its other dependencies so they should go away now. In terms of merging this change, I'm not confident that it's tested sufficiently and don't think the refactor is worth the risk of potentially breaking people's usage of the component without a major version bump. We're looking into a refactor with hooks that should simplify the internal implementation considerably and that would be released as 4.0 through the same alpha / beta / stable release process we used for v2 so we can ensure minimal risk and impact on the community. Up to you @ranneyd and @saboya if you want to continue maintaining those forks, we're currently merging a bunch of other fixes into master at the moment 🙂 |
p.s some other context on why I'm wary of this from #3191
This logic in the current version of react-select is really stable and I'm really hesitant to risk that unnecessarily. It takes a huge amount of work to safely maintain a component that gets over 1.6m downloads a week, and while there are a lot of issues and PRs that come in, literally millions of people use it without a problem and ensuring stability is a really high priority. It can take up to half an hour and sometimes several people to review each issue and PR that comes in, even if they look simple, so it's a considerable labour of love maintaining this library. With all respect here, "haven't done a lot of testing but it seems fine when clicking around the dev server" isn't actually something I can merge without putting in a bunch of time making sure I've thought through and caught any unexpected implications of this kind of change. Feedback on PRs like "I've reviewed this and it's safe because A B C, I've tested it thoroughly against use cases X Y Z" or "if we merge this and release it I'm happy to be on call to help triage and fix any issues it may cause" is the most helpful thing anyone can do for an open source project like this - because that's the responsibility the core maintainers take for this project. Hope that provides some human insight into what's going on behind the scenes. |
@JedWatson thanks for the thoughtful response. As far as "maintaining those forks" my plan was always to use a fork until an official patch was in. I've been using this library for a couple of years now and I swear by it, and I'm really appreciative of y'all making and maintaining it. A few things I've learned about this issue since my original comments (which is a decent amount since this issue is pervasive across a ton of different open source projects out there) (also probably not relevant to you or this lib because the problems are already fixed, but for anyone who's watching this thread or stumbles upon this later):
Thanks for responding and taking the issue seriously. I'll be switching back to the official lib tomorrow. |
@JedWatson I appreciate the thoughtful response. I personally don't care too much if this gets merged or not, it's not my project and I can always maintain a fork if I want to, that's what open source is all about. I made this PR when I was working on a project with Now, regarding my "testing": I've used this code in production at the time, and it worked fine, and I used a lot of features. Now, I must say "With all respect here", if the tests written for the package aren't enough to ensure correct functionality, I'm not sure what's going to be sufficient to get anything merged. This is a rather simple change and the logic itself should not be too complex to analyze, regardless of tests. It's your project and your burden to maintain, and I respect the skepticism to ensure the users don't get a borked release, but I don't appreciate the attitude towards what I consider a meaningful contribution. Thanks for your efforts maintaining this popular package. |
Hey @saboya My apologies for the way my comments sounded to you, and especially for the attitude you heard in my comments about testing. I truly did not intend for them to have that impact on you personally, or to reflect poorly on your contribution (which despite the conversation above or whether it gets merged, I truly do appreciate) The additional context of using this code in production (and the number of feature you are using) does make a difference to how the PR is reviewed. That's what I meant to convey in my p.s. In the hope of providing helpful feedback, the original description of the PR, specifically:
... didn't give me the confidence to easily push this through without digging in further. I also meant to give anyone following or participating in this conversation the context of why it's not just "the maintainers clicking a few buttons" as was mentioned on another issue. But I didn't mean to undermine or dismiss your contribution itself, so again - I'm sorry that happened. re: testing and confidence, we have extensive unit tests and cypress coverage, but there are still performance and caching mechanisms (or creative approaches to managing side effects, especially with regards to focus handling) that the core lifecycle methods currently handle in a very nuanced way. I'm sure they can be refactored safely. It's just also a specific area of the code that I'd want to think through and review very carefully to make sure the impact of changes are well understood. In hindsight that could be called out better or be given as feedback earlier in the review process; I absolutely wear that point. Also @ranneyd's feedback about how we could have addressed this before it became a problem for users; that's fair.
This ended up being the safest approach, and makes sense given we're looking into using hooks to better encapsulate the complexity of react-select's behaviour, so that's what we've done for now. |
Removes usage of
componentWillReceiveProps
and usesgetDerivedStateFromProps
instead.Haven't done a lot of testing on this but passes all tests and seems fine when randomly clicking around in the dev server.
Fixes these, and probably some others:
#3374
#3191
#2277