new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Zod · all subjects

zod 4 changes

11 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Zod 4 is a ground-up rewrite with few breaking changes for typical users

Zod 4 will be a ground-up rewrite of the library with few breaking changes for typical users, dramatic speed improvements, a simpler internal structure, and a big slate of new features. Most Zod users will not be affected by breaking changes, though libraries in Zod's ecosystem that rely on internal APIs will need to be updated.

ZodType subclasses will be split or consolidated in Zod 4

To simplify the codebase and enable easier code generation tooling, some subclasses of ZodType will be split or consolidated in Zod 4.

The _parse method signature will change in Zod 4

To improve performance, the signature of the (quasi-)internal _parse method will be changed in Zod 4. Any user-defined subclasses of ZodType will need to be updated accordingly.

Internal methods and properties will be made protected in Zod 4

To clean up autocompletion in Zod 4, some internal methods and properties will be made protected. Some current APIs will be deprecated; some deprecated APIs will be removed.

Generic class signatures will be changed for TypeScript server performance in Zod 4

To improve TypeScript server performance, some generic class signatures such as ZodUnion will be changed or simplified in Zod 4. Other type utilities will be re-implemented for efficiency, but may result in marginally different behavior in some contexts.

Zod 3 was the current major version as of June 2024

Zod version 3 was released in 2021 and was the current major version as of June 2024. It received 23 minor releases with new features and enhancements, with no breaking changes to the public API.

Zod 3.23 was the final 3.x version

Zod 3.23 is the final version of the 3.x release series.

Codecs introduced in Zod 4.1

Codecs were introduced in zod@4.1. They enable bidirectional transformations between two schemas.

Zod 4 is stable with release notes and migration guide

Zod 4 is stable. The release notes are available at /v4 and the migration guide is available at /v4/changelog.

brand() direction parameter requires Zod 4.2+

By default, only the output type is branded. Pass a second generic to .brand() to specify the direction (requires Zod 4.2+): z.string().brand<"Cat", "out">() brands output (default), .brand<"Cat", "in">() brands input, .brand<"Cat", "inout">() brands both.

Zod 4 closes 9 of 10 most upvoted open issues

Zod 4 closes 9 of Zod's 10 most upvoted open issues on GitHub, addressing long-standing design limitations.

Give your agent this brain