Ever since bridge development started (around TS
3.6 3.2) multiple new versions of TypeScript have been release, which offer new language features.
- Work through the release notes (3.7, 3.8, 3.9; to some degree also 3.3, 3.4, 3.5, 3.6), identify notable changes (e.g. "optional chaining")
- apply changes to the bridge code base, clustered by feature change (e.g. change all places at once where "optional chaining" can help us)
Identified features to try (see thoughts in the comments)
- optional chaining: foo?.bar?.baz https://gerrit.wikimedia.org/r/599928
- nullish coalescing: foo ?? bar() https://gerrit.wikimedia.org/r/599928 (same change)
- type-only imports+exports: import type Foo from "foo"
- // @ts-expect-error: compile-time assert that the next line is an error
- assertion signatures: asserting type guards https://gerrit.wikimedia.org/r/599929
- readonly arrays and tuples: declare members/params/variables as readonly X https://gerrit.wikimedia.org/r/599353
the Omit helper type: Omit<TypeName, "memberName">