Best of zod — 2025

  1. 1
    Article
    Avatar of hnHacker News·47w

    Introducing Zod 4

    Zod 4 has been released, offering faster and more tsc-efficient performance along with several new features. It introduces improvements such as optimized parsing speeds, reduced tsc instantiations, and a smaller bundle size. Notable new capabilities include Zod Mini for strict bundle size projects, internationalization API, recursive objects, and enhanced error customization and JSON Schema conversion. Zod 4 also focuses on improving the user experience and scalability for larger codebases and schema libraries.

  2. 2
    Article
    Avatar of fullstackdeveloperFullstack Developer·1y

    Multi-Image Uploader for Next.js | Shadcn/ui | Zod

    Discover a compact, responsive file uploader for Next.js, built with shadcn/ui. It supports any file type, custom file limits, live previews, animations for deletions, is type-safe with Zod and React Hook Form, and is cloud-ready for S3/R2 via signed URLs. It's perfect for all screen sizes.

  3. 3
    Article
    Avatar of typescripttvTypeScript.TV·39w

    Why Write Validation Logic When Zod Can Do It Better?

    Zod is a TypeScript-first validation library that provides type-safe runtime validation with minimal boilerplate code. It offers features like safeParse for non-throwing validation, composable schemas for reusability, and automatic TypeScript type inference. Compared to manual validation approaches, Zod reduces repetitive code, improves maintainability, and provides a more declarative way to define data structures while ensuring both compile-time and runtime safety.

  4. 4
    Article
    Avatar of logrocketLogRocket·26w

    Why is Zod so slow?

    Zod's runtime interpretation architecture makes it significantly slower than AOT-compiled validators like Typia in high-throughput scenarios. While this performance gap is negligible for typical web applications, it becomes critical in systems handling billions of requests. The article explains the interpreter vs compiler trade-off and demonstrates a practical solution: using a build script to convert Zod schemas into optimized JSON Schema validators with ajv, achieving production performance while maintaining Zod's developer experience during development.

  5. 5
    Article
    Avatar of Marmelabmarmelab·24w

    From GraphQL to Zod: Simplifying Arte's API Architecture

    Marmelab helped Arte migrate from a complex GraphQL-based backend-for-frontend to a simpler REST API architecture using Zod for runtime type validation. The original GraphQL layer, implemented in 2017 to aggregate data across multiple platforms, had evolved into a REST API that internally used GraphQL.js, creating maintenance overhead and onboarding friction. By prototyping with the most complex endpoint first, the team discovered Zod could provide the same runtime type safety as GraphQL schemas while reducing architectural complexity. Key challenges included handling runtime validation, JSON serialization gotchas with undefined values, and filtering extra properties. Advanced patterns like using merge() instead of intersection() for discriminated unions proved essential. The migration reduced cognitive load while maintaining type safety, demonstrating that architectural decisions should evolve with project needs.

  6. 6
    Video
    Avatar of codingwithlewisCoding with Lewis·36w

    This JavaScript library changes EVERYTHING 💻

    Zod v4 introduces significant improvements to the popular JavaScript schema validation library, including a new Zod Mini version with functional tree-shakable API for reduced bundle sizes and JSON schema conversion capabilities. The library helps developers validate data structures like forms without writing multiple if statements, while providing static type inference. The new JSON schema feature enables easier creation of structured outputs for AI applications.