From b76d30efbd999348495956a3aca1f8a0553ace7b Mon Sep 17 00:00:00 2001 From: Tim Klever Date: Thu, 6 Aug 2020 13:59:38 -0700 Subject: [PATCH] update legacy react lifecycle methods to indicate unsafe status Following the react migration path laid out here https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html Signed-off-by: Tim Klever --- packages/jaeger-ui/src/components/App/Page.tsx | 3 ++- packages/jaeger-ui/src/components/DeepDependencies/index.tsx | 3 ++- .../src/components/DependencyGraph/DependencyForceGraph.js | 3 ++- packages/jaeger-ui/src/components/DependencyGraph/index.js | 3 ++- .../src/components/TracePage/ArchiveNotifier/index.tsx | 3 ++- .../components/TracePage/TracePageHeader/SpanGraph/index.tsx | 3 ++- .../components/TracePage/TraceStatistics/DetailTableData.tsx | 3 ++- .../src/components/TracePage/TraceStatistics/MainTableData.tsx | 3 ++- .../TimelineHeaderRow/TimelineViewingLayer.tsx | 3 ++- .../TracePage/TraceTimelineViewer/VirtualizedTraceView.tsx | 3 ++- packages/jaeger-ui/src/components/TracePage/index.tsx | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/jaeger-ui/src/components/App/Page.tsx b/packages/jaeger-ui/src/components/App/Page.tsx index 2bfe32ebc0..162528eff0 100644 --- a/packages/jaeger-ui/src/components/App/Page.tsx +++ b/packages/jaeger-ui/src/components/App/Page.tsx @@ -42,7 +42,8 @@ export class PageImpl extends React.Component { trackPageView(pathname, search); } - componentWillReceiveProps(nextProps: TProps) { + // eslint-disable-next-line camelcase + UNSAFE_componentWillReceiveProps(nextProps: TProps) { const { pathname, search } = this.props; const { pathname: nextPathname, search: nextSearch } = nextProps; if (pathname !== nextPathname || search !== nextSearch) { diff --git a/packages/jaeger-ui/src/components/DeepDependencies/index.tsx b/packages/jaeger-ui/src/components/DeepDependencies/index.tsx index 8df2a3525f..5a4915f3f6 100644 --- a/packages/jaeger-ui/src/components/DeepDependencies/index.tsx +++ b/packages/jaeger-ui/src/components/DeepDependencies/index.tsx @@ -118,7 +118,8 @@ export class DeepDependencyGraphPageImpl extends React.PureComponent this.onResize(...args), 50); window.addEventListener('resize', this.debouncedResize); diff --git a/packages/jaeger-ui/src/components/DependencyGraph/index.js b/packages/jaeger-ui/src/components/DependencyGraph/index.js index 3866a2e361..00cdee3856 100644 --- a/packages/jaeger-ui/src/components/DependencyGraph/index.js +++ b/packages/jaeger-ui/src/components/DependencyGraph/index.js @@ -66,7 +66,8 @@ export class DependencyGraphPageImpl extends Component { }; } - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { this.props.fetchDependencies(); } diff --git a/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx b/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx index 7b7d1467d7..8df9d7a19e 100644 --- a/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx @@ -111,7 +111,8 @@ export default class ArchiveNotifier extends React.PureComponent { this.state = { notifiedState }; } - componentWillReceiveProps(nextProps: Props) { + // eslint-disable-next-line camelcase + UNSAFE_componentWillReceiveProps(nextProps: Props) { const notifiedState = processProps(this.state.notifiedState, nextProps); if (this.state.notifiedState !== notifiedState) { this.setState({ notifiedState }); diff --git a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/index.tsx b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/index.tsx index 0f3cb839b1..aedaac67a4 100644 --- a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/index.tsx @@ -66,7 +66,8 @@ export default class SpanGraph extends React.PureComponent { - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { const element = this.props.values.map(item => { return { uid: _.uniqueId('id'), value: item }; }); diff --git a/packages/jaeger-ui/src/components/TracePage/TraceStatistics/MainTableData.tsx b/packages/jaeger-ui/src/components/TracePage/TraceStatistics/MainTableData.tsx index cb77212f2d..fe5b8c27f0 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceStatistics/MainTableData.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceStatistics/MainTableData.tsx @@ -39,7 +39,8 @@ type State = { * Used to render the main column. */ export default class MainTableData extends Component { - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { const element = this.props.values.map(item => { return { uid: _.uniqueId('id'), value: item }; }); diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.tsx index 59dd42c7d8..0edb6d3ed5 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.tsx @@ -137,7 +137,8 @@ export default class TimelineViewingLayer extends React.PureComponent { mergeShortcuts(shortcutCallbacks); } - componentWillReceiveProps(nextProps: TProps) { + // eslint-disable-next-line camelcase + UNSAFE_componentWillReceiveProps(nextProps: TProps) { const { trace } = nextProps; this._scrollManager.setTrace(trace && trace.data); }