Skip to content

feat(tooling): build-time codegen convention — ajv/standalone (+Prisma/Drizzle/Vue) AOT path #1680

Description

@proggeramlug

Part of #1677. Blocked by #1679 — do not start until it is merged to main and parity-green.

Problem

Several codegen libraries already ship an eval-free path (built for CSP environments) that emits plain source at build time. Where that exists, Perry should consume the standalone output instead of trying to run the JIT at all — zero new infra, highest ROI.

Scope

A package.json / perry build convention that routes recognized codegen libraries to their build-time output and compiles that output natively. Land ajv as the proof:

  • ajv/standalone emits precompiled validator modules → feed them to Perry's normal compile path.
  • Document the same convention for: prisma generate, drizzle-kit introspect, kysely-codegen, Vue SFC compiler. (Document + wire the hook; per-library adoption can follow.)

Acceptance criteria (the gate for Phase 3)

  • A sample that validates input with ajv compiles via ajv/standalone, links no runtime V8, and is byte-parity vs node.
  • The convention is documented (how a package declares its build-time codegen entry point).
  • Merged to main, lint clean, parity-green.

Out of scope

Libraries with no standalone mode (fast-json-stringify, find-my-way) — Phases 3 and 4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew capability or improvementtoolingDeveloper tooling, CI, tests, or release infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions