Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of the big features of TypeScript, is that it can infer types based on context. This is powerful, but it comes at a cost. Determining types based on inference consumes much more resources than using a type annotation. This is an important reason to add explicit type annotations.
We heavily rely on Zod though. Zod is powerful, but it heavily relies on inference. This means that by using Zod, we sacrifice type checking performance. Zod 4 will supposedly be more performant. This is great, but by definition it can’t be as performant as regular types.
When the types become really complex, TypeScript may error on this. An explicit type annotation in the right spot fixes this. This PR uses this to resolve the type error. I can’t explain why this surfaced here, but not in our internal repos these schemas originate from.