Repository navigation
Zodvex 0.7.11
zodvex generate now emits each zodvexRegistry entry as a memoizing getter. An entry's args and returns schemas are built on first access and reused afterwards, so importing the registry constructs nothing at module evaluation. Every server function imports the registry through initZodvex, and the Convex isolate evaluates module top-level code per execution, so the previous eager object literal rebuilt every function's schemas on every call.
export const zodvexRegistry = {
get 'tasks:get'() {
return __lazy('tasks:get', () => ({
args: z.object({ id: zx.id("tasks") }),
returns: TaskModel.schema.doc.nullable(),
}))
},
// ...
}Lookups by path, Object.keys / Object.entries, the module graph and the declared type are unchanged; enumerating the registry builds every entry. A construction error in an entry now surfaces on that entry's first access instead of at module evaluation. In the codec workload benchmark, 128 eager entries with ten-field argument schemas added about 17 ms to every call over the same model graph, and the getter registry was indistinguishable from having no registry. See docs/decisions/2026-09-16-lazy-registry-getters.md for the reasoning and alternatives.
Development and example dependencies now pin Zod 4.6.5. The library peer range stays ^4.3.6, and no source changes were needed.
Install 0.7.11 and rerun zodvex generate to pick up the new registry shape.
What's Changed
- refactor: simplify builder construction by @panzacoder in #134
- refactor: remove mutable rules subclass initialization by @panzacoder in #135
- fix(types): preserve parsed object argument output by @panzacoder in #137
- refactor: isolate schema IDs to remove import cycles by @panzacoder in #138
- refactor: simplify function and rules module layout by @panzacoder in #139
- refactor: simplify database wrapper internals by @panzacoder in #140
- test: replace table sweeps with memory and workload benchmarks by @panzacoder in #142
- feat: add local schema diagnostic command by @panzacoder in #143
- perf(codegen): memoizing registry getters and Zod 4.6.5 by @panzacoder in #146
- chore: bump version to 0.7.11-beta.1 by @panzacoder in #147
- chore(release): prepare stable 0.7.11 by @panzacoder in #149
Full Changelog: v0.7.10...v0.7.11