Closed Bug 1410119 Opened 7 years ago Closed 7 years ago

Inspector needs to use ES6 classes so that we can switch it over to PureComponent

Categories

(DevTools :: Inspector, enhancement, P2)

enhancement

Tracking

(firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox58 --- fixed

People

(Reporter: miker, Assigned: miker)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Status: NEW → ASSIGNED
This was an excellent sanity test for mozclass.js... it threw a bunch of errors: ../firefox/devtools/client/inspector/extensions/components/ExtensionSidebar.js: `ExtensionSidebar` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/extensions/components/ObjectTreeView.js: `ObjectTreeView` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/fonts/components/App.js: `App` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/fonts/components/Font.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/fonts/components/FontList.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/BoxModel.js: `` was skipped because of inconvertible mixins. ERR ../firefox/devtools/client/inspector/layout/components/Accordion.js Transformation error TypeError: Cannot read property 'forEach' of undefined at NodePath.<anonymous> (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:467:11) at __paths.forEach (/Users/ratcliffes/.config/yarn/global/node_modules/jscodeshift/src/Collection.js:76:36) at Array.forEach (<anonymous>) at Collection.forEach (/Users/ratcliffes/.config/yarn/global/node_modules/jscodeshift/src/Collection.js:75:18) at changeRequireProps (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:464:10) at module.exports (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:1218:5) ../firefox/devtools/client/inspector/boxmodel/components/BoxModelApp.js: `BoxModelApp` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/layout/components/App.js: `App` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/BoxModelEditable.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/BoxModelInfo.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/grids/components/Grid.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/grids/components/GridDisplaySettings.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/grids/components/GridItem.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/grids/components/GridList.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/BoxModelMain.js: `` was skipped because of inconvertible mixins. ERR ../firefox/devtools/client/inspector/local-toolbox.js Transformation error TypeError: Cannot read property 'forEach' of undefined at NodePath.<anonymous> (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:467:11) at __paths.forEach (/Users/ratcliffes/.config/yarn/global/node_modules/jscodeshift/src/Collection.js:76:36) at Array.forEach (<anonymous>) at Collection.forEach (/Users/ratcliffes/.config/yarn/global/node_modules/jscodeshift/src/Collection.js:75:18) at changeRequireProps (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:464:10) at module.exports (/Users/ratcliffes/Desktop/moz-codemod/transforms/mozclass.js:1218:5) ../firefox/devtools/client/inspector/grids/components/GridOutline.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/BoxModelProperties.js: `` was skipped because of inconvertible mixins. ../firefox/devtools/client/inspector/boxmodel/components/ComputedProperty.js: `` was skipped because of inconvertible mixins. This is because of two bugs that are reasonably easy to fix but for the moment I have just worked around the issues. I will build and fix any errors and then send a try run.
Comment on attachment 8920267 [details] Bug 1410119 - Inspector: Switch to ES6 classes https://reviewboard.mozilla.org/r/191286/#review196448 I fully expect ESLint failures from the try run but this is fixed in the NetMonitor bug... I might move it out to another but it is only a one liner.
Comment on attachment 8920267 [details] Bug 1410119 - Inspector: Switch to ES6 classes https://reviewboard.mozilla.org/r/191288/#review196620 ::: devtools/client/inspector/boxmodel/components/BoxModel.js:78 (Diff revision 1) > null > ); > - }, > -}); > + } > +} > + > +BoxModel.displayName = "BoxModel"; While some of these changes look fine, I would prefer to keep the displayName and props inside the class.
Attachment #8920267 - Flags: review?(gl)
(In reply to Gabriel [:gl] (ΦωΦ) from comment #4) > Comment on attachment 8920267 [details] > Bug 1410119 - Inspector: Switch to ES6 classes > > https://reviewboard.mozilla.org/r/191288/#review196620 > > ::: devtools/client/inspector/boxmodel/components/BoxModel.js:78 > (Diff revision 1) > > null > > ); > > - }, > > -}); > > + } > > +} > > + > > +BoxModel.displayName = "BoxModel"; > > While some of these changes look fine, I would prefer to keep the > displayName and props inside the class. This is a "feature" of ES6 classes in the current version of Firefox. It is an ES6 class and they need to be static properties... sadly, Firefox doesn't support ES6 static properties so we can't do that. pbro mentioned that there is some minified the process affected and it did something to tests so I will take a look at that.
Comment on attachment 8920267 [details] Bug 1410119 - Inspector: Switch to ES6 classes https://reviewboard.mozilla.org/r/191288/#review196620 > While some of these changes look fine, I would prefer to keep the displayName and props inside the class. This is a "feature" of ES6 classes in the current version of Firefox. It is an ES6 class and they need to be static properties... sadly, Firefox doesn't support ES6 static properties so we can't do that.
Attachment #8920267 - Attachment is obsolete: true
Attachment #8921550 - Flags: review?(gl) → review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Blocks: 1411904
No longer depends on: 1411904
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: