ArkType 3.0 is a TypeScript validation library that turns type-like definitions into standalone validators during a build, aiming to combine speed, small output, and a developer-friendly syntax. The definitions and inferred TypeScript types remain unchanged; a bundler plugin or command generates the validators, while runtime parsing remains available for dynamic use. The release reports that precompiled ArkType beat Zod 4 in all 32 validation benchmarks, by a median of 15 times, and beat Zod’s compiled validators by a median of 5.3 times. Across another benchmark set, it averaged 658 CPU instructions per validation, compared with Typia’s 2,097, and produced a 1.19 kB gzipped validator versus Typia’s 1.52 kB. It also emphasizes quick startup, TypeScript-checked definitions, and errors that explain how to fix unsupported precompilation cases.
The release provides an agent-assisted migration path from Zod, including tests that compare uncovered inputs against the original schemas. ArkType supports familiar integrations through Standard Schema and can convert Zod or JSON Schema definitions for compatibility checks between API versions. Migration still requires attention: validation is synchronous, some Zod defaults and optional-property behavior differ, and cross-field checks run only after individual fields pass. Custom messages can be preserved, but built-in wording may change. Precompiled validators cannot compose or offer runtime introspection and locales; definitions that depend on runtime values must remain dynamic or use the full-runtime build mode. Setup adds a build step, and shipping ArkType without precompilation increases its gzipped size.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.