1) Declaring functions with typed output and types on the arguments. This allows you to create large architectures with minimal confusion. It allowed me to write an OS in TypeScript.
2) Declaring message payloads as object interfaces. This imposes a set of predictability and consistency in your services. It's so obvious in hindsight, but before TypeScript I was putting all kinds of safe guards around my service payloads to account for unpredictability that really impacted how the application scaled.
I think where people discover the most challenges migrating to TypeScript is that it exposes some level of unnecessary complexity in prior practice and some people do incredibly weird things with their type definitions to make it feel more OOP.
- Engineers being more comfortable expressing the required business logic in the other languages they were working in then PL/pgSQL
- Challenging to write tests for the triggers
- Harder to deploy variations for testing if needed
Deleted Comment
How does this compare to rrweb[0], the library that Sentry and many other commercial offerings for frontend monitoring use?
[0]: https://www.rrweb.io/