Bug 1503192 - Revert "Bug 1491281 - Use tab id and title as fallbacks for panel props in Inspector sidebar tabs; r=gl
authorRazvan Caliman <rcaliman@mozilla.com>
Tue, 30 Oct 2018 14:54:36 +0000
changeset 499955 5d017b5af700c51b674a32933074b11cddb5a5cb
parent 499954 80f9ac0ab7dcea7a28ff9b12bd8e9fcda8977a84
child 499956 c17a9a39185206ec340920b8165387ddebc760d2
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1503192, 1491281
milestone65.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 1503192 - Revert "Bug 1491281 - Use tab id and title as fallbacks for panel props in Inspector sidebar tabs; r=gl This reverts the patch introduced for Bug 1491281 because it accidentally breaks the Tabbar.js (used in Inspector and Netmonitor) when in working with React in dev mode. Differential Revision: https://phabricator.services.mozilla.com/D10223
devtools/client/inspector/inspector.js
devtools/client/shared/components/tabs/TabBar.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -898,16 +898,20 @@ Inspector.prototype = {
     // Inject a lazy loaded react tab by exposing a fake React object
     // with a lazy defined Tab thanks to `panel` being a function
     const layoutId = "layoutview";
     const layoutTitle = INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2");
     this.sidebar.queueTab(
       layoutId,
       layoutTitle,
       {
+        props: {
+          id: layoutId,
+          title: layoutTitle,
+        },
         panel: () => {
           if (!this.layoutview) {
             const LayoutView =
               this.browserRequire("devtools/client/inspector/layout/layout");
             this.layoutview = new LayoutView(this, this.panelWin);
           }
 
           return this.layoutview.provider;
@@ -922,16 +926,20 @@ Inspector.prototype = {
 
     const animationId = "animationinspector";
     const animationTitle =
       INSPECTOR_L10N.getStr("inspector.sidebar.animationInspectorTitle");
     this.sidebar.queueTab(
       animationId,
       animationTitle,
       {
+        props: {
+          id: animationId,
+          title: animationTitle,
+        },
         panel: () => {
           const AnimationInspector =
             this.browserRequire("devtools/client/inspector/animation/animation");
           this.animationinspector = new AnimationInspector(this, this.panelWin);
           return this.animationinspector.provider;
         },
       },
       defaultTab == animationId);
@@ -939,16 +947,20 @@ Inspector.prototype = {
     // Inject a lazy loaded react tab by exposing a fake React object
     // with a lazy defined Tab thanks to `panel` being a function
     const fontId = "fontinspector";
     const fontTitle = INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle");
     this.sidebar.queueTab(
       fontId,
       fontTitle,
       {
+        props: {
+          id: fontId,
+          title: fontTitle,
+        },
         panel: () => {
           if (!this.fontinspector) {
             const FontInspector =
               this.browserRequire("devtools/client/inspector/fonts/fonts");
             this.fontinspector = new FontInspector(this, this.panelWin);
           }
 
           return this.fontinspector.provider;
@@ -960,16 +972,20 @@ Inspector.prototype = {
       // Inject a lazy loaded react tab by exposing a fake React object
       // with a lazy defined Tab thanks to `panel` being a function
       const changesId = "changesview";
       const changesTitle = INSPECTOR_L10N.getStr("inspector.sidebar.changesViewTitle");
       this.sidebar.queueTab(
         changesId,
         changesTitle,
         {
+          props: {
+            id: changesId,
+            title: changesTitle,
+          },
           panel: () => {
             if (!this.changesView) {
               const ChangesView =
                 this.browserRequire("devtools/client/inspector/changes/ChangesView");
               this.changesView = new ChangesView(this, this.panelWin);
             }
 
             return this.changesView.provider;
--- a/devtools/client/shared/components/tabs/TabBar.js
+++ b/devtools/client/shared/components/tabs/TabBar.js
@@ -312,19 +312,16 @@ class Tabbar extends Component {
       return tab.panel({
         key: tab.id,
         title: tab.title,
         id: tab.id,
         url: tab.url,
       });
     }
 
-    // Ensure tab id and title are used as fallbacks if not defined as panel props.
-    tab.panel.props = Object.assign({ id: tab.id, title: tab.title }, tab.panel.props);
-
     return tab.panel;
   }
 
   render() {
     const tabs = this.state.tabs.map((tab) => this.renderTab(tab));
 
     return (
       div({className: "devtools-sidebar-tabs"},