# What changed in zod-compiler

> 40 changes in zod-compiler 1 to 2 from its official release notes, upgrade guides and advisories: 4 breaking, 2 new APIs and options. Each one cited. Sources checked 2026-10-31. HTML: https://unstale.sh/npm/zod-compiler/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## zod-compiler 2

### Breaking changes

- Callbacks that return a Promise now throw. (2.0.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.3)
- Extraction refuses zod versions below 4.5; jit and the build plugin warn once. (2.0.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.3)
- Requires zod >=4.5.0; the peer range moved from ^4.0.0 to ^4.5.0. Stay on 1.x for older Zod. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)

### Performance

- A fast check is installed as .is() for records and loose or catchall objects. (2.0.7) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.7)
- Self-recursive root schemas are built in the single-pass build path. (2.0.7) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.7)
- The static filter skips transpilation for files with an obvious schema export. (2.0.7) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.7)
- z.url() is built in the single-pass build path and checked with URL.canParse. (2.0.7) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.7)
- Build-path properties are checked cheapest-first to improve performance. (2.0.2) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.2)
- Settled guards are skipped in dispatched options to improve performance. (2.0.2) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.2)
- .is() remains total over defaults. (2.0.2) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.2)
- Record and stringbool guards are short-circuited, improving performance. (2.0.1) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.1)
- Union tags are switched on directly, improving performance. (2.0.1) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.1)
- Email validation scans linearly, improving performance. (2.0.1) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.1)

### Fixes and other changes

- Finalizing .error issues copies them instead of deleting input, avoiding mutation of the input. (2.0.7) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.7)
- The slow walk no longer writes into arrays, records or tuples supplied by the caller. (2.0.5) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.5)
- Set, map and discriminated union outputs now carry a member's replacement. (2.0.5) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.5)
- A preprocessed rewriting schema is now checked against the value it rewrote. (2.0.5) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.5)
- Failed union options no longer contribute their output to the union's result. (2.0.5) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.5)
- Avoids unhosted recursive fast checks after rollback. (2.0.4) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.4)
- Object properties are read from the original input, and loose and catchall outputs are rebuilt in zod's key order. (2.0.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.3)
- Sized integer formats outside the safe range now report zod's safe-integer issue. (2.0.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.3)
- Abort state is preserved through delegates, template literals and nested superRefines, allowing union pruning to work correctly. (2.0.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.3)
- Snapshots key presence before an absent-key property runs. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Matches Zod 4.5 behavior for code-point lengths, URL guarding, partial records, and non-finite received values. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Serves Zod's prototype methods when a compile-on-read accessor is stranded. (1.26.4, 2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0), [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.26.4)
- A discriminated-union miss lists dispatch values as options, matching Zod 4.5. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Matches Zod 4.5 multipleOf, credit-card, and fractional-length semantics. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Matches Zod 4.5 object, record, catch, and error-map semantics. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Keeps __proto__ out of loose, catchall, and record outputs. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Delegates symbol-keyed shapes and record key issues inside intersections. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Mirrors Zod 4.5 tuple issue order, preprocess aliasing, and short-input builds. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Follows Zod 4.5's optin ladder for tuples, optional values, and absent object keys. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Refreshes the well-known regex table for Zod 4.5. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)
- Delegates loose records so unrecognized keys pass through. (2.0.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v2.0.0)

## zod-compiler 1

### Breaking changes

- Callbacks whose source is not a function expression are rejected. (1.26.4) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.26.4)

### New APIs and options

- The parallel option runs transforms on worker threads. (1.28.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.28.0)
- Adds an automatic Node.js JIT registration hook. (1.27.0) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.27.0)

### Fixes and other changes

- Exports that throw when probed are skipped instead of causing the build to fail. (1.26.4) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.26.4)
- Transforms whose signature proves they read Zod's parse context are delegated to Zod. (1.26.4) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.26.4)
- The compiled IIFE is emitted after a self-referential declaration rather than inside its initializer. (1.26.3) — [release notes](https://github.com/gajus/zod-compiler/releases/tag/v1.26.3)
