Closed Bug 1599135 Opened 4 years ago Closed 4 years ago

Don't load the whole Reps bundle

Categories

(DevTools :: Inspector, task, P3)

task

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(2 files)

The inspector is using Reps in a few place, and using the Reps bundle to do so.
This is a bit wasteful because the inspector may only need the element node and the text node rep, while the bundle contains all the Reps file + the whole object inspector code.

We should be able to have Reps as individual files in tree that we can require to save up on performance.

Promising patch: https://perfht.ml/2rqR91C

The steps are:

  • on a page with a flex container
  • open the inspector with Ctrl + Alt + I in order to select the body
  • select the layout tab
  • in the markup, select the flexbox container

It looks like the new patch makes it almost 2 times faster (rendering FlexBox component from 191ms to 20ms 😎).

This allows consumers to directly require a single Rep file
if needed (e.g. the inspector only needs elementNode or textNode).
In order to make this work, the requires for react-dom-factories
and prop-types needed to be changed to the in-tree modules.
We also needed to modified the reps jest config, as well as the
babel config so we can run tests and still generate the reps bundle.
Finally, the dom-node-constants is modified to not use define as
it's not used as an AMD module.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b672a774246
Expose all Reps file. r=jlast.
https://hg.mozilla.org/integration/autoland/rev/50db4f5620dc
Load individual Rep file in inspector.r=gl.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: