-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Start to modernize recompose (...) #826
base: master
Are you sure you want to change the base?
Conversation
to avoid using the deprecated React.createFactory function (and update .size-snapshot.json) resolves acdlite#806
and update Jest config with setupFilesAfterEnv
and update eslint-disable & eslint-enable comments with TODO comments in src/packages/recompose/utils/mapValues.js due to an issue with recent eslint versions
and disable react/default-props-match-prop-types in one place in src/packages/recompose/__tests__/toClass-test.js
- eslint-plugin-import -> ^2.22.1 - eslint-plugin-jsx-a11y -> ^6.4.1
and disable jsx-a11y/label-has-associated-control in one test in src/packages/recompose/__tests__/withHandlers-test.js
override componentDidMount instead of componentWillMount lifecycle method in order to avoid one of the warnings coming from React 16.14.0 and (hopefully) continue to work with older React versions and add a TODO comment
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.
Making note of some TODO items
@@ -29,7 +29,7 @@ export const componentFromStreamWithConfig = config => propsToVdom => | |||
// Stream of vdom | |||
vdom$ = config.toESObservable(propsToVdom(this.props$)) | |||
|
|||
componentWillMount() { | |||
componentDidMount() { |
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 am not sure if this change, which is probably the safest way to support multiple React versions and forks, could lead to potential loss of optimization or any other potential issues.
// TODO: componentWillReceiveProps method is not supported by React 17; | ||
// UNSAFE_componentWillReceiveProps may not work with older React versions. | ||
// Another solution is wanted. | ||
componentWillReceiveProps(nextProps) { |
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.
TODO item
// NOTE: This is intended to be an internal utility for now, may be | ||
// unit-tested, documented, and exported by the API in the future. | ||
export default function __createFactory(c) { |
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 think it would be nice to export and document this in the API.
// TODO: no-unused-vars seems to trigger a issue in recent eslint versions | ||
/* eslint-disable no-restricted-syntax, no-unused-vars */ | ||
for (const key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
result[key] = func(obj[key], key) |
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 would like to find a nicer, cleaner solution for this without potentially breaking ES5 consumers.
updated:
createFactory
#806Some TODO items:
dist
artifacts before updating the build-related dependencies.