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
15.5 support #147
15.5 support #147
Conversation
@KamranAsif this is because react-docgen doesn't yet support create-react-class. I've opened an issue. In the meantime you can change the package.json entry for react-docgen to point to "git://github.com/wcjordan/react-docgen#create_react_class_support_dist" and it should work. It uncovers some other errors though. |
@@ -101,7 +101,7 @@ var FixedDataTableBufferedRows = createReactClass({ | |||
}, | |||
|
|||
_updateBuffer() { | |||
if (this.isMounted()) { | |||
if (this._rowBuffer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is a safe fix yet. The usage of isMounted scattered through seems scary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm it seems fine to me, but ya removing isMounted wherever possible sounds good.
Thanks for the fix @wcjordan! Ran codemods on some more files. I'm trying to get the site to run without any errors. |
My next step is to remove the isMounted calls from FixedDataTable.js These seem a bit scary to me. I think we can fix a lot of these by removing the scroll handler when the component unmounts. |
Sweet, this all looks good to me and removing unmount by removing the scroll handler sounds good. Consider this review lgtm'd and open a new one for the unmount change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @KamranAsif, I've tested your PR and it works! No more PropTypes
or createClass
warnings 🎉
Haven't noticed any issues. Please merge and release when you get a chance. Thanks for all your hard work 👍
props.stopScrollPropagation | ||
); | ||
|
||
this.setState(this._calculateState(props)); | ||
}, | ||
|
||
componentWillUnmount() { | ||
this._wheelHandler = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any risk of the onWheel still firing when we unmount? Or should we be okay since the DOM object is expected to be gone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will be an issue. React will automatically detach the scroll handler.
src/FixedDataTable.js
Outdated
@@ -368,6 +368,7 @@ var FixedDataTable = createReactClass({ | |||
this._onScroll, | |||
this._shouldHandleTouchX, | |||
this._shouldHandleTouchY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a comma at the end of this line, that's why the build is failing on TravisCI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will fix
@KamranAsif Looks like Node v4 tests failed because it couldn't find the |
Yeah I saw the issue. Right now I'm just super busy onboarding at a new company so I haven't found time to wrap this up |
No worries. Just trying to assist however I can. Thanks! |
package.json
Outdated
@@ -39,6 +39,7 @@ | |||
"null-loader": "^0.1.0", | |||
"postcss": "^4.0.2", | |||
"postcss-custom-properties": "3.0.1", | |||
"prop-types": "^15.5.8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this & create-react-class be dependencies? React-redux has them as such
https://github.com/reactjs/react-redux/blob/master/package.json
Also update react-docgen version & ExampleImage to not use isMounted
@KamranAsif I updated the dependencies to be non-dev & I fixed a usage of isMounted in ExampleImage. I think we should be ready to go if the tests pass. |
@wcjordan Actually..we don't list React or ReactDom as deps; instead as peer devs. Should these two be the same? |
I'm going merge this and push it out to unblock anyone |
The issue with having them as peer deps is a React 14 or 15.1 user might be using the library, upgrade and then blow up cause they don't include prop-types & create-react-class. The peer deps will warn them... but still I think it's better to bring them in ourselves. They're not big and I expect them to be stable so worst case we bundle a couple versions of them, it's not the end of the world. Also looking at and following react-redux's practice: |
Description
Adding support for React 15.5
I used the codemods to add support
I couldn't get the site to run though; I kept seeing this error:
@wcjordan could you check out this branch and give it a try?
Motiviations
#145
Types of changes
Checklist: