This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Start to modernize recompose (...) #826
Draft
brodycj
wants to merge
22
commits into
acdlite:master
Choose a base branch
from
brodysoft:modernize-recompose
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3d6131a
chore: update yarn.lock after fresh install (on macOS)
brodycj da77244
refactor: switch to internal __createFactory function
brodycj 84e3f78
chore: update jest -> ^26.6.3 --dev (...)
brodycj e2ea65f
chore: update & pin prettier -> ~1.5.3 --dev
brodycj ce74e53
chore: update eslint -> ^7.19.0 --dev (...)
brodycj ceb711f
chore: update eslint-config-prettier -> ^7.2.0 --dev
brodycj 3092419
chore: update eslint-plugin-prettier -> ^2.7.0 --dev
brodycj 300b168
chore: update eslint-plugin-react -> ^7.22.0 --dev (...)
brodycj bbdd35c
chore: update 2 more eslint plugins --dev (...)
brodycj f67f03b
chore: update eslint-config-airbnb -> ^17.1.1 --dev (...)
brodycj f4b7288
chore: update create-react-class -> ^15.7.0 --dev
brodycj ccc3e6b
chore: update enzyme -> ^3.11.0 --dev
brodycj 3ccfaff
chore: update enzyme-adapter-react-16 -: ^1.15.6 --dev
brodycj 2dce1b0
chore: udpate flyd -> ^0.2.8 --dev
brodycj b4f5c5e
chore: update kefir -> ^3.8.8 --dev
brodycj bb173fa
chore: update most -> ^1.9.0 --dev
brodycj 9d21077
chore: update prop-types -> ^15.7.2 --dev
brodycj def67c0
chore: update React devDependencies -> ^16.14.0
brodycj f15cbf0
refactor: override componentDidMount in componentFromStream
brodycj a300ebf
chore: update baconjs -> ^1.0.1 --dev
brodycj a4489f1
chore: update rxjs -> ^5.5.12 --dev
brodycj ece4cf4
chore: update sinon -> ^9.2.4 --dev
brodycj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ export const componentFromStreamWithConfig = config => propsToVdom => | |
// Stream of vdom | ||
vdom$ = config.toESObservable(propsToVdom(this.props$)) | ||
|
||
componentWillMount() { | ||
componentDidMount() { | ||
// Subscribe to child prop changes so we know when to re-render | ||
this.subscription = this.vdom$.subscribe({ | ||
next: vdom => { | ||
|
@@ -39,6 +39,9 @@ export const componentFromStreamWithConfig = config => propsToVdom => | |
this.propsEmitter.emit(this.props) | ||
} | ||
|
||
// TODO: componentWillReceiveProps method is not supported by React 17; | ||
// UNSAFE_componentWillReceiveProps may not work with older React versions. | ||
// Another solution is wanted. | ||
componentWillReceiveProps(nextProps) { | ||
Comment on lines
+42
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO item |
||
// Receive new props from the owner | ||
this.propsEmitter.emit(nextProps) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createElement } from 'react' | ||
|
||
// 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) { | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
// as described in: | ||
// - https://reactjs.org/blog/2020/02/26/react-v16.13.0.html | ||
return createElement.bind(null, c) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
const mapValues = (obj, func) => { | ||
const result = {} | ||
/* eslint-disable no-restricted-syntax */ | ||
// 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) | ||
Comment on lines
+3
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
} | ||
/* eslint-enable no-restricted-syntax */ | ||
// TODO: see above comment regarding no-unused-vars | ||
/* eslint-enable no-restricted-syntax, no-unused-vars */ | ||
return result | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.