Closed Bug 2076596 Opened 2 months ago Closed 1 month ago

Type-check the tab strip's element modules and the files excluded from the tabbrowser tsconfig

Categories

(Firefox :: Tabbed Browser, task)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(20 external files)

The tabbrowser's tsconfig.json includes only *.sys.mjs and excludes GroupsList.sys.mjs, SmartTabGrouping.sys.mjs and TabsList.sys.mjs. The element modules under content/ (tab.mjs, tabs.mjs, tabgroup.mjs, tabsplitview.mjs) enter the project only through types/elements.ts, so their own code goes unchecked, and tab-hover-preview.mjs, tab-groups-list.mjs and opentabs-splitview.mjs are in no project.

This includes content/*.mjs, declares the chrome window globals these modules read (gBrowser and others), moves the remaining lazy imports to declareLazy so they stop typing as any, and fixes the errors until the tsconfig has no exclude list.

The .js window scripts under content/ stay unchecked until they become modules.

GroupsList's row builder receives open groups as tab group elements, which have no saved property, and saved groups as state objects that always have saved: true, so checking !isOpen instead is behavior-neutral.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

declareLazy types a preference by its default, so the four AsyncTabSwitcher preferences that had none take the value browser/app/profile/firefox.js sets.

declareLazy types a preference by its default, so the three SmartTabGrouping preferences that had none take the value browser/app/profile/firefox.js sets.

A project that includes the file makes the globals visible to its system modules too; ESLint's no-undef still rejects a bare gBrowser there.

Object.hasOwn replaces the in check on _lastAccessed, which tsc narrows to never; nothing on the tab's prototype chain defines _lastAccessed, so the two agree.

Tabbrowser.isTab compares tagName where the child filters called matches("tab"); the two agree for the group's XUL children.

The appendChild and insertBefore overrides now return the inserted node, as Node's do; no caller reads the result.

TabsListBase's new abstract methods are the hooks it already called, and TabsPanel, its only subclass, overrides every one of them.

getInferenceOptions returns a bare { runtimeFilename } when no Remote Settings record matches, so the two telemetry reads of modelRevision narrow with in; they record the same value as before.

Attachment #9650327 - Attachment description: Bug 2076596 - Type-check the tab strip's window modules, starting with tab-groups-list.mjs and opentabs-splitview.mjs, and GroupsList.sys.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check the tab strip's window modules, starting with tab-groups-list.mjs and opentabs-splitview.mjs, and GroupsList.sys.mjs. r?nsharpley!
Attachment #9650328 - Attachment description: Bug 2076596 - Stop passing arguments that OpenTabsController ignores from the split view's open tabs page. r?#tabbrowser-reviewers → Bug 2076596 - Stop passing arguments that OpenTabsController ignores from the split view's open tabs page. r?jsudiaman!
Attachment #9650329 - Attachment description: Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the type-checked tabbrowser modules. r?#tabbrowser-reviewers → Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the type-checked tabbrowser modules. r?kcochrane!
Attachment #9650330 - Attachment description: Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the tabbrowser modules still excluded from type checking. r?#tabbrowser-reviewers → Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the tabbrowser modules still excluded from type checking. r?kcochrane!
Attachment #9650331 - Attachment description: Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?#tabbrowser-reviewers,Standard8 → Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?kcochrane!,Standard8
Attachment #9650333 - Attachment description: Bug 2076596 - Stop passing a tab to resumeDelayedMediaOnMultiSelectedTabs, which takes no arguments. r?#tabbrowser-reviewers → Bug 2076596 - Stop passing a tab to resumeDelayedMediaOnMultiSelectedTabs, which takes no arguments. r?niklas!
Attachment #9650334 - Attachment description: Bug 2076596 - Type-check tab.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check tab.mjs. r?jswinarton!
Attachment #9650335 - Attachment description: Bug 2076596 - Type-check tabgroup.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check tabgroup.mjs. r?nsharpley!
Attachment #9650336 - Attachment description: Bug 2076596 - Type-check tabsplitview.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check tabsplitview.mjs. r?sclements!
Attachment #9650338 - Attachment description: Bug 2076596 - Stop passing arguments that the tab strip's observe method and removeAttribute ignore. r?#tabbrowser-reviewers → Bug 2076596 - Stop passing arguments that the tab strip's observe method and removeAttribute ignore. r?niklas!
Attachment #9650340 - Attachment description: Bug 2076596 - Keep the state for a tab's load burst in the tab progress listener rather than on the tab. r?#tabbrowser-reviewers → Bug 2076596 - Keep the state for a tab's load burst in the tab progress listener rather than on the tab. r?niklas!
Attachment #9650341 - Attachment description: Bug 2076596 - Type-check tabs.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check tabs.mjs. r?sthompson!
Attachment #9650342 - Attachment description: Bug 2076596 - Type-check tab-hover-preview.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check tab-hover-preview.mjs. r?sthompson!
Attachment #9650343 - Attachment description: Bug 2076596 - Document that moveTabBefore and moveTabAfter accept a tab group label. r?#tabbrowser-reviewers → Bug 2076596 - Document that moveTabBefore and moveTabAfter accept a tab group label. r?jsudiaman!
Attachment #9650344 - Attachment description: Bug 2076596 - Stop passing an event to the tabs list's _populate method, which takes none. r?#tabbrowser-reviewers → Bug 2076596 - Stop passing an event to the tabs list's _populate method, which takes none. r?niklas!
Attachment #9650346 - Attachment description: Bug 2076596 - Type-check TabsList.sys.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check TabsList.sys.mjs. r?sclements!
Attachment #9650348 - Attachment description: Bug 2076596 - Type-check SmartTabGrouping.sys.mjs. r?#tabbrowser-reviewers → Bug 2076596 - Type-check SmartTabGrouping.sys.mjs. r?niklas!
Attachment #9650331 - Attachment description: Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?kcochrane!,Standard8 → Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?kcochrane!,Standard8!
Keywords: leave-open
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cf589b9f502d https://hg.mozilla.org/integration/autoland/rev/4208b2540406 Document that moveTabBefore and moveTabAfter accept a tab group label. r=tabbrowser-reviewers,jsudiaman
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5609ce259634 https://hg.mozilla.org/integration/autoland/rev/e4ca3df9987a Stop passing arguments that OpenTabsController ignores from the split view's open tabs page. r=tabbrowser-reviewers,jsudiaman
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/84e401eabf5c https://hg.mozilla.org/integration/autoland/rev/f4b17bd21a85 Type-check the tab strip's window modules, starting with tab-groups-list.mjs and opentabs-splitview.mjs, and GroupsList.sys.mjs. r=tabbrowser-reviewers,nsharpley https://github.com/mozilla-firefox/firefox/commit/4c7e12f307de https://hg.mozilla.org/integration/autoland/rev/c407d93102b5 Declare the lazy getters with XPCOMUtils.declareLazy in the type-checked tabbrowser modules. r=tabbrowser-reviewers,kcochrane https://github.com/mozilla-firefox/firefox/commit/f0ce2dc6c1db https://hg.mozilla.org/integration/autoland/rev/6085882736fd Declare the lazy getters with XPCOMUtils.declareLazy in the tabbrowser modules still excluded from type checking. r=tabbrowser-reviewers,kcochrane
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/69a26ae93fb6 https://hg.mozilla.org/integration/autoland/rev/dbeb07b728db Stop passing a tab to resumeDelayedMediaOnMultiSelectedTabs, which takes no arguments. r=tabbrowser-reviewers,niklas https://github.com/mozilla-firefox/firefox/commit/7cb2283c6560 https://hg.mozilla.org/integration/autoland/rev/97744e3226ae Stop passing arguments that the tab strip's observe method and removeAttribute ignore. r=tabbrowser-reviewers,niklas https://github.com/mozilla-firefox/firefox/commit/cffc0859a898 https://hg.mozilla.org/integration/autoland/rev/6c6430d994fb Stop passing an event to the tabs list's _populate method, which takes none. r=tabbrowser-reviewers,niklas

Authored by https://github.com/daogottwald
https://github.com/mozilla/enterprise-firefox/commit/cf589b9f502d40fd41429c75b40387b8d0dd6164
[enterprise-main] Bug 2076596 - Document that moveTabBefore and moveTabAfter accept a tab group label. r=tabbrowser-reviewers,jsudiaman

Authored by https://github.com/daogottwald
https://github.com/mozilla/enterprise-firefox/commit/5609ce2596345099798ab920fc026ff4d49636b0
[enterprise-main] Bug 2076596 - Stop passing arguments that OpenTabsController ignores from the split view's open tabs page. r=tabbrowser-reviewers,jsudiaman

Authored by https://github.com/daogottwald
https://github.com/mozilla/enterprise-firefox/commit/84e401eabf5c5755bf4274ab7eb05416795e558d
[enterprise-main] Bug 2076596 - Type-check the tab strip's window modules, starting with tab-groups-list.mjs and opentabs-splitview.mjs, and GroupsList.sys.mjs. r=tabbrowser-reviewers,nsharpley

Authored by https://github.com/daogottwald
https://github.com/mozilla/enterprise-firefox/commit/4c7e12f307de8b5ac4009161d826d9524562699a
[enterprise-main] Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the type-checked tabbrowser modules. r=tabbrowser-reviewers,kcochrane

Authored by https://github.com/daogottwald
https://github.com/mozilla/enterprise-firefox/commit/f0ce2dc6c1dbf8259f09627d8ea4a308e07a461c
[enterprise-main] Bug 2076596 - Declare the lazy getters with XPCOMUtils.declareLazy in the tabbrowser modules still excluded from type checking. r=tabbrowser-reviewers,kcochrane

(via GitHub webhook, authenticated as shared-secret)

Attachment #9650331 - Attachment description: Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?kcochrane!,Standard8! → Bug 2076596 - Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r?kcochrane!,zombie!
Blocks: 2079204
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/42076a3957e7 https://hg.mozilla.org/integration/autoland/rev/1ed6fc69d11b Declare the browser window's globals for type-checked modules that run in it, starting with the tabbrowser's. r=tabbrowser-reviewers,kcochrane,Standard8 https://github.com/mozilla-firefox/firefox/commit/efa30030b726 https://hg.mozilla.org/integration/autoland/rev/996bf3567017 Declare the custom element members that the tab strip's elements use, and let customElements.define take a XUL element. r=Standard8 https://github.com/mozilla-firefox/firefox/commit/1a8ffefe8d3a https://hg.mozilla.org/integration/autoland/rev/030d02f36157 Declare the members that the tab strip inherits from the toolkit's tabs and tabbox elements. r=Standard8 https://github.com/mozilla-firefox/firefox/commit/45f2e70ca96f https://hg.mozilla.org/integration/autoland/rev/1b9b142e2f7c Type-check tabsplitview.mjs. r=tabbrowser-reviewers,sclements https://github.com/mozilla-firefox/firefox/commit/df38ae7dd01e https://hg.mozilla.org/integration/autoland/rev/e96094fc50f0 Type-check tabgroup.mjs. r=tabbrowser-reviewers,nsharpley https://github.com/mozilla-firefox/firefox/commit/fa78c603d743 https://hg.mozilla.org/integration/autoland/rev/e93ecd380644 Keep the state for a tab's load burst in the tab progress listener rather than on the tab. r=tabbrowser-reviewers,niklas https://github.com/mozilla-firefox/firefox/commit/4b477fcf68ce https://hg.mozilla.org/integration/autoland/rev/5a0c9f4d063a Type-check TabsList.sys.mjs. r=tabbrowser-reviewers,sclements
Attachment #9650342 - Attachment description: Bug 2076596 - Type-check tab-hover-preview.mjs. r?sthompson! → Bug 2076596 - Type-check tab-hover-preview.mjs. r?jswinarton!
Attachment #9650341 - Attachment description: Bug 2076596 - Type-check tabs.mjs. r?sthompson! → Bug 2076596 - Type-check tabs.mjs. r?jsudiaman!
Attachment #9650341 - Attachment description: Bug 2076596 - Type-check tabs.mjs. r?jsudiaman! → Bug 2076596 - Type-check tabs.mjs. r?sthompson!
Attachment #9650342 - Attachment description: Bug 2076596 - Type-check tab-hover-preview.mjs. r?jswinarton! → Bug 2076596 - Type-check tab-hover-preview.mjs. r?sthompson!
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/61926a0075fa https://hg.mozilla.org/integration/autoland/rev/28891bad4bdc Correct the JSDoc types of getInferenceOptions, getAccuracyStats and computeRandScore. r=ai-platform-reviewers,nordzilla https://github.com/mozilla-firefox/firefox/commit/433d37a7f164 https://hg.mozilla.org/integration/autoland/rev/8f3ef66f7215 Type-check SmartTabGrouping.sys.mjs. r=tabbrowser-reviewers,niklas
Blocks: 2081848
Blocks: 2081869
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: