colinhacks/zod 9f0a3d81..60496a09
base and head as given
- Zod now offers ahead-of-time schema compilation.
- Classic and mini APIs now expose schema compilation.
- Compilation benchmarks were added to the benchmark suite.
- Compilation fuzzing was added to developer tooling.
- files changed
- 54
- in a component
- 34
- lines in components
- 5,846
- components
- 6
- public routes changed
- 0
- schema statements
- 0
- new dependencies
- 0
- excluded by role
- 20
Where to focus your review
- Review the new exported surface4 components with export changes. Check compatibility and intended visibility.
- Verify behavior in dependent codeFollow the import paths below and exercise the consumers they reach.
- Inspect the paths tracing stopped at3 changed symbols stopped at heavily imported files. Inspect their consumers separately.
Ahead-of-time schema compilation
Added- Before
- did not exist
- After
- Schemas can use generated fast paths
The explicit API returns generated validators for supported synchronous schemas and reports unsupported or asynchronous ones. An opt-in side-effect import applies compilation lazily and keeps unsupported schemas on runtime parsing.
In favour
- In favour: Unsupported child schemas remain runtime islands within compiled parents
- In favour: Global mode restores unsupported schemas to runtime parsing
Against
- Against: Explicit compilation depends on dynamic function construction in CSP-restricted environments
Compilation validation tooling
Added- Before
- did not exist
- After
- Fuzzing and benchmarks cover compilation
Maintainers can compare generated and runtime parser results using seeded randomized schemas, and benchmark compiled validation across representative schema shapes and ArkType.
In favour
- In favour: Seeds make differential-parser failures reproducible
- In favour: Benchmark correctness gates reject divergent compiled output
The model found nothing to weigh against this.
Inspect 4 source files behind this explanation
1 new dependency between components — Zod Source → Core Library
What else could behave differently
11 components · 125 filesThese components import changed code, directly or through other files. A traced dependency is a place to review, not a confirmed runtime failure. Some paths stopped at heavily imported files; inspect those consumers separately.
Reached 3
| Component | Symbol | Cited at | Files | Reached by |
|---|---|---|---|---|
| Core Librarypackages/zod/src/v4/core/ | Body changed $constructor1 of 9 changed symbols reaching it | packages/zod/src/v4/core/core.ts:24-110 | 17 | 6 direct · 9 at two steps · 2 at three stepsTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
| packages/zod/src/v4/locales/ | Signature changed $ZodConfig1 of 2 changed symbols reaching it | packages/zod/src/v4/core/core.ts:157-171 | 61 | none direct · 58 at two steps · 3 at three stepsTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
| Zod Sourcepackages/zod/src/ | Added compile1 of 14 changed symbols reaching it | packages/zod/src/v4/core/compile.ts:91-139 | 2 | 1 direct · 1 at two stepsTrace pathShortest component path from the changed symbol:
Later steps follow file imports; they do not prove this symbol is called. |
Held back 3
| Component | Files | Reached by | Resolution |
|---|---|---|---|
| scripts/ | 1 | none direct · 1 at three steps | precise |
| packages/bench/ | 19 | none direct · 1 at three steps · 18 at four steps | precise |
| packages/zod/src/locales/ | 1 | none direct · 1 at four steps | precise |
Ranked lower 5
| Component | Files | Reached by |
|---|---|---|
| packages/zod/src/v4/classic/ | 12 | 3 direct · 9 at two steps |
| packages/zod/src/v4/mini/ | 9 | 3 direct · 5 at two steps · 1 at three steps |
| packages/zod/src/mini/ | 1 | none direct · 1 at two steps |
| packages/zod/src/v4-mini/ | 1 | none direct · 1 at two steps |
| packages/zod/src/v4/ | 1 | none direct · 1 at two steps |
Not traced past a hub 3
| Symbol | Hub file | Imported by |
|---|---|---|
| packages/zod/src/v4/core/core.ts:$constructor | packages/zod/src/v4/core/checks.ts | 65 |
| packages/zod/src/v4/core/core.ts:$constructor | packages/zod/src/v4/core/errors.ts | 72 |
| packages/zod/src/v4/core/core.ts:$constructor | packages/zod/src/v4/core/util.ts | 79 |
Statements 3
$constructor body changed and reached 17 files in the core library. 692$ZodConfig signature changed and reached 61 files in locales. 583compile was added and reached 2 files in the Zod source. 1125 reached files belong to no component — tests, docs and config.
Routes, schema, dependencies
No public URL, no migration and no new package.
Inspect components, files and symbols
Component
File
Function
imports what changeddownstream of it, one mark per step
Diff
Analysis scope
669 → 6- files at head669
- components32
- changed by this change6
Where the new files landed
23 new files| New file | Belongs to | Used by | Calls | Serves |
|---|---|---|---|---|
| scripts/2 new files | Build Scriptsbase frame | nothing in the existing application | Core Library | — |
| packages/zod/src/v4/core/compile.ts | Core Librarybase frame | Zod SourceClassic APIMini API | nothing outside its own component | — |
| packages/bench/19 new files | Benchmark Suitebase frame | nothing in the existing application | nothing outside its own component | — |
| packages/zod/src/compile.ts | Zod Sourcebase frame | — | Core Library | ./compile |
11 added files carry no component — 7 test, 3 docs, 1 config.
54 files changed, 24 claims stated. 11 components reached in total.