Update: We just shipped 15.6.0 of react
& react-dom
! :)
Still ongoing;
React.addons
and the 15.6.0 release of those modules.React.addons
fixes:prop-types
library and check other add-ons for deprecation warnings. Release new versions. (https://github.com/facebook/prop-types/pull/63)Steps we went through for React 15.6.0;
Done! RC was released.
PropTypes.checkPropTypes
rather than inlining it (like we did in 15.5)React.DOM.stuff
to React.createElement('stuff'
console.error
to console.warn
for deprecation noticesprop-types
library and check other add-ons for deprecation warnings. Release new versions.15-stable
were also cherry-picked to 15.6-dev
. (https://github.com/facebook/react/pull/9889)react-dom-factories
package to be named that consistently, and avoid react-addons-dom-factories
. (https://github.com/facebook/react/pull/9780)react-dom-factories
on npm.
Done! React 15.6.0 is out.
Done! React 15.6.0 is out.
Deprecate React.DOM Factories
For reference, there is existing work on this at https://github.com/facebook/react/pull/8356
Can we remove junk code from PropTypes prod build? It doesn't use bundle-collapser so it ships all those method names (e.g. “fbjs/lib/invariant”). This is fixable if you add “-p bundle-collapser/plugin” to browserify call. Additionally, there seems to be some junk invariant() code which is easy to fix if we just turn this into an inlined error. https://unpkg.com/[email protected]/prop-types.min.js
I created an issue for this in the new prop-types
repo: https://github.com/reactjs/prop-types/issues/16
Are we encouraging people to stop using createClass? What about PropTypes? Are we deprecating them as in “they're bad” (nope) or are we just moving them (yes)? Make it clearer.
You'll want to be crystal clear about this. In other projects where they've removed stuff like this, it usually means a death sentence for those features (Responders in Rails come to mind). The important part is noting that those features aren't going away, just how you access them is changing. Maybe drop the "depreciation" wording and replace it with "moving"? And that's not because you're not deprecating those imports, but it's about the kind of message you want to send.
👍 on not calling it "deprecation". The common intuition for "deprecated" is "stuff that we're no longer maintaining and only keeping around to avoid API incompatibilities, and you shouldn't use it anymore" (see https://en.wikipedia.org/wiki/Deprecation#Software_deprecation). "Moving" sounds a bit better.
Awesome suggestions by @flarnie, happy to see that more of the bullet points touch communication topics which are way more difficult to embrace than technical stuff sometimes when managing a library that a lot of people uses.
Though I like warnings, I don't know if I prefer the red and error look of a deprecation to catch better the developer's attention.
Awesome suggestions by @flarnie, happy to see that more of the bullet points touch communication topics which are way more difficult to embrace than technical stuff sometimes when managing a library that a lot of people uses.
I completely agree. I think it's especially difficult since most of the React team's core decisions are made via internal discussions at FB, and there hasn't been a sustained effort to communicate these to the OSS community.
I would love to see some work towards making this less opaque (maybe start publishing meeting notes again?), both for consumers, library maintainers, and contributors to the project.
Though I like warnings, I don't know if I prefer the red and error look of a deprecation to catch better the developer's attention.
This is a complete hack and totally should not be what actually is done here, but you can sorta do that with console message styles:
Silly, but it could be an idea to pursue to make them visually distinct.
Unfortunately won't work in other browsers or Node afaik.
"Where does proptypes doc live? It's confusing it's still on React object but inaccessible from the website through search or table of contents. Let's either reinstantiate it or move it fully to the standalone repo. Also it's confusing we're deprecating createClass but it still lives in the docs ("React without ES6") whereas we're just "moving" PropTypes but they're gone from the docs."
Regarding downgrading 'deprecation' warnings in add-on packages:
I think we could consider "Update deprecation in prop-types library and check other add-ons for deprecation warnings. Release new versions." done, wondering what you think @gaearon
Why doesn’t TransitionGroup have a deprecation warning? Let’s add if we forgot it. Make sure the wording says “moved” since moving is all that happened.
It looks like we never added "moved" warnings for any of the React.addons.<something>
utilities. Since all of these were either moved or deprecated, I'm adding messages for them in this release. Hopefully that is what you meant @gaearon
In the prop-types package the warning is for a syntax that will throw so I prefer we not downgrade it.
Any removed APIs would throw too so I don’t think this makes it different. Additionally most occurrences of this warning are false positives caused by mismatching version of React. I don’t think I’ve ever seen code relying on that pattern in practice. So I’d prefer we make it quieter.
It looks like we never added "moved" warnings for any of the React.addons.
utilities. Since all of these were either moved or deprecated, I'm adding messages for them in this release.
Hmm, I'm sorry I was unclear. This is not what I meant.
When I was talking about deprecating TransitionGroup
I meant two entry points specifically:
react-addons-transition-group
react-addons-css-transition-group
These two entry points (specifically the npm ones) should print a deprecation message because they will break in 16. Unlike other react-addons-
packages, they are importing from react/lib/
which will be gone. But, for example, react-addons-update
will keep on working in 16.
Now, as for React.addons.*
, it’s a separate discussion. I think it would make sense to deprecate React.addons.*
for those addons that require changes in code, but for example React.addons.update
would still work with the UMD build we made specifically for update()
. I’d probably postpone deprecating React.addons.*
getters until 15.7 because I’m not sure how to approach it well.
react-transition-group doesn't have deprecation warnings (should it?)
It shouldn’t—it’s the replacement we’re promoting for these two packages. Instead of react-addons-transition-group
and react-addons-css-transition-group
that reach into React internals, people should use react-transition-group
which doesn’t.
We should also ideally get some version of https://github.com/facebook/react/pull/9761 in. As it stands, create-react-class
is completely botched in AMD environments.
"Any removed APIs would throw too so I don’t think this makes it different." That's true. I had thought for some reason that it would throw in 15.5.* but that doesn't make sense. So we:
prop-types
react-addons-transition-group
and react-addons-css-transition-group
"I’d probably postpone deprecating React.addons.* getters until 15.7 because I’m not sure how to approach it well." -> Sounds good, we can revisit https://github.com/facebook/react/pull/9758#pullrequestreview-39986493 later then.
https://github.com/facebook/react/pull/9806 should be safe to cherry-pick. @flarnie would you like me to do that?
Did that yesterday before I saw your comment @nhunzaker - thanks!
Closing this now - if any work remains around changes from v15.6.* we should open new issues for that.
🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸
Thanks @gaearon @nhunzaker @bvaughn @aweary @acdlite and everyone who helped out with this process.
🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸⚡🎆🎸
Onward towards 16.0!~~~~ 😁
Most helpful comment
You'll want to be crystal clear about this. In other projects where they've removed stuff like this, it usually means a death sentence for those features (Responders in Rails come to mind). The important part is noting that those features aren't going away, just how you access them is changing. Maybe drop the "depreciation" wording and replace it with "moving"? And that's not because you're not deprecating those imports, but it's about the kind of message you want to send.