Closed Bug 1313140 Opened 8 years ago Closed 7 years ago

Avoid triggering `onChangeViewportDevice` for every resize

Categories

(DevTools :: Responsive Design Mode, defect, P3)

49 Branch
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jryans, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [multiviewport][reserve-rdm])

At the moment, we call `onChangeViewportDevice` in resizable-viewport.js for every size change, which trickles down to RDP calls each time.

We really only need to do this a single time to transition away from an active device (if there is one).

Not yet sure if the most natural way in React is to either:

A. Fire an action every time, but the reducer for it only triggers `onChangeViewportDevice` on actual change
B. Filter to actual change directly at the event handler and only call `onChangeViewportDevice` on actual change there
Flags: qe-verify-
Remove this step does appear to improve pref on resize, though it's a bit hard to tell for sure.  I do see less JS activity in the profile.

(Make sure to disable debug JS libs like react-dev when profiling!)
Blocks: 1318340
Patches in bug 1319950 should resolve this.
Depends on: 1319950
Seems like this was fixed in 52+.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.