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

Upgrade React 16.3.2 to React 16.4.1 #7393

merged 4 commits into from Jun 20, 2018


None yet
3 participants

Xyfi commented Jun 20, 2018


This PR updates react from version 16.3.2 to version 16.4.1.

Reason for this PR is because I would like to use react-test-renderer for testing components that use React's new forwardRef feature, which is not supported by enzyme. As you can read in the changelog for React 16.4, support for using react-test-renderer with forwardRef was added in this version.

Not being able to test components with forwardRef is currently blocking #6261.

Since this is a minor version bump no breaking changes are to be expected, and while testing this I did not encounter any unexpected behaviour.

How has this been tested?

The unit tests still work.


Types of changes

New feature.


  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@Xyfi Xyfi requested a review from WordPress/gutenberg-core Jun 20, 2018


I don't think we should be specifying version ranges with the caret.

@@ -44,12 +44,12 @@
"prop-types": "15.5.10",
"querystringify": "1.0.0",
"re-resizable": "4.4.8",
"react": "16.3.2",
"react": "^16.4.1",

This comment has been minimized.


tofumatt Jun 20, 2018


Why the change to using caret? Locking down package versions as tightly as possible is a good idea, so I think this should be changed to 16.4.1 over ^16.4.1.

"react-autosize-textarea": "3.0.2",
"react-click-outside": "2.3.1",
"react-color": "2.13.4",
"react-datepicker": "1.4.1",
"react-dom": "16.3.2",
"react-dom": "^16.4.1",

This comment has been minimized.


tofumatt Jun 20, 2018


Same here re: caret ranges.


This comment has been minimized.


Xyfi commented Jun 20, 2018

@tofumatt Ah yes, excuse me. I fixed it.


gziolo requested changes Jun 20, 2018 edited

There are a few more occurrences of old version of React in php files. We need to update them before we proceed.

@@ -0,0 +1,146 @@

This comment has been minimized.


gziolo Jun 20, 2018


This file should be removed. We don't want to maintain package lock files for individual packages. It's a bug with Lerna that it doesn't respect .npmrc file ... I observe that it happens where you run npm install when there are 2 different versions of the package in two package.json files.

@gziolo gziolo added the Framework label Jun 20, 2018

Xyfi added some commits Jun 20, 2018


gziolo approved these changes Jun 20, 2018

Code looks good, let me give it a spin locally.

It was addressed

@gziolo gziolo added this to the 3.1 milestone Jun 20, 2018


This comment has been minimized.


gziolo commented Jun 20, 2018

Sidenote: we probably should start using react-test-renderer more instead of Enzyme, because of all the issues Enzyme caused by not keeping up to date with React releases.

@gziolo gziolo merged commit c6cbfb0 into master Jun 20, 2018

2 checks passed

codecov/project 46.86% (-0.01%) compared to 5851831
continuous-integration/travis-ci/pr The Travis CI build passed

@gziolo gziolo deleted the update/react-16.4.1 branch Jun 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment