Closed
Bug 1441218
Opened 6 years ago
Closed 6 years ago
Restore original init code to font inspector
Categories
(DevTools :: Inspector, enhancement)
DevTools
Inspector
Tracking
(firefox60 fixed)
RESOLVED
FIXED
Firefox 60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: miker, Assigned: miker)
References
Details
Attachments
(1 file)
It is not a React component and React complained that we use this.store.dispatch() from the constructor. Everything works fine as it is so we just need to remove the componentWillMount method.
Assignee | ||
Updated•6 years ago
|
Has Regression Range: --- → irrelevant
Has STR: --- → irrelevant
Comment hidden (mozreview-request) |
Comment 2•6 years ago
|
||
mozreview-review |
Comment on attachment 8954072 [details] Bug 1441218 - Restore original init code to font inspector https://reviewboard.mozilla.org/r/223222/#review229474 ::: devtools/client/inspector/fonts/fonts.js (Diff revision 1) > - this.store.dispatch(updatePreviewText("")); > - this.update(false, ""); shouldn't we move those into the init function, where they were located before ?
Attachment #8954072 -
Flags: review?(nchevobbe) → review-
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #2) > Comment on attachment 8954072 [details] > Bug 1441218 - Remove componentWillMount() from the font inspector > > https://reviewboard.mozilla.org/r/223222/#review229474 > > ::: devtools/client/inspector/fonts/fonts.js > (Diff revision 1) > > - this.store.dispatch(updatePreviewText("")); > > - this.update(false, ""); > > shouldn't we move those into the init function, where they were located > before ? Absolutely not... I do we get React warnings saying you can't call them from the constructor. And the Component works absolutely fine without those two lines. I'll resubmit it for review.
Assignee | ||
Updated•6 years ago
|
Attachment #8954072 -
Flags: review- → review?(nchevobbe)
Assignee | ||
Comment 4•6 years ago
|
||
Comment on attachment 8954072 [details] Bug 1441218 - Restore original init code to font inspector nchevobbe is nervous about removing those two lines of code in case there are edge cases that we have missed. I will investigate further before deciding what to do.
Attachment #8954072 -
Flags: review?(nchevobbe)
Assignee | ||
Comment 5•6 years ago
|
||
This is the original warning message: `Warning: setState(...): Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.`
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Summary: Remove componentWillMount() from the font inspector → Restore original init code to font inspector
Assignee | ||
Updated•6 years ago
|
Attachment #8954072 -
Attachment description: Bug 1441218 - Remove componentWillMount() from the font inspector → Bug 1441218 - Restore original init code to font inspector
Assignee | ||
Comment 7•6 years ago
|
||
Turns out that this is a redux issue that was fixed by the redux update ( bug 1441147 ). This patch moves the original init code back into place as the reviewer requested.
Comment 8•6 years ago
|
||
If you want to know for sure if removing/moving these 2 lines will cause a problem, I suggest asking Gabriel who wrote this part of the code.
Assignee | ||
Comment 9•6 years ago
|
||
(In reply to Patrick Brosset <:pbro> from comment #8) > If you want to know for sure if removing/moving these 2 lines will cause a > problem, I suggest asking Gabriel who wrote this part of the code. There is no error with the lines in place because of the redux update so it is simply an issue of putting the lines back.
Comment 10•6 years ago
|
||
mozreview-review |
Comment on attachment 8954072 [details] Bug 1441218 - Restore original init code to font inspector https://reviewboard.mozilla.org/r/223222/#review229798 Thanks Mike
Attachment #8954072 -
Flags: review?(nchevobbe) → review+
Comment 11•6 years ago
|
||
Pushed by mratcliffe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c518398e5fd1 Remove componentWillMount() from the font inspector r=nchevobbe
Comment 12•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c518398e5fd1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•3 years ago
|
Component: Inspector: Fonts → Inspector
You need to log in
before you can comment on or make changes to this bug.
Description
•