Closed Bug 1592637 Opened 5 years ago Closed 5 years ago

[popup] Lazyload link.js in Description.js

Categories

(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P3)

enhancement

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: julienw, Assigned: stensonj, Mentored)

Details

Attachments

(2 files)

In Description.js, we load link.js unconditionally, but it's really only used when the user clicks a link. We should lazyload it.
It's important because link.js itself loads more scripts, that shouldn't be in the critical path when loading up the popup.

Mentor: felash
Priority: -- → P3

Hi there. I would like to take on this bug. From what I gather from your description I would need to move the defintion of "openDocLink" inside the "handleLinkClick" event function so it is not in the critical path of the file? As this is the only place "openDocLink" is used in the description.js file? Thanks

Flags: needinfo?(felash)

Hey Jacob,
Yes, exactly this!

This is used in the new performance panel, when it's shown in the devtools toolbox. So to test it you can:

  1. enable the "experimental" performance panel, from devtools' settings.
  2. open the "Performance" tab in the devtools
    => The "Description" item is what is shown at the bottom of this view. There you can see if clicking on links still works.

Thanks Jacob! Assigning the bug to you, then :)

Assignee: nobody → stensonj
Flags: needinfo?(felash)

Actually this bit isn't even displayed in the popup, so it's even more absurd that it gets in the way of the popup. Maybe the Description component itself should be lazy-loaded in Perf.js, but I'd bet it's less important for the performance because it's a very small component with no additional dependency (once this bug is fixed).

Hi again. I believe I have solved the bug. After moving the code outside of the critical path and into the handleLinkClick function and testing it, the links in the experimental performance panel are still functional.

Pushed by jwajsberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca19f048cd8d
[popup] Lazyload link.js in Description.js, r=julienw
Status: NEW → RESOLVED
Closed: 5 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: