Is using zod as the primary source of truth for Typescript types sensible/sustainable?

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • ts-json-schema-generator

    Generate JSON schema from your Typescript sources

  • We user ts-json-schema-generator to create the schemas directly from TS types.

  • typebox

    Json Schema Type Builder with Static Type Resolution for TypeScript

  • Surely you're aware of this library? It offers a validator faster than Ajv, A type system more flexible than Zod, is used by large ecosystem projects (gets 10 mill weekly downloads), does type inference better (i.e. recursive types), and is based on the JSON schema specification. It also ranks with the fastest validation solutions for JavaScript.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • typescript-runtime-type-benchmarks

    📊 Benchmark Comparison of Packages with Runtime Validation and TypeScript Support

  • I think it's more of a case of the extremely low performance bar that's been set by the status quo (for even the simplest of validation structures). There's been a lot of focus on the TS type inference, and less on the runtime performance (which actually matters more as it does reduce operational costs). It probably wouldn't be such an issue if the performance was reasonable, but I mean here's the full breakdown https://moltar.github.io/typescript-runtime-type-benchmarks/.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts