unstale

npm / zod-compiler

zod-compiler

What changed in zod-compiler 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-31.

4 breaking2 new APIs and options10 performance24 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

zod-compiler 234 changes

Breaking changes 3

  • Callbacks that return a Promise now throw.

    2.0.3release notes

  • Extraction refuses zod versions below 4.5; jit and the build plugin warn once.

    2.0.3release notes

  • 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.0release notes

Performance 10

  • A fast check is installed as .is() for records and loose or catchall objects.

    2.0.7release notes

  • Self-recursive root schemas are built in the single-pass build path.

    2.0.7release notes

  • The static filter skips transpilation for files with an obvious schema export.

    2.0.7release notes

  • z.url() is built in the single-pass build path and checked with URL.canParse.

    2.0.7release notes

  • Build-path properties are checked cheapest-first to improve performance.

    2.0.2release notes

  • Settled guards are skipped in dispatched options to improve performance.

    2.0.2release notes

  • .is() remains total over defaults.

    2.0.2release notes

  • Record and stringbool guards are short-circuited, improving performance.

    2.0.1release notes

  • Union tags are switched on directly, improving performance.

    2.0.1release notes

  • Email validation scans linearly, improving performance.

    2.0.1release notes

Fixes and other changes 21

  • Finalizing .error issues copies them instead of deleting input, avoiding mutation of the input.

    2.0.7release notes

  • The slow walk no longer writes into arrays, records or tuples supplied by the caller.

    2.0.5release notes

  • Set, map and discriminated union outputs now carry a member's replacement.

    2.0.5release notes

  • A preprocessed rewriting schema is now checked against the value it rewrote.

    2.0.5release notes

  • Failed union options no longer contribute their output to the union's result.

    2.0.5release notes

  • Avoids unhosted recursive fast checks after rollback.

    2.0.4release notes

  • Object properties are read from the original input, and loose and catchall outputs are rebuilt in zod's key order.

    2.0.3release notes

  • Sized integer formats outside the safe range now report zod's safe-integer issue.

    2.0.3release notes

  • Abort state is preserved through delegates, template literals and nested superRefines, allowing union pruning to work correctly.

    2.0.3release notes

  • Snapshots key presence before an absent-key property runs.

    2.0.0release notes

  • Matches Zod 4.5 behavior for code-point lengths, URL guarding, partial records, and non-finite received values.

    2.0.0release notes

  • Serves Zod's prototype methods when a compile-on-read accessor is stranded.

    1.26.4, 2.0.0release notesrelease notes

  • A discriminated-union miss lists dispatch values as options, matching Zod 4.5.

    2.0.0release notes

  • Matches Zod 4.5 multipleOf, credit-card, and fractional-length semantics.

    2.0.0release notes

  • Matches Zod 4.5 object, record, catch, and error-map semantics.

    2.0.0release notes

  • Keeps __proto__ out of loose, catchall, and record outputs.

    2.0.0release notes

  • Delegates symbol-keyed shapes and record key issues inside intersections.

    2.0.0release notes

  • Mirrors Zod 4.5 tuple issue order, preprocess aliasing, and short-input builds.

    2.0.0release notes

  • Follows Zod 4.5's optin ladder for tuples, optional values, and absent object keys.

    2.0.0release notes

  • Refreshes the well-known regex table for Zod 4.5.

    2.0.0release notes

  • Delegates loose records so unrecognized keys pass through.

    2.0.0release notes

zod-compiler 16 changes

Breaking changes 1

  • Callbacks whose source is not a function expression are rejected.

    1.26.4release notes

New APIs and options 2

  • The parallel option runs transforms on worker threads.

    1.28.0release notes

  • Adds an automatic Node.js JIT registration hook.

    1.27.0release notes

Fixes and other changes 3

  • Exports that throw when probed are skipped instead of causing the build to fail.

    1.26.4release notes

  • Transforms whose signature proves they read Zod's parse context are delegated to Zod.

    1.26.4release notes

  • The compiled IIFE is emitted after a self-referential declaration rather than inside its initializer.

    1.26.3release notes