At Grammarly, we have tried different approaches to handle behavioral complexity. We made a long journey from callback hell to FRP, and from dynamic to static typing. We will discuss how FRP helped us build stable high-loaded front-end applications with complex async actions for millions of daily users.
11. Where it comes from
• => Historically - “front-end is simple”
12. Where it comes from
• Historically - “front-end is simple”
• => Incomplete requirements
13. Where it comes from
• Historically - “front-end is simple”
• Incomplete requirements
• => 3rd parties that force different approaches
14. Where it comes from
• Historically - “front-end is simple”
• Incomplete requirements
• 3rd parties that force different approaches
• => “Small” changes on the middle of development
15. Where it comes from
• Historically - “front-end is simple”
• Incomplete requirements
• 3rd parties that force different approaches
• “Small” changes on the middle of development
• => It just complex
16. Where it comes from
• Historically - “front-end is simple”
• Incomplete requirements
• 3rd parties that force different approaches
• “Small” changes on the middle of development
• It just complex
• => …
36. RP + FP
Deal with async data streams in a functional way:
• => pure function
37. RP + FP
Deal with async data streams in a functional way:
• pure function
• => immutable data
38. RP + FP
Deal with async data streams in a functional way:
• pure function
• immutable data
• => composability
39. RP + FP
Deal with async data streams in a functional way:
• pure function
• immutable data
• composability
+
40. FRP
“It’s a different way of thinking: the program is expressed
as a reaction to its inputs, or as a flow of data.”
Stephen Blackheath, Anthony Jones.
“Functional Reactive Programming.”
108. Further reading
• Reactive manifesto - https://www.reactivemanifesto.org
• The complexity trap - https://danielwestheide.com/blog/2018/12/07/the-complexity-
trap.html
• A quick introduction into FRP - https://medium.freecodecamp.org/functional-
reactive-programming-frp-imperative-vs-declarative-vs-reactive-style-84878272c77f
• Functional Reactive Programming, Stephen Blackheath and Anthony Jones
• Professor frisby's mostly adequate guide to functional programming
• https://github.com/gcanti/fp-ts
Поведенческая сложность возникает в момент взаимодействия модулей, но не когда вы читаете код, а когда они начинают посылать друг другу сообщения в рантайме.