-
Notifications
You must be signed in to change notification settings - Fork 50.5k
Description
Coming in from the Twitters, at the behest of @gaearon. This is not meant to be a discussion about what Really counts a breaking change, or how to interpret Semver. Instead I just want to share a use-case and situation that has/is causing me pain using React v15.
I have a situation with an app that is stuck at v15.1 (Before Unknown DOM prop warning). Yes it's old, yes they should upgrade. There isn't always the time, bandwidth or business case to spend time quieting the warnings. Now with v15.5 out everyone is updating libraries and apps to use prop-types instead of React.PropTypes. The problem is that prop-types doesn't work on v15 below 15.3, you get 100s of "Don't Call PropTypes" warnings. There are two issues from my perspective with this situation.
From an app author
My options are to chose between which warning I want flooding the console, (Unknown prop, or Don't call PTs). Most libraries aren't considering the change to prop-types a major bump (reasonable!), so any feature and patch updates are getting rolled in with the prop-type fix. So To avoid warnings I need to pin all my react component libraries and miss out on bug fixes, or deal with warnaggedon until there is bandwidth to upgrade, everything to react@latest
From a library maintainer
This has been covered at length before, but the pressure to fix deprecation warnings in libraries immediately is real, and stressful. In this case the upgrade path for prop-types is super easy (thanks codemod!) so you do it and release. Without realizing it though you've actually just upped the minimal required react peer of your library to 15.3, since anything below that (>0.14) will warn forever. That's a tough spot to be in, while the swap of the dep is not a breaking change, changing the minimal React version required feels more like one.
What even do we do!
I don't know! It's a hard problem. For me tho I think a reasonable rule of thumb might be that a library using only public APIs should be able to support an entire major version of React without unfixable deprecation warnings. If React major versions happened faster I'd be for a introduce warnings on major bumps, and remove them on the next major bump. We do that in react-bootstrap and it's annoying and i'm impatient but it is a strategy that has worked out well for users. The system feels fair, and no one gets new warnings introduced accidentally by a fresh npm install.
Thanks ya'll overall warnings are great, I've always appreciated how much care and time React takes to tell me what's going on, and what I need to fix.