Packages
ArkType 3.0 & @ark/aot: Build-Time Precompilation, MCP JSON Schema, and Zod 4 Migration
ArkType 3.0 is generally available as of December 3, 2026, introducing @ark/aot build-time precompilation that shrinks login-form bundles to 0.92 kB gzipped and runs 11x faster than Zod 4. This breakdown covers Standard JSON Schema support for MCP SDK and AI SDK tool definitions, breaking ESM and Infinity changes, and a step-by-step migration checklist.
9 min read
ArkType 3.0 & @ark/aot: Build-Time Precompilation, MCP JSON Schema, and Zod 4 Migration
Executive Summary
- Featured Package & Ecosystem:
arktype(TypeScript / JavaScript, npm registry, MIT License, 3 runtime dependencies). - Latest Release & Verification Date: ArkType 3.0 reached general availability on December 3, 2026 (ArkType 3.0 Announcement), alongside pre-release
3.0.0-rc.12tags on GitHub and2.2.10/3.0.0rollout across npm mirrors as of December 3, 2026 (GitHub Releases, npm). - AI & MCP Relevance: Every
Typeimplements Standard Schema and Standard JSON Schema (toJsonSchemafor Draft 2020-12, Draft-07, OpenAPI 3.0, and OpenAPI 3.1;fromJsonSchemafor round-tripping Zod or plain JSON Schema). When precompiled with@ark/aot, the build preserves static JSON Schema metadata so the MCP SDK, AI SDK, and OpenAPI generators consume tool schemas with zero runtime generation overhead (ArkType 3.0 Announcement). - Headline Benchmarks: On ArkType's November 19, 2026
@ark/aotbenchmark suite, precompiled ArkType 3.0 runs 11x faster than Zod 4 (median of 32 scenarios), ships a 19x smaller gzipped bundle on Valibot's login form (0.92 kBvs.25.1 kBfor Zod 4), and executes 44x fewer startup instructions (ArkType). - Primary Upgrade Takeaway: Teams on Node.js 20.19+ or 22.12+ (or ESM-native runtimes) can adopt
arktype3.0 and@ark/aotincrementally—or migrate Zod schemas vianpx arktype migrateand thearktypeio/arktypeagent skill—while watching for breaking changes around ES-module-only packaging andInfinityrejection onnumber.
Adoption Telemetry & Version Changelog
Runtime validation in TypeScript has historically forced a trade-off between developer ergonomics, static type inference, bundle weight, and runtime throughput. ArkType (github.com/arktypeio/arktype) bridges static TypeScript syntax and runtime validation in a single definition, and its 3.0 milestone arrives amid substantial npm adoption and active maintenance.
| Telemetry Metric | Verified Value | Source & Verification Date |
|---|---|---|
npm Weekly Downloads (arktype) |
2,759,762 / week |
npm (verified Dec 3, 2026) |
| GitHub Stars / Forks | 7.9k stars / 185 forks |
GitHub (verified Dec 3, 2026) |
| Direct Dependencies / Dependents | 3 dependencies / 605 dependents |
npm (verified Dec 3, 2026) |
Companion @ark/attest Downloads |
140,646 / week (v0.58.0) |
npm @ark/attest (verified Dec 3, 2026) |
| License & Module Format | MIT License, ES Modules only | ArkType Migrating Docs |
Minimum Node.js (for CJS require) |
Node 20.19, 22.12, or later |
ArkType Migrating Docs |
Key Milestones Leading to 3.0
- Pre-release Stabilization (
3.0.0-rc.8through3.0.0-rc.12, late November 2026): In the final release-candidate cycle, the maintainers standardized the CLI underark(npx arktype init,migrate,skill,check), added per-scopeambientconfiguration, introduced form-oriented keywords (string.nonblank,string.url.http), and resolved an npm provenance upload issue inrc.11by republishing the synchronized six-package release set in3.0.0-rc.12(GitHub Releases). - Dynamic Engine Speedups (10x over 2.2): Even without build-time precompilation, dynamic
Typedefinitions in ArkType 3.0 defer compilation until first use and compute error issue objects lazily only when inspected. According to the release post, dynamic ArkType 3.0 validatesmoltar's strict benchmark cases roughly 10x faster than version 2.2 (ArkType 3.0 Announcement). - Build-Time Precompilation (
@ark/aot): Announced alongside 3.0 GA on December 3, 2026,@ark/aotintegrates viaunplugin(@ark/aot/unpluginfor Vite, Rollup, webpack, and esbuild) to compileTypedefinitions ahead of time into minimal standalone validator functions, eliminating parser and schema-graph initialization from client bundles (ArkType 3.0 Announcement). - AI & Agent-First Tooling: ArkType 3.0 ships an official agent skill (
npx skills add arktypeio/arktype), Markdown documentation atarktype.io/llms.txt, andnpx arktype migrateto guide AI coding agents through automated Zod-to-ArkType conversions and parity checks (Best of JS, ArkType Migrating Docs).
Security, Breaking Changes & Internals
Supply-Chain Footprint & Security Posture
Dependency hygiene is critical for validation libraries because they sit directly on untrusted network, webhook, and LLM tool-call boundaries:
- Minimal Dependency Tree:
arktypedeclares only 3 dependencies on npm and ships under the permissive MIT License (npm, Best of JS). - Core Advisory Record: As of December 3, 2026, no CVEs or GitHub Security Advisories (GHSAs) are recorded against the core
arktypepackage. By comparison,zodpatchedGHSA-mrhx-c7xc-m3w5(CVE-2023-54404, CVSS 7.5) in version4.6.6in October 2026 (Issoh Tech / GHSA-mrhx-c7xc-m3w5). - Adapter Supply-Chain Caution: In May 2026, an OIDC trusted-publisher compromise (
CVE-2026-45321/GHSA-g7cv-rxg3-hmpx, CVSS 9.6) injected credential-stealing malware into 42@tanstack/*packages, including@tanstack/arktype-adapter(1.166.12and1.166.15, patched in1.166.16) (GHSA-g7cv-rxg3-hmpx, Tenable). Whilearktypecore was unaffected, teams using framework adapters should pin exact versions inpackage-lock.jsonorpnpm-lock.yamland enforce npm provenance checks.
Breaking Changes in ArkType 3.0
Before upgrading from 2.x or migrating from Zod, review these behavioral changes documented in the 3.0 release notes and migration guide:
numberNow RejectsInfinity: PreviouslynumberrejectedNaNwhile permittingInfinityand-Infinity. In 3.0,numberrejectsInfinityby default; projects that rely on infinite bounds must opt intonumberAllowsInfinity(ArkType 3.0 Announcement).- ES Modules Only: ArkType ships strictly as ESM. CommonJS applications cannot
require("arktype")on older Node.js releases and must run Node20.19,22.12, or newer with nativerequire(esm)support (ArkType Migrating Docs). @ark/aotPrecompilation Constraints: Standalone precompiled validators omit dynamic introspection methods such as.select()on union branches. Runningnpx arktype check "src/**/*.ts"flags any definitions that@ark/aotcannot statically precompile before you enable the bundler plugin (ArkType 3.0 Announcement, ArkType Migrating Docs).- Error Cardinality & Mutation Opt-Ins: New runtime options—
errors: "first"(halt at first error),errors: "none"(return a single generic invalid message), andmutatesInput(transform in place instead of cloning)—are opt-in via dedicated imports so unused code paths stay tree-shaken out of production bundles (ArkType 3.0 Announcement).
Code Walkthrough: @ark/aot, Bidirectional Codecs & MCP JSON Schema
The snippet below illustrates three core 3.0 capabilities: defining a schema with "@" metadata for AI/MCP tool consumption, using a bidirectional codec (string.date.iso.parse) that supports .encode(), and enabling the @ark/aot Vite plugin:
// 1. vite.config.ts — Enable build-time precompilation
import { precompile } from "@ark/aot/unplugin";
export default {
plugins: [precompile.vite()],
};
// 2. schema.ts — Define a Type with metadata, codecs, and JSON Schema
import { type } from "arktype";
export const ScheduleEvent = type({
title: "string.nonblank",
webhookUrl: "string.url.http",
startsAt: "string.date.iso.parse",
"@": "Calendar event payload for MCP tool execution",
});
// Validate incoming ISO string -> Date object
const parsed = ScheduleEvent({
title: "Release Review",
webhookUrl: "https://example.com/hooks/release",
startsAt: "2026-12-03T12:00:00Z",
});
if (parsed instanceof type.errors) {
console.error(parsed.summary);
} else {
// Bidirectional codec: encode Date back to ISO string
const encoded = ScheduleEvent.encode(parsed);
console.log(encoded);
}
// Export JSON Schema Draft 2020-12 or OpenAPI 3.1 for MCP / AI SDK
const mcpToolSchema = ScheduleEvent.toJsonSchema({ target: "draft-2020-12" });
Because every Type exposes Standard Schema and Standard JSON Schema, passing ScheduleEvent directly into the MCP SDK (@modelcontextprotocol/sdk) or Vercel AI SDK works without extra wrapper adapters, and fromJsonSchema lets teams ingest external Zod or OpenAPI schemas into ArkType's set-algebra methods (.extends(), .equals(), .overlaps(), .and(), .or()) (ArkType 3.0 Announcement).
Ecosystem Comparison & Upgrade Checklist
TypeScript Validation Packages Compared
The metrics below combine npm registry data, Socket.dev/Snyk telemetry, and the November 19, 2026 benchmark suite published on arktype.io (measuring @ark/aot default builds against competing libraries on identical schemas):
| Feature / Metric | arktype 3.0 (@ark/aot) |
zod (4.6.7) |
valibot (1.5.0) |
typia (AOT) |
|---|---|---|---|---|
| License & Deps | MIT / 3 deps | MIT / 0 deps | MIT / 0 deps | MIT / AOT transform |
| npm Weekly Downloads | 2.76M (npm) |
267M–475M (Socket, Snyk) |
Modular core + @valibot/to-json-schema (9.49M/wk) |
Compiler-plugin ecosystem |
| Login Form Gzipped Size | 0.92 kB (1.19 kB benchmark suite) |
25.1 kB (24.7 kB benchmark suite) |
Tree-shakeable modular | 1.52 kB |
| Validation Latency | 123 ns (8.1M ops/sec; 658 CPU instr.) |
2,012 ns (10,044 CPU instr.) |
1,875 ns (5,647 CPU instr.) |
794 ns (2,097 CPU instr.) |
| Startup Instructions | 380 instructions |
895k instructions |
14,801 instructions |
N/A in suite |
| JSON Schema & MCP SDK | Built-in Standard JSON Schema + AOT preservation | Built-in JSON Schema (4.x) |
Separate @valibot/to-json-schema |
Compile-time generation |
| Module Format | ESM only (Node 20.19+ / 22.12+ for CJS require) |
ESM + CommonJS | ESM + CommonJS | TypeScript transformer |
Note on benchmark methodology: The speed, bundle size, and startup instruction figures above are reported by ArkType's public benchmark harness comparing @ark/aot against Zod 4, Valibot, TypeBox (3,207 ns / 4,273 startup instructions), and Typia as of November 19, 2026 (ArkType). Independent workloads with heavy custom refinements or dynamic runtime-constructed schemas will exhibit narrower margins than static login-form schemas.
Safe Upgrade & Migration Checklist
- Audit Runtime & Module Compatibility: Confirm your deployment targets Node.js
20.19+,22.12+, or an ESM-native runtime (Bun, Deno, Cloudflare Workers, modern browsers) before upgrading toarktype3.0 (ArkType Migrating Docs). - Pre-Flight Check Dynamic Definitions: Run
npx arktype check "src/**/*.ts"to identify any dynamicTypedefinitions,.select()calls, or unsupported patterns before wiring@ark/aot/unplugininto Vite or webpack (ArkType 3.0 Announcement). - Review Numeric & Locale Defaults: Audit numeric validators where
Infinitywas previously accepted and switch tonumberAllowsInfinityif needed. Configureenordelocales orerrors: "first"only where desired (ArkType 3.0 Announcement). - Verify Lockfile & Adapter Pins: Pin
arktype,@ark/aot, and any framework adapters (such as@tanstack/arktype-adapter >= 1.166.16) in your lockfile with provenance verification enabled (GHSA-g7cv-rxg3-hmpx). - Run Parity Tests After Zod Migration: If using
npx arktype migrateornpx skills add arktypeio/arktype, verify edge-case inputs—especiallyundefineddefaults in.required()and stripped undeclared keys—against your existing test suite (ArkType Migrating Docs).
FAQ
1. Does ArkType 3.0 require @ark/aot to run?
No. @ark/aot is an optional build-time precompiler (unplugin) that compiles Type definitions ahead of time for maximum speed (123 ns) and minimal bundle size (0.92 kB gzipped). Dynamic ArkType 3.0 works standalone without a bundler plugin and still runs roughly 10x faster than ArkType 2.2 on moltar's strict benchmark cases.
2. How does ArkType 3.0 work with the MCP SDK and Vercel AI SDK?
Every ArkType Type implements both Standard Schema and Standard JSON Schema. When precompiled with @ark/aot, the build embeds the generated JSON Schema alongside the validator so @modelcontextprotocol/sdk, Vercel's AI SDK, and OpenAPI generators read tool input schemas directly without shipping ArkType's full runtime parser.
3. What is the biggest breaking change when upgrading from ArkType 2.2 to 3.0?
Two changes catch most teams off guard: number now rejects Infinity (requiring numberAllowsInfinity if infinite numbers are valid), and ArkType ships strictly as ES modules, meaning CommonJS codebases need Node.js 20.19, 22.12, or later for require(esm) support.
4. Can ArkType 3.0 interoperate with existing Zod schemas?
Yes. Through fromJsonSchema, ArkType 3.0 can ingest Standard JSON Schema outputs—including schemas exported from Zod 4—into a Type, allowing you to compare, intersect, or combine them using .extends(), .equals(), .overlaps(), .and(), and .or().
5. Should existing Zod 4 projects migrate immediately?
If your backend services already run smoothly on Zod 4.6.7 and bundle size or cold-start instruction count is not a bottleneck, there is no security urgency to switch. Migration delivers the highest return in client-side bundles, edge functions, and high-throughput MCP/AI tool-calling pipelines where 0.92 kB gzipped size and 380 startup instructions materially improve latency.
Sources
- ArkType 3.0 Official Release Post — Announcing ArkType 3.0 (
https://arktype.io/docs/blog/3.0), published December 3, 2026. - ArkType Homepage & Benchmark Suite — ArkType: TypeScript's smallest, fastest validator (
https://arktype.io/), benchmarks dated November 19, 2026, accessed December 3, 2026. - ArkType Migration Documentation — Migrating to ArkType (
https://arktype.io/docs/migrating), accessed December 3, 2026. - ArkType GitHub Repository & Releases — arktypeio/arktype (
https://github.com/arktypeio/arktype,https://github.com/arktypeio/arktype/releases), releases through3.0.0-rc.12, accessed December 3, 2026. - npm Registry Package Page — arktype on npm (
https://www.npmjs.com/package/arktype), weekly downloads and dependency metadata verified December 3, 2026. - GitHub Security Advisory — Malware in @tanstack/ packages (
CVE-2026-45321/GHSA-g7cv-rxg3-hmpx)* (https://github.com/advisories/GHSA-g7cv-rxg3-hmpx), published May 11, 2026. - Socket.dev & Snyk Security Database — Zod package telemetry (
https://socket.dev/npm/package/zod,https://security.snyk.io/package/npm/zod), accessed December 3, 2026.