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

[Dependencies]: upgrade react to latest v16.12.0 #51145

Merged
merged 27 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
be2632c
[Dependencies]: upgrade react to latest v16.12.0
sebelga Nov 20, 2019
3ef3643
Merge branch 'master' into deps/upgrade-react
elasticmachine Nov 20, 2019
c266ed8
upgrade all react versions and unify react/react-is versions installed
Nov 20, 2019
02584b3
Bump react-dom & types
sebelga Nov 21, 2019
b06ce8b
Merge remote-tracking branch 'upstream/master' into deps/upgrade-react
sebelga Nov 21, 2019
7472aee
Update yarn.lock after yarn kbn bootstrap
sebelga Nov 21, 2019
58493e9
Align kibana and xpack packages version
sebelga Nov 21, 2019
5b0eae2
Merge remote-tracking branch 'upstream/master' into deps/upgrade-react
sebelga Nov 21, 2019
d96473b
Update yarn.lock after yarn kbn bootstrap (2)
sebelga Nov 21, 2019
bcbf81c
Merge remote-tracking branch 'upstream/master' into deps/upgrade-react
sebelga Nov 22, 2019
d5cb7bd
Update yarn.lock after yarn kbn bootstrap (3)
sebelga Nov 22, 2019
6baf089
Merge branch 'master' into deps/upgrade-react
elasticmachine Nov 24, 2019
0f1073b
Fix unit tests
patrykkopycinski Nov 24, 2019
fdbe776
Merge branch 'master' of github.com:elastic/kibana into deps/upgrade-…
patrykkopycinski Nov 25, 2019
b461772
bump test dependencies
patrykkopycinski Nov 25, 2019
70f9475
fix dependencies
patrykkopycinski Nov 25, 2019
14ba28d
fix tests
patrykkopycinski Nov 25, 2019
317d7ef
fix tests
patrykkopycinski Nov 25, 2019
120fd96
cleanup
patrykkopycinski Nov 26, 2019
1b953db
Merge branch 'master' of github.com:elastic/kibana into deps/upgrade-…
patrykkopycinski Nov 27, 2019
00857d3
codemod
patrykkopycinski Nov 27, 2019
9728618
update snapshot
patrykkopycinski Nov 27, 2019
c390a48
upgrade react-redux
patrykkopycinski Nov 27, 2019
3647c24
Update package.json
patrykkopycinski Nov 27, 2019
f0cf8ad
Merge branch 'master' into deps/upgrade-react
elasticmachine Nov 28, 2019
191d9f0
update imports
patrykkopycinski Nov 28, 2019
16bb318
Merge branch 'master' into deps/upgrade-react
elasticmachine Nov 28, 2019
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
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,16 @@
},
"resolutions": {
"**/@types/node": "10.12.27",
"**/@types/react": "16.8.3",
"**/@types/react": "^16.9.13",
"**/@types/hapi": "^17.0.18",
"**/@types/angular": "^1.6.56",
"**/typescript": "3.7.2",
"**/graphql-toolkit/lodash": "^4.17.13",
"**/isomorphic-git/**/base64-js": "^1.2.1",
"**/image-diff/gm/debug": "^2.6.9",
"**/deepmerge": "^4.2.2",
"**/react": "16.8.6",
"**/react-dom": "16.8.6",
"**/react-test-renderer": "16.8.6"
"**/react-dom": "^16.12.0",
"**/react-test-renderer": "^16.12.0",
"**/deepmerge": "^4.2.2"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -216,12 +215,10 @@
"pug": "^2.0.3",
"querystring-browser": "1.0.4",
"raw-loader": "3.1.0",
"react": "^16.8.6",
"react-addons-shallow-compare": "15.6.2",
"react": "^16.12.0",
"react-color": "^2.13.8",
"react-dom": "^16.8.6",
"react-dom": "^16.12.0",
"react-grid-layout": "^0.16.2",
"react-hooks-testing-library": "^0.5.0",
"react-input-range": "^1.3.0",
"react-markdown": "^3.4.1",
"react-redux": "^5.1.1",
Expand Down Expand Up @@ -287,6 +284,8 @@
"@microsoft/api-documenter": "7.4.3",
"@microsoft/api-extractor": "7.4.2",
"@percy/agent": "^0.11.0",
"@testing-library/react": "^9.3.2",
"@testing-library/react-hooks": "^3.2.1",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
"@types/babel__core": "^7.1.2",
Expand All @@ -312,7 +311,7 @@
"@types/has-ansi": "^3.0.0",
"@types/history": "^4.7.3",
"@types/hoek": "^4.1.3",
"@types/jest": "^24.0.18",
"@types/jest": "24.0.19",
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.31",
"@types/js-yaml": "^3.11.1",
Expand All @@ -332,8 +331,8 @@
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
"@types/reach__router": "^1.2.6",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/react-redux": "^6.0.6",
"@types/react-router-dom": "^4.3.1",
"@types/react-virtualized": "^9.18.7",
Expand All @@ -347,6 +346,8 @@
"@types/styled-components": "^4.4.0",
"@types/supertest": "^2.0.5",
"@types/supertest-as-promised": "^2.0.38",
"@types/testing-library__react": "^9.1.2",
"@types/testing-library__react-hooks": "^3.1.0",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"@types/vinyl-fs": "^2.4.11",
Expand Down Expand Up @@ -410,7 +411,6 @@
"istanbul-instrumenter-loader": "3.0.1",
"jest": "^24.9.0",
"jest-cli": "^24.9.0",
"jest-dom": "^3.5.0",
"jest-raw-loader": "^1.0.1",
"jimp": "0.8.4",
"json5": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {

rules: {
'block-scoped-var': 'error',
camelcase: [ 'error', { properties: 'never' } ],
camelcase: [ 'error', { properties: 'never', allow: ['^UNSAFE_'] } ],
'comma-dangle': 'off',
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': [ 'error', 'last' ],
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
rules: {
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'import/order': 'off'
'import/order': 'off',
},
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = {
'@typescript-eslint/camelcase': ['error', {
'properties': 'never',
'ignoreDestructuring': true,
'allow': ['^[A-Z0-9_]+$']
'allow': ['^[A-Z0-9_]+$', '^UNSAFE_']
}],
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/explicit-member-accessibility': ['error',
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"intl-messageformat": "^2.2.0",
"intl-relativeformat": "^2.1.0",
"prop-types": "^15.6.2",
"react": "^16.8.6",
"react": "^16.12.0",
"react-intl": "^2.8.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class GuideNav extends Component {
});
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const currentRoute = nextProps.routes[1];
const nextRoute = this.props.getNextRoute(currentRoute.name);
const previousRoute = this.props.getPreviousRoute(currentRoute.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function mapDispatchToProps(dispatch) {
}

class GuideSandboxComponent extends Component {
componentWillMount() {
UNSAFE_componentWillMount() {
this.props.openSandbox();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class GuideSection extends Component {
this.props.openCodeViewer(this.props.source, this.props.title);
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.props.registerSection(this.getId(), this.props.title);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/doc_site/src/views/app_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AppView extends Component {
});
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// Only force the chrome to be hidden if we're navigating from a non-sandbox to a sandbox.
if (!this.props.isSandbox && nextProps.isSandbox) {
this.setState({
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"focus-trap-react": "^3.1.1",
"lodash": "npm:@elastic/[email protected]",
"prop-types": "15.6.0",
"react": "^16.8.6",
"react": "^16.12.0",
"react-ace": "^5.9.0",
"react-color": "^2.13.8",
"tabbable": "1.1.3",
Expand Down Expand Up @@ -57,7 +57,7 @@
"postcss": "^7.0.5",
"postcss-loader": "^3.0.0",
"raw-loader": "^3.1.0",
"react-dom": "^16.8.6",
"react-dom": "^16.12.0",
"react-redux": "^5.0.6",
"react-router": "^3.2.0",
"react-router-redux": "^4.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FieldSelectUi extends Component {
this.loadFields(this.state.indexPatternId);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.indexPatternId !== nextProps.indexPatternId) {
this.loadFields(nextProps.indexPatternId);
}
Expand Down
10 changes: 0 additions & 10 deletions src/legacy/core_plugins/kibana/public/discover/doc/doc.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ beforeEach(() => {
jest.clearAllMocks();
});

// Suppress warnings about "act" until we use React 16.9
/* eslint-disable no-console */
const originalError = console.error;
beforeAll(() => {
console.error = jest.fn();
});
afterAll(() => {
console.error = originalError;
});

export const waitForPromises = () => new Promise(resolve => setTimeout(resolve, 0));

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { renderHook, act } from 'react-hooks-testing-library';
import { renderHook, act } from '@testing-library/react-hooks';
import { buildSearchBody, useEsDocSearch, ElasticRequestState } from './use_es_doc_search';
import { DocProps } from './doc';

// Suppress warnings about "act" until we use React 16.9
/* eslint-disable no-console */
const originalError = console.error;
beforeAll(() => {
console.error = jest.fn();
});
afterAll(() => {
console.error = originalError;
});

describe('Test of <Doc /> helper / hook', () => {
test('buildSearchBody', () => {
const indexPattern = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TutorialUi extends React.Component {
}
}

componentWillMount() {
UNSAFE_componentWillMount() {
this._isMounted = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class IndicesList extends Component {
this.pager = new Pager(props.indices.length, this.state.perPage, this.state.page);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.indices.length !== this.props.indices.length) {
this.pager.setTotalItems(nextProps.indices.length);
this.resetPageTo0();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class StepIndexPattern extends Component {
this.lastQuery = null;
}

async componentWillMount() {
async UNSAFE_componentWillMount() {
this.fetchExistingIndexPatterns();
if (this.state.query) {
this.lastQuery = this.state.query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class CreateIndexPatternWizard extends Component {
};
}

async componentWillMount() {
async UNSAFE_componentWillMount() {
this.fetchData();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class IndexedFieldsTable extends Component {
};
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.fields !== this.props.fields) {
this.setState({
fields: this.mapFields(nextProps.fields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ScriptedFieldsTable extends Component {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.fetchFields();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class SourceFiltersTable extends Component {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.updateFilters();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export class Relationships extends Component {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.getRelationshipData();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.savedObject.id !== this.props.savedObject.id) {
this.getRelationshipData();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AdvancedSettings extends Component {
}, {});
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const { config } = nextProps;
const { query } = this.state;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Field extends PureComponent {
this.changeImageForm = null;
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const { unsavedValue } = this.state;
const { type, value, defVal } = nextProps.setting;
const editableValue = this.getEditableValue(type, value, defVal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class TelemetryForm extends Component {
queryMatches: null,
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const {
query
} = nextProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
} from '@elastic/eui';

export class CalculationAgg extends Component {
componentWillMount() {
UNSAFE_componentWillMount() {
if (!this.props.model.variables) {
this.props.onChange(
_.assign({}, this.props.model, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
import { FormattedMessage } from '@kbn/i18n/react';

export class MathAgg extends Component {
componentWillMount() {
UNSAFE_componentWillMount() {
if (!this.props.model.variables) {
this.props.onChange(
_.assign({}, this.props.model, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const RESTRICT_FIELDS = [KBN_FIELD_TYPES.NUMBER];
export class PercentileAgg extends Component {
// eslint-disable-line react/no-multi-comp

componentWillMount() {
UNSAFE_componentWillMount() {
if (!this.props.model.percentiles) {
this.props.onChange(
_.assign({}, this.props.model, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import PropTypes from 'prop-types';
import React, { Component } from 'react';
import React, { PureComponent } from 'react';

import {
ColorWrap as colorWrap,
Expand All @@ -32,18 +32,13 @@ import ChromePointer from 'react-color/lib/components/chrome/ChromePointer';
import ChromePointerCircle from 'react-color/lib/components/chrome/ChromePointerCircle';
import CompactColor from 'react-color/lib/components/compact/CompactColor';
import color from 'react-color/lib/helpers/color';
import shallowCompare from 'react-addons-shallow-compare';

class CustomColorPickerUI extends Component {
class CustomColorPickerUI extends PureComponent {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}

shouldComponentUpdate(nextProps, nextState) {
return shallowCompare(nextProps, nextState);
}

handleChange(data) {
this.props.onChange(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GaugePanelConfigUi extends Component {
this.state = { selectedTab: 'data' };
}

componentWillMount() {
UNSAFE_componentWillMount() {
const { model } = this.props;
const parts = {};
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class MetricPanelConfig extends Component {
this.state = { selectedTab: 'data' };
}

componentWillMount() {
UNSAFE_componentWillMount() {
const { model } = this.props;
if (
!model.background_color_rules ||
Expand Down
Loading