Skip to content

v0.7.11

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Sep 05:56
· 9 commits to main since this release
7c99e7f

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

Full Changelog: v0.7.10...v0.7.11