Closed Bug 1987270 Opened 11 months ago Closed 11 months ago

Modules exclusively imported with importESModule aren't added to gecko module definitions

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(firefox145 fixed)

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: mstriemer, Assigned: mstriemer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

In bug 1976049 we're adding types for Settings UI and UI Widgets. The preferencesBindings.js file is a main entrypoint and unfortunately seems like a decent chunk of work due to legacy reasons to convert to a ESM right now.

As a workaround I figured I'd move its parts into their own ESMs and export those onto window (this is the API that is established) using ChromeUtils.importESModule(). The code works as expected, however there is no type information. I realised that adding the file paths to lib.gecko.modules.d.ts fixes the problem.

Upon investigation it appears that modules imported with importESModule are not actually added to the type definitions, even though it looks like it's intended that they are, it's an issue with the regex grouping.

Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
Whiteboard: [recomp]
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: