Skip to content

v0.13.0

Choose a tag to compare

@mertcanaltin mertcanaltin released this 09 May 13:15
· 136 commits to master since this release

Added

  • ata build <glob> subcommand for project-wide AOT compilation. Compiles each matched schema to a per-file .compiled.mjs ESM module with a sibling .d.mts TypeScript declaration. Production bundles can drop the runtime ata-validator dependency entirely and import compiled validators as plain ESM modules.
  • ata-validator/build programmatic subpath export. import { build, watch } from 'ata-validator/build' exposes the same engine the CLI uses, so build pipelines and bundler plugins can integrate without going through the CLI.
  • CLI flags for ata build: --out-dir, --suffix, --format esm|cjs, --abort-early, --no-types, --cache-file, --check, --watch, --max-size, --strict.
  • Incremental cache via content-hashed --cache-file. Second run on unchanged inputs skips compilation.
  • YAML schema support when the yaml peer dependency is installed (optional). .yaml and .yml inputs parse the same as .json.
  • AOT vs AJV-runtime benchmark at benchmark/bench_aot_vs_ajv.mjs. On the included fixtures, ata-AOT outputs are 25-56x smaller gzipped than the AJV runtime, cold start is ~2x faster, throughput is 2-4.5x faster, and compile time is 71-246x shorter.

Fixed

  • Standalone modules now correctly serialize closure-bound helpers (RegExp, Set, sub-validator functions, branch-property arrays) into the emitted .mjs. Previously, schemas using patternProperties, propertyNames with regex, or unevaluatedProperties with anyOf/oneOf produced standalone output that referenced undefined variables (_ppf0_0, _re*, _es*, _bk*) and threw ReferenceError at runtime. The runtime validation path was unaffected.

Notes

  • The runtime Validator API and the ata-validator/compat AJV-shim remain unchanged. Existing dynamic-schema users have no migration to do.
  • Bundler plugins (ata-vite v0.2.0, ata-webpack, ata-codemod-ajv) are out of scope for this release and will land in 0.14.0+.