~/talk

Composing an API the *right* way

Talkat Droidcon London 2023 · 2023-10-26..10-27· [api-design]
slides:none on file

Google's Compose guidelines condense ~13,000 words and recommend concrete rules: composable functions either emit UI (use UpperCamelCase nouns) or return values (lowercase); components emit a single root node and return Unit; accept a modifier as first optional parameter and apply it to the root; order parameters as required, modifier, then trailing content slot; avoid exposing MutableState — pass plain values plus callbacks or a state holder with a factory; use slot APIs and movableContentOf to avoid unnecessary recomposition; use KtLint/Detekt rules from the Compose rules fork.

AI-written summary · about

  1. 0:00Introduction to API design
  2. 1:50Google’s Compose API guidelines
  3. 3:56Naming conventions in Compose
  4. 8:17Components and single root nodes
  5. 11:04Stateful vs stateless components
  6. 13:51Composition locals vs parameters
  7. 15:35Default arguments and null values
  8. 17:39Grouping default values
  9. 19:24Modifiers in Compose
  10. 21:11Modifier parameter best practices
  11. 25:01Slot APIs and content passing
  12. 28:11Movable content optimization
  13. 30:19Parameter ordering rules
  14. 33:09Handling state in components
  15. 36:19State holders and simplification
  16. 39:09Tools and resources summary
~/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.