Improve warning for React.createClass#9781
Conversation
src/isomorphic/React.js
Outdated
| 'Accessing createClass via the main React package is deprecated,' + | ||
| ' and will be removed in React v16.0.' + | ||
| " Use a plain JavaScript class instead. If you're not yet " + | ||
| 'ready to migrade, create-react-class v15.5.3 is available ' + |
There was a problem hiding this comment.
We can probably say v15 here because even if we release bugfixes we guarantee it's a drop in replacement anyway. And we want people to install fixes.
There was a problem hiding this comment.
Were there any issues with versions earlier than 15.3 though?
There was a problem hiding this comment.
Yes, probably. I just mean that we shouldn't give the impression that 15.5.3 is specific version to try because we know it's already broken (for AMD). We should recommend that they use the latest available 15.x version of create-react-class.
There was a problem hiding this comment.
Good point - will fix. Thanks!
src/isomorphic/React.js
Outdated
| ' and will be removed in React v16.0.' + | ||
| ' Use the prop-types package from npm instead.' + | ||
| ' Version 15.5.10 provides a drop-in replacement.' + | ||
| ' Use the latest available 15.* prop-types package from npm instead.' + |
There was a problem hiding this comment.
Let's use v consistently in the message — either v15 or we can drop v from "React v16".
trueadm
left a comment
There was a problem hiding this comment.
LGTM once Dan's comment about the message including "v" is added :)
petetnt
left a comment
There was a problem hiding this comment.
A small typo had snuck in 📝
src/isomorphic/React.js
Outdated
| 'Accessing createClass via the main React package is deprecated,' + | ||
| ' and will be removed in React v16.0.' + | ||
| " Use a plain JavaScript class instead. If you're not yet " + | ||
| 'ready to migrade, create-react-class v15.* is available ' + |
| 'Warning: Accessing createClass via the main React package is ' + | ||
| 'deprecated, and will be removed in React v16.0. ' + | ||
| 'Use a plain JavaScript class instead. ' + | ||
| "If you're not yet ready to migrade, create-react-class " + |
**what is the change?:** - Explain that this will be removed in v16.0 specifically - Mention the version number for the drop-in replacement module. - Link to docs in the blog post about how to migrate **why make this change?:** We want to make our deprecation warnings more clear and helpful. **test plan:** Visual inspection and `yarn test` **issue:** facebook#9398
**what is the change?:** Instead of recommending specific versions of 'prop-types' and 'create-react-class' we ask folks to use the latest available 15.* version. **why make this change?:** The latest version of those plugins, within the 15 version, is the most likely to be stable. For example, we know that 'react-create-class' is broken for AMD builds at the current latest version, so once we release a fix then the recommended version will change. **test plan:** Visual inspection Also fixed some tests.
**what is the change?:** - `migrade` -> `migrate` - `15.* prop-types package` -> `v15.* prop-types package` **why make this change?:** Correctness **test plan:** `yarn test` and visual inspection
59d2074 to
cf5aa32
Compare
* Improve warning for `React.createClass` **what is the change?:** - Explain that this will be removed in v16.0 specifically - Mention the version number for the drop-in replacement module. - Link to docs in the blog post about how to migrate **why make this change?:** We want to make our deprecation warnings more clear and helpful. **test plan:** Visual inspection and `yarn test` **issue:** facebook#9398 * Widen range of recommended replacement module versions **what is the change?:** Instead of recommending specific versions of 'prop-types' and 'create-react-class' we ask folks to use the latest available 15.* version. **why make this change?:** The latest version of those plugins, within the 15 version, is the most likely to be stable. For example, we know that 'react-create-class' is broken for AMD builds at the current latest version, so once we release a fix then the recommended version will change. **test plan:** Visual inspection Also fixed some tests. * Fix typos and things **what is the change?:** - `migrade` -> `migrate` - `15.* prop-types package` -> `v15.* prop-types package` **why make this change?:** Correctness **test plan:** `yarn test` and visual inspection

This might be the last PR to land for 15.6RC! 💫
what is the change?:
why make this change?:
We want to make our deprecation warnings more clear and helpful.
test plan:
Visual inspection and
yarn testissue:
#9398