Bug 1315922 - fix react/prop-types issues in client/memory;r=gregtatum
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 05 Jan 2017 17:11:20 +0100
changeset 374979 62c0f953fd6d9337b9f757cba7ea01f21b3eaf10
parent 374978 911f62d371e7458131e1ca09e8b7653a8047ad5c
child 374980 56150dbd34b36e3240ec3cbd1f4f92e2be8835a5
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregtatum
bugs1315922
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1315922 - fix react/prop-types issues in client/memory;r=gregtatum MozReview-Commit-ID: 7o1QhSNOKGi
devtools/client/memory/components/census-tree-item.js
devtools/client/memory/components/dominator-tree-item.js
devtools/client/memory/components/dominator-tree.js
devtools/client/memory/components/snapshot-list-item.js
--- a/devtools/client/memory/components/census-tree-item.js
+++ b/devtools/client/memory/components/census-tree-item.js
@@ -1,22 +1,42 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { isSavedFrame } = require("devtools/shared/DevToolsUtils");
-const { DOM: dom, createClass, createFactory } = require("devtools/client/shared/vendor/react");
+const {
+  DOM: dom,
+  createClass,
+  createFactory,
+  PropTypes
+} = require("devtools/client/shared/vendor/react");
 const { L10N, formatNumber, formatPercent } = require("../utils");
 const Frame = createFactory(require("devtools/client/shared/components/frame"));
 const { TREE_ROW_HEIGHT } = require("../constants");
+const models = require("../models");
 
 module.exports = createClass({
   displayName: "CensusTreeItem",
 
+  propTypes: {
+    arrow: PropTypes.any,
+    depth: PropTypes.number.isRequired,
+    diffing: models.app.diffing,
+    expanded: PropTypes.bool.isRequired,
+    focused: PropTypes.bool.isRequired,
+    getPercentBytes: PropTypes.func.isRequired,
+    getPercentCount: PropTypes.func.isRequired,
+    inverted: PropTypes.bool,
+    item: PropTypes.object.isRequired,
+    onViewIndividuals: PropTypes.func.isRequired,
+    onViewSourceInDebugger: PropTypes.func.isRequired,
+  },
+
   shouldComponentUpdate(nextProps, nextState) {
     return this.props.item != nextProps.item
       || this.props.depth != nextProps.depth
       || this.props.expanded != nextProps.expanded
       || this.props.focused != nextProps.focused
       || this.props.diffing != nextProps.diffing;
   },
 
--- a/devtools/client/memory/components/dominator-tree-item.js
+++ b/devtools/client/memory/components/dominator-tree-item.js
@@ -20,16 +20,17 @@ const Separator = createFactory(createCl
 
 module.exports = createClass({
   displayName: "DominatorTreeItem",
 
   propTypes: {
     item: PropTypes.object.isRequired,
     depth: PropTypes.number.isRequired,
     arrow: PropTypes.object,
+    expanded: PropTypes.bool.isRequired,
     focused: PropTypes.bool.isRequired,
     getPercentSize: PropTypes.func.isRequired,
     onViewSourceInDebugger: PropTypes.func.isRequired,
   },
 
   shouldComponentUpdate(nextProps, nextState) {
     return this.props.item != nextProps.item
       || this.props.depth != nextProps.depth
--- a/devtools/client/memory/components/dominator-tree.js
+++ b/devtools/client/memory/components/dominator-tree.js
@@ -109,16 +109,17 @@ module.exports = createClass({
   displayName: "DominatorTree",
 
   propTypes: {
     dominatorTree: dominatorTreeModel.isRequired,
     onLoadMoreSiblings: PropTypes.func.isRequired,
     onViewSourceInDebugger: PropTypes.func.isRequired,
     onExpand: PropTypes.func.isRequired,
     onCollapse: PropTypes.func.isRequired,
+    onFocus: PropTypes.func.isRequired,
   },
 
   shouldComponentUpdate(nextProps, nextState) {
     // Safe to use referential equality here because all of our mutations on
     // dominator tree models use immutableUpdate in a persistent manner. The
     // exception to the rule are mutations of the expanded set, however we take
     // care that the dominatorTree model itself is still re-allocated when
     // mutations to the expanded set occur. Because of the re-allocations, we
--- a/devtools/client/memory/components/snapshot-list-item.js
+++ b/devtools/client/memory/components/snapshot-list-item.js
@@ -9,27 +9,28 @@ const {
   L10N,
   getSnapshotTitle,
   getSnapshotTotals,
   getStatusText,
   snapshotIsDiffable,
   getSavedCensus
 } = require("../utils");
 const { diffingState } = require("../constants");
-const { snapshot: snapshotModel } = require("../models");
+const { snapshot: snapshotModel, app: appModel } = require("../models");
 
 module.exports = createClass({
   displayName: "SnapshotListItem",
 
   propTypes: {
     onClick: PropTypes.func.isRequired,
     onSave: PropTypes.func.isRequired,
     onDelete: PropTypes.func.isRequired,
     item: snapshotModel.isRequired,
     index: PropTypes.number.isRequired,
+    diffing: appModel.diffing,
   },
 
   render() {
     let { item: snapshot, onClick, onSave, onDelete, diffing } = this.props;
     let className = `snapshot-list-item ${snapshot.selected ? " selected" : ""}`;
     let statusText = getStatusText(snapshot.state);
     let wantThrobber = !!statusText;
     let title = getSnapshotTitle(snapshot);