You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users (typically users who don't yet use TypeScript) are running into problems due to misconfigurations of their Contentlayer config (especially in regards to the content schema). Additionally to the safety provided by TypeScript, we should also implement a runtime validation step to avoid undefined runtime errors.
Technical notes
Ideally we should figure out a way how to derive Zod-like validation logic based on the existing TypeScript definitions. We could also investigate to use TS+ for this.
You're likely talking about a different layer here, just FYI. As a contentlayer user I would certainly prefer well-known and tested zod schemas over custom type definitions within defineDocumentType: https://www.contentlayer.dev/docs/reference/source-files/field-types
-1 DSL to learn is a big deal.
+1 if you could generate zod schemas then we can just infer types from that and we'd also be able to insert the schemas in the .input and .output of trpc routers:
Some users (typically users who don't yet use TypeScript) are running into problems due to misconfigurations of their Contentlayer config (especially in regards to the content schema). Additionally to the safety provided by TypeScript, we should also implement a runtime validation step to avoid undefined runtime errors.
Technical notes
Ideally we should figure out a way how to derive Zod-like validation logic based on the existing TypeScript definitions. We could also investigate to use TS+ for this.
Related issues
The text was updated successfully, but these errors were encountered: