Closed Bug 1976049 Opened 1 year ago Closed 11 months ago

Add Types and documentation for Setting and Preference config-work

Categories

(Firefox :: Settings UI, task)

task

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: mkennedy, Assigned: mkennedy)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file, 2 obsolete files)

Get type information and IDE intellisense hooked up for the following:

  1. Preferences class in toolkit/content/preferencesBindings.js that is being used in browser/components/preferences/main.js
  2. The Preference class in toolkit/content/preferencesBindings.js
  3. The Setting class in toolkit/content/preferencesBindings.js
  4. SettingGroup class in browser/components/preferences/widgets/setting-group/setting-group.mjs
  5. SettingControl class in browser/components/preferences/widgets/setting-control/setting-control.mjs

The goal is not to use TypeScript to build or emit the types, since these files are being used in a non-TypeScript, JavaScript-based project. Acceptance Criteria:

  1. Can use Intellisense in any IDE (including VSCode) that supports TypeScript (e.g. hovering over methods of the classes to see their documentation, providing type-hints, autocompletion, etc)
  2. Can use tsc or mach ts check to run checks on the above files and output errors (we don't necessarily need all errors to pass because there will be a lot, just need for the files to be at least evaluated)
  • Make Typescript work in VSCode via references, which also addresses performance issues (e.g. slowness of tsserver upon VSCode startup)

  • Include preferenceBindings types in mjs and js files in toolkit and browser directories

  • Move Setting and Preference classes out of Preferences IIFE so they can be referenced in setting-control.mjs and setting-group.mjs files.

  • Ran mach ts paths to generate missing preferencesBindings.js path resolution

  • Enable strict config (mainly to get `strictNullChecks`` to type check possible undefined/null values)

  • Add Lit types in bundle-lit.sh that will get auto-generated with mach vendor command

  • Add "lit" that aliases to lit types in toolkit/content/widgets/vendor/lit.all.d.ts to avoid the super long path resolution

Attachment #9499001 - Attachment description: Bug 1976049 - Get Settings and Preferences types workin r=mstriemer → Bug 1976049 - Get Settings and Preferences types working r=#recomp-reviewers

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D254993 Bug 1976049 - Get Settings and Preferences types working r=#recomp-reviewers mkennedy mstriemer: Back Jul 21, 2025

:mkennedy, could you please find another reviewer?

For more information, please visit BugBot documentation.

Flags: needinfo?(mkennedy)

I don't believe we need to land this before :mstriemer (original reviewer) gets back in. So I'll leave keep that person as a reviewer. In the meantime, recomp-reviewers (everyone else on my team) is also marked as a reviewer. So we should be good there.

Flags: needinfo?(mkennedy)
Attachment #9499001 - Attachment description: Bug 1976049 - Get Settings and Preferences types working r=#recomp-reviewers → Bug 1976049 - Type and document Settings and Preferences classes r=#recomp-reviewers
  • Add Lit types in bundle-lit.sh that will get auto-generated with mach vendor command

  • Add "lit" that aliases to lit types in toolkit/content/widgets/vendor/lit.all.d.ts to avoid the super long path resolution

Regressions: 1982021
Depends on: 1982021
No longer regressions: 1982021
Depends on: 1987270
Depends on: 1987272
Attachment #9504972 - Attachment is obsolete: true

Comment on attachment 9504973 [details]
Bug 1976049 - Add and use Lit Types r=#recomp-reviewers

Revision D259851 was moved to bug 1989309. Setting attachment 9504973 [details] to obsolete.

Attachment #9504973 - Attachment is obsolete: true
See Also: → 1990038
Pushed by mkennedy@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5ad6c23e1367 https://hg.mozilla.org/integration/autoland/rev/18f09d79e9b3 Type and document Settings and Preferences classes r=Standard8,mstriemer,frontend-codestyle-reviewers
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
Regressions: 1990504
No longer regressions: 1990504
QA Whiteboard: [qa-triage-done-c146/b145]
Blocks: 1996847
No longer blocks: srd-2025
Depends on: 2004061
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: