Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Start to modernize recompose (...) #826

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

brodybits
Copy link

@brodybits brodybits commented Feb 3, 2021

updated:

  • Switch to internal __createFactory function to resolve Remove usage of createFactory #806
  • Update some code to avoid one of the warnings in React 16.14.0
  • Update some dependencies (in devDependencies)
  • Some other minor updates

Some TODO items:

  • I would like to find a way to test the dist artifacts before updating the build-related dependencies.
  • I would like to support multiple rxjs versions.
  • Improve testing & support for multiple React versions
  • Ideally test with Preact as well
  • A number of dependencies are still outdated, some of which will likely need updates to the code base as well.

to avoid using the deprecated React.createFactory function

(and update .size-snapshot.json)

resolves acdlite#806
@brodybits brodybits changed the title Modernize recompose Start to modernize recompose (...) Feb 3, 2021
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
Copy link
Author

@brodybits brodybits left a 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() {
Copy link
Author

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.

Comment on lines +42 to 45
// TODO: componentWillReceiveProps method is not supported by React 17;
// UNSAFE_componentWillReceiveProps may not work with older React versions.
// Another solution is wanted.
componentWillReceiveProps(nextProps) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO item

Comment on lines +3 to +5
// 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) {
Copy link
Author

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.

Comment on lines +3 to 7
// 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)
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove usage of createFactory
1 participant