This recently bit me. No automated testing, so it broke production code.<p>You can brag about your automation, when it is well tested.<p><a href="https://github.com/cloudflare/workers-types/issues/116" rel="nofollow">https://github.com/cloudflare/workers-types/issues/116</a>
Generated types are much better than manually-updated types when you've got a source of truth that lives in a different codebase, but I can't help feel like we could do better. I wish there were a "lingua franca" for type declarations that could be understood directly by different languages. Not only would you avoid the mess that is generated source code, but it could be a n^2 -> 2n situation, like LLVM and LSP, where you only have to translate to and from this common ground instead of to and from every combination of leaves.<p>Unfortunately it might be pretty challenging given how different type systems can be. But maybe if you started with a subset of popular languages that have similar-enough type concepts?
This is nice. I started to learn Cloudflare Workers a few months ago, and used TypeScript for my project. Since I was to this platform, I relied heavily on the TS types and tab completion in my IDE to explore the APIs and to make sure I was using them correctly. Unfortunately there were several gaps which lead to a less-than-ideal development experience and general confusion.
Generated types are fine (if a bit cumbersome) when you trust input. When you don’t, “parse [don’t validate]” and produce static types at the place where input becomes a known quantity.