Skip to content
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

Fixes #23690 - update react to 16.3 #5651

Merged
merged 1 commit into from Jun 13, 2018
Merged

Conversation

amirfefer
Copy link
Member

@amirfefer amirfefer commented Jun 5, 2018

React 16.3 updates its lifecycle methods, and deprecated

  • componentWillMount
  • componentWillReceiveProps
  • componentWillUpdate

Katello uses the new getDerivedStateFromProps lifecycle method.
Also, react-patternfly 2.5.1 uses react 16.3.1 as a peer dependency

@theforeman-bot
Copy link
Member

Issues: #23690

@@ -9,10 +9,10 @@ import BreadcrumbSwitcherPopover from './BreadcrumbSwitcherPopover';
import BreadcrumbSwitcherToggler from './BreadcrumbSwitcherToggler';

class BreadcrumbSwitcher extends React.Component {
componentWillReceiveProps(nextProps) {
Copy link
Member Author

Choose a reason for hiding this comment

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

componentWillReceiveProps is depracted, according to react documentations:

...This (componentDidUpdate) is also a good place to do network requests as long as you compare the current props to previous props

@waldenraines
Copy link

I believe we need this for 1.18 and will also need the relevant packages built.

@mmoll
Copy link
Contributor

mmoll commented Jun 5, 2018

I believe we need this for 1.18

Why?

@waldenraines
Copy link

Why?

Because it fixes an issue in katello which is dependent on the version defined here. @amirfefer please correct me if I'm wrong.

@amirfefer
Copy link
Member Author

@waldenraines
You are correct, as long as Katello will use the new subscriptions page in the upcoming version.
so in order that we won't have two distinct react versions, I think we need it on 1.18

Copy link
Member

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ekohl
Copy link
Member

ekohl commented Jun 7, 2018

We have multiple libraries that are used which have a peerDependency that isn't satisfied or worse: an actual dependency on react that wouldn't be satisfied. It'd be nice if we also looked into that and provided upstream patches where needed.

@amirfefer
Copy link
Member Author

[test foreman]

@waldenraines
Copy link

[test katello]

@ohadlevy
Copy link
Member

@ekohl do you have that list handy? I tried running it myself:

 npm i                                                                                                                                                git:(5651|… 

> TheForemanDevDeps@1.19.0 postinstall /home/ohad/git/foreman
> node ./script/npm_install_plugins.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.0 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 84 packages from 63 contributors in 14.007s

and as you can see I didn't get any warning? IMHO regardless, we should merge this.
since this is required for backporting I am ok with merging as is, but imho we should merge to latest version of react which is already at 16.4.

@ekohl
Copy link
Member

ekohl commented Jun 12, 2018

@ekohl do you have that list handy?

Not at the moment. I'll have a look later.

I should note that I had some issues with packaging this. npm2rpm didn't understand the dependencies of d3 and I haven't had time to look into why. For some reason it can't figure out what the correct URL to download the tarballs from. There's probably some library that could do a better job than our manual way.

@ohadlevy
Copy link
Member

@ekohl I'm not sure I understand exactly the issue you are facing? I can't imagine that react y upgrade would relate to d3?

@ekohl
Copy link
Member

ekohl commented Jun 12, 2018

@ohadlevy it looks like I wasn't quite awake and mixing up react and patternfly. Apologies.

@ohadlevy
Copy link
Member

@ekohl mind approving then? :)

@waldenraines
Copy link

@ekohl mind approving then? :)

Or @tstrachota? Would like to get this merged soon so I can merge the associated katello PR Katello/katello#7429.

@@ -75,10 +75,10 @@
"patternfly": "^3.42.0",
"patternfly-react": "^2.3.3",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react": "^16.3.1",
Copy link
Member

@ekohl ekohl Jun 13, 2018

Choose a reason for hiding this comment

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

This also allows react 16.4.0 which has been released. Should I package that or did you intend ~16.3.1?

Copy link
Member Author

Choose a reason for hiding this comment

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

I intended 16.3.1, but I don't mind to package 16.4.0

Copy link
Member

Choose a reason for hiding this comment

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

If it stays ^16.3.1 then I'll package 16.4.0 since that's what Travis will also install while testing.

@tbrisker tbrisker added this to the 1.18.0 milestone Jun 13, 2018
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

theforeman/foreman-packaging#2649 is for react. react-dom is already 16.4.0.

@ohadlevy ohadlevy merged commit c50b21e into theforeman:develop Jun 13, 2018
@tbrisker
Copy link
Member

if we need this in 1.18-stable please open a CP PR

@tbrisker tbrisker removed this from the 1.18.0 milestone Jun 14, 2018
@waldenraines
Copy link

if we need this in 1.18-stable please open a CP PR

@amirfefer do you mind handling this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants