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

Update React to 16.3 #18768

Merged
merged 4 commits into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
"proxy-from-env": "1.0.0",
"querystring-browser": "1.0.4",
"raw-loader": "0.5.1",
"react": "^16.2.0",
"react": "^16.3.0",
"react-addons-shallow-compare": "15.6.2",
"react-anything-sortable": "^1.7.4",
"react-color": "^2.13.8",
"react-dom": "^16.2.0",
"react-dom": "^16.3.0",
"react-grid-layout": "^0.16.2",
"react-input-range": "^1.3.0",
"react-markdown": "^3.1.4",
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ module.exports = {
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
Copy link
Member

Choose a reason for hiding this comment

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

Not related to the React bump but thought I'd put it here:
Are we still trying to follow airbnb's convention (with minor modifications) or do we see our style guide as very different?

If we still intent to follow airbnb style, wouldn't it be nicer if we extended their rules? Their react rules look pretty similar:
https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js

// Off as of React 16.3, see https://github.com/yannickcr/eslint-plugin-react/issues/1754
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be a good thing to add:

{
  "settings": {
    "react": {
      "version": "16.3"
    }
  }
}

It sounds like the solution upstream may be to noop those rules based on the React pragma version.

Seems like the actionable thing to do here is, when the React version pragma is >= v16.3, these rules should no-op.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added that react version to the .eslintrc config in Kibana, since the eslint-config-kibana actually doesn't have any knowledge about the React version Kibana is using.

'react/no-did-mount-set-state': 'off',
'react/no-did-update-set-state': 'off',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason these need to be set to off and not just removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I thought we extend the recommended config, but since we didn't we can simply remove them :-)

'react/no-will-update-set-state': 'error',
'react/no-is-mounted': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@elastic/eslint-config-kibana",
"version": "0.15.0",
"version": "0.16.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you're publishing this to NPM, please don't increment the version number

"description": "The eslint config used by the kibana team",
"main": ".eslintrc.js",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`renders KuiListingTable 1`] = `
class="kuiToolBarSearchBox__input"
placeholder="Search..."
type="text"
value=""
/>
</div>
</div>
Expand All @@ -41,7 +42,6 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select all rows"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</th>
Expand Down Expand Up @@ -81,7 +81,6 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down Expand Up @@ -117,7 +116,6 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down Expand Up @@ -153,7 +151,6 @@ exports[`renders KuiListingTable 1`] = `
aria-label="Select row"
class="kuiCheckBox"
type="checkbox"
value="on"
/>
</div>
</td>
Expand Down
4 changes: 2 additions & 2 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@
"pngjs": "3.3.1",
"prop-types": "^15.6.0",
"puid": "1.0.5",
"react": "^16.2.0",
"react": "^16.3.0",
"react-clipboard.js": "^1.1.2",
"react-dom": "^16.2.0",
"react-dom": "^16.3.0",
"react-markdown-renderer": "^1.4.0",
"react-portal": "^3.2.0",
"react-redux": "^5.0.5",
Expand Down
20 changes: 19 additions & 1 deletion x-pack/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6051,7 +6051,7 @@ react-datepicker@v1.4.1:
react-onclickoutside "^6.7.1"
react-popper "^0.9.1"

react-dom@^16.0.0, react-dom@^16.2.0:
react-dom@^16.0.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044"
dependencies:
Expand All @@ -6060,6 +6060,15 @@ react-dom@^16.0.0, react-dom@^16.2.0:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-dom@^16.3.0:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.2.tgz#cb90f107e09536d683d84ed5d4888e9640e0e4df"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

react-input-autosize@^2.1.2, react-input-autosize@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.1.tgz#ec428fa15b1592994fb5f9aa15bb1eb6baf420f8"
Expand Down Expand Up @@ -6217,6 +6226,15 @@ react@>=0.13.3, react@^16.2.0:
object-assign "^4.1.1"
prop-types "^15.6.0"

react@^16.3.0:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

reactcss@^1.2.0:
version "1.2.3"
resolved "https://registry.yarnpkg.com/reactcss/-/reactcss-1.2.3.tgz#c00013875e557b1cf0dfd9a368a1c3dab3b548dd"
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10280,6 +10280,15 @@ react-dom@^16.0.0, react-dom@^16.2.0:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-dom@^16.3.0:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.2.tgz#cb90f107e09536d683d84ed5d4888e9640e0e4df"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

react-draggable@3.x, "react-draggable@^2.2.6 || ^3.0.3":
version "3.0.5"
resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-3.0.5.tgz#c031e0ed4313531f9409d6cd84c8ebcec0ddfe2d"
Expand Down Expand Up @@ -10491,6 +10500,15 @@ react@>=0.13.3, react@^16.2.0:
object-assign "^4.1.1"
prop-types "^15.6.0"

react@^16.3.0:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

reactcss@1.2.3, reactcss@^1.2.0:
version "1.2.3"
resolved "https://registry.yarnpkg.com/reactcss/-/reactcss-1.2.3.tgz#c00013875e557b1cf0dfd9a368a1c3dab3b548dd"
Expand Down