[meta] Enable TypeScript for all of browser/components/sessionstore
Categories
(Firefox :: Session Restore, task)
Tracking
()
People
(Reporter: dao, Assigned: dao)
References
Details
(Keywords: meta)
This effort puts every module in browser/components/sessionstore under the tree's TypeScript setup and checks it in CI. The directory is Session Restore, which tracks the windows, tabs and tab groups a user has open, persists that state to disk, and puts it back when Firefox starts again or when the user reopens something they closed. It has twenty modules; the last is a single 9.2k-line one that holds the session state in memory and exposes the API the rest of the front-end calls. The state itself is a JSON tree assembled piecemeal across those modules. A schema validates it on the way to disk, and nothing checked the code that builds it.
None of the machinery is new. Mark Banner built the tree-wide TypeScript linter that checks every component, the compiler settings and the convention for declaring types a checker cannot otherwise see, all for the address bar. This effort follows that road.
What type checking has caught
This is a running list, not a comprehensive audit.
- Bug 2067051 - Session Restore debug logging never runs in SessionSaver, because Log.Logger has no way to test its effective level
- Bug 2067068 - "Reopen All Tabs" throws a TypeError when the list includes tabs from closed windows
- Comments named an open tab where the value is a closed one. Session Restore keeps records of closed tabs and groups that resemble the live ones and are not interchangeable with them. Nothing was broken, but a reader following the comment would have been.
- Bug 2076655 - Remove
userTypedClearfrom the lazy tab state - Bug 2076678 - Reopen Closed Tab fails after deleting a saved tab group
- Bug 2076724 - Reopen Closed Tab fails after reopening a closed tab group's tabs one at a time
- Bug 2081861 - Recently Closed Tabs doesn't show closed tab groups from the current window when browser.sessionstore.closedTabsFromAllWindows is false
Progress at a glance
| Phase | Goal | Bug | Status |
|---|---|---|---|
| 0 | Convert SessionStore to a modern class | bug 1892761 | DONE |
| 1 | Complete the documentation and publish an API reference | bug 2065591 | DONE |
| 2 | Land the project file green and wire the CI check | bug 2065637 | DONE |
| 3 | Write the session state shapes down as checkable types | bug 2065800, bug 2088936 | DONE |
| 4 | Fix the debug logging that never ran | bug 2067051 | DONE |
| 5 | Type the lazily-imported modules | bug 2066120 | DONE |
| 6 | Finish typing the lazily-imported modules | bug 2067072 | DONE |
| 7 | Adopt the tab strip's shared element declarations | bug 2069194 | DONE |
| 8 | Build closed and saved tab groups as one shape | bug 2069783 | DONE |
| 9 | Type-check the recently-closed menus | bug 2065811 | DONE |
| 10 | Name the option bags the public methods take | bug 2069784, bug 2075123 | DONE |
| 11 | Type the event and observer entry points | bug 2074387 | DONE |
| 12 | Type the closed tab records | bug 2074385 | DONE |
| 13 | Type the window and browser handles | bug 2074386 | DONE |
| 14 | Type the window geometry restore | bug 2074389 | DONE |
| 15 | Name the restore options | bug 2077436 | DONE |
| 16 | Type the restore history options and the window restoring flag | bug 2077435 | DONE |
| 17 | Take the main module off the exclusion list and under the CI check | bug 2074388 | DONE |
| 18 | Keep SessionStore's window IDs out of expandos on the window | bug 2078286 | DONE |
| 19 | Type-check aboutSessionRestore.js | bug 2078351 | DONE |
| 20 | Type-check the closed data source reads | bug 2079177 | DONE |
| 21 | Replace the frozen forwarding objects with classes | bug 2079201 | DONE |
| 22 | Type the browser windows as BrowserWindow |
bug 2079204 | DONE |
| 23 | Convert SessionStartup to a class | bug 2079203 | DONE |
| 24 | Convert StartupPerformance to a class | bug 2079202 | DONE |
References
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
Description
•