Seeking System Zen with Universal TypeScript

Seeking System Zen with Universal TypeScript

F147ad44f6ea0bb0c0b7ad1133aae0ca?s=128

Rachael McQuater

November 30, 2018
Tweet

Transcript

  1. 2.

    THE LIFE OF A FULL STACK DEV What kinds of

    problems do we have? ▸ Getting FE and BE to communicate ▸ Many external systems ▸ Keeping a big, polyglot stack running reliably
  2. 3.

    BUT WHAT KINDS OF PROBLEMS WOULD WE LIKE TO HAVE?

    ▸ Domain problems ▸ UX problems ▸ hard problems.
  3. 7.

    THE TROUBLE IS, WE'RE human. We are super terrible at

    enumerating all conditions. Consider: ▸ Edge cases ▸ Error states ▸ Future refactoring
  4. 10.

    SO, WE'VE GOT A COMMUNICATION GAP HERE Computers are good

    at... ▸ Fast calculations ▸ Big datasets Humans are good at... ▸ Pattern recognition
  5. 11.
  6. 12.

    SO WHEN ARE WE GONNA GET TO THE TYPESCRIPT? Right

    now! Let's talk about what TS is.
  7. 20.

    Instead of: ▸ first do A to x ▸ then

    do B to x ▸ evaluate x We say: ▸ y = f(g(x))
  8. 21.

    if... ▸ g(x) maps from verbalOrders to drinks, ▸ f(x)

    maps from drinks to baristaInstructions then... We can safely compose f(g(x)) & statically prove that our OrderTaker works.
  9. 25.
  10. 26.

    PICKING A FRAMEWORK The ideal framework for a type-first UI

    would: ▸ Declaratively generate UI ▸ Describe visual components as pure functions of inputs
  11. 27.
  12. 28.
  13. 29.
  14. 30.

    So, we have UI that takes tightly scoped types as

    inputs. What if we used our domain types as inputs to that UI?
  15. 37.
  16. 42.

    Thanks to: ▸ Drew Colthorp for sharing the tech stack

    & all the TS knowledge ▸ Atomic Object for being an awesome place full of awesome FP nerds ▸ The TypeScript Team for building a rad-as-heck language Rachael McQuater rachael.mcquater@atomicobject.com See also: https://github.com/atomicobject/ts-react-graphql-starter-kit https://github.com/atomicobject/ts-workshop