Closed Bug 1607801 Opened 9 months ago Closed 5 months ago

Improve module loading TypeScript definitions

Categories

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

task

Tracking

(firefox77 fixed)

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: gregtatum, Assigned: gregtatum)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Right now the module loading is a bit verbose with lots of boilerplate. This can be improved.

Previously we had to use an annoying method of coercing the global "this"
into an "any" type, then set the "require" property to the browser loader's
"require" function. This patch adds that typing mechanism to the DevTools'
loader system, making it a bit more ergonomic to use.

Depends on D59206

ochameau: I took some time after your feedback to try and improve upon the loader situation to make it more ergonomic. The first patch I only have julien as the reviewer, but the next two I touch "real" files outside of the performance-new directory. I tried to balance the impact of performance, ergonomics, and type safety with the approach. Let me know what you think about the approach.

Flags: needinfo?(poirot.alex)
Attachment #9119534 - Attachment description: Bug 1607801 - Pre-define ChromUtils.import paths; r?julienw → Bug 1607801 - Pre-define ChromeUtils.import paths; r?julienw
Attachment #9119534 - Attachment is obsolete: true
Attachment #9119535 - Attachment is obsolete: true
Attachment #9119536 - Attachment is obsolete: true

I'm leaving this open, as I would still like to rebase the ChromeUtils.import paths patch.

Attachment #9119534 - Attachment is obsolete: false
Attachment #9119536 - Attachment description: Bug 1607801 - Create a TypeScript friendly lazy loading mechanism; r?julienw,ochameau → Bug 1607801 - Create a TypeScript friendly lazy loading mechanism; r?julienw
Attachment #9119536 - Attachment is obsolete: false
Pushed by gtatum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/79e01e02fa5e
Upgrade TypeScript to v3.8.3; r=julienw
https://hg.mozilla.org/integration/autoland/rev/8dfe8cb5a831
Pre-define ChromeUtils.import paths; r=julienw
https://hg.mozilla.org/integration/autoland/rev/de5aad1dc90e
Create a TypeScript friendly lazy loading mechanism; r=ochameau
Flags: needinfo?(poirot.alex)
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
You need to log in before you can comment on or make changes to this bug.