Closed Bug 1775200 Opened 2 years ago Closed 2 years ago

Avoid updating CodeMirror unless it is strictly necessary

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

A few components are updating CodeMirror very frequently, that, even if the state/props didn't change.

This is especially the case for Editor/index.js:
https://searchfox.org/mozilla-central/rev/b1a5802e0f73bfd6d2096e5fefc2b47831a50b2d/devtools/client/debugger/src/components/Editor/index.js#155-173
Which calls startOperation/endOperation even if none of the sub function change anything.
Also setText will update CodeMirror, even if the state/props didn't change.

Blocks: 1775201

There is many props that are only relevant to the children components,
and we were calling expensive CodeMirror method on any prop change.

Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c1bb0a12baa [devtools] Avoid updating CodeMirror unless it is strictly necessary. r=bomsy
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Blocks: 1853124
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: