Closed Bug 1363768 Opened 4 years ago Closed 4 years ago

Cache and simplify some components under Message

Categories

(DevTools :: Console, enhancement, P1)

enhancement

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Iteration:
55.5 - May 15
Tracking Status
firefox55 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

(Blocks 1 open bug)

Details

(Whiteboard: [console-html])

Attachments

(1 file)

Doing some measurements, it looks like there are some easy small wins with MessageIndent, MessageRepeat, and MessageIcon
Comment on attachment 8866629 [details]
Bug 1363768 - Prevent creating constant elements during render;

https://reviewboard.mozilla.org/r/138234/#review141464

Just a small thing, but R+ if TRY and mocha are green

::: devtools/client/webconsole/new-console-output/components/message.js:194
(Diff revision 1)
>          )));
>      } else {
>        notesNodes = [];
>      }
>  
> -    const repeat = MessageRepeat({repeat: this.props.repeat});
> +    const repeat = this.props.repeat ? MessageRepeat({repeat: this.props.repeat}) : null;

IF we're doing this here, we can go a little further and do not print anything if repeat is < 2

```
const repeat = this.props.repeat && this.props.repeat > 1 
  ? MessageRepeat({repeat: this.props.repeat}) 
  : null;
```

It also means that we can remove tis logic from the MessageRepeat function
Attachment #8866629 - Flags: review?(nchevobbe) → review+
Iteration: --- → 55.5 - May 15
Flags: qe-verify?
Priority: -- → P1
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bea7660031a0
Prevent creating constant elements during render;r=nchevobbe
https://hg.mozilla.org/mozilla-central/rev/bea7660031a0
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Flags: qe-verify? → qe-verify-
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.