~/talk

Behind the Scenes: Discussing One of the Most Interesting TypeScript 4.9 Features

Talkat JetBrains JavaScript Day 2022 · on Thursday, 2022-11-10· [typescript, developer-experience]
links:none on file
slides:none on file

TypeScript 4.9 adds the satisfies operator which checks that a value conforms to a type while preserving the value’s literal shape so literal properties and string literal types survive assignment and IDE features work. It covers three of five proposed use cases so safe upcast was dropped, and it fixes real issues like keeping Next.js getStaticProps typings correct without changing framework types. IDEs use contextual typing to offer completion navigation and rename on these expressions and the feature behaves differently from as casts.

AI-written summary · about

  1. 0:00TypeScript 4.9's satisfies operator
  2. 1:10Problem with any and unsafe casts
  3. 3:21Satisfies solves type safety
  4. 8:15Contextual typing in TypeScript
  5. 10:43Satisfies operator use cases
  6. 14:14Next.js real-world example
  7. 17:02Syntax and semantics of satisfies
  8. 20:19IDE support benefits
  9. 23:51Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.