Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

High TypeScript checking cost from generated Zod 3 schemas

Abierto
#2,624 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@lforst ya está trabajando en esto.

Desde el 15/10/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
nodejs, typescript
Área
performance

Línea de trabajo

Start with the reproduction: a one-line import of LazyValue and TestBackgroundLogger from braintrust, checked with yarn exec tsc --extendedDiagnostics under the given tsconfig, compared against an export {} baseline. The generated schemas live in js/src/generated_types.ts, which imports zod/v3. Done means a measured drop in type and instantiation counts while the public input and output types stay the same. The issue asks for that benchmark before any migration.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Braintrust 3.37.2 adds substantial declaration-checking work from a single unused import.

Reproduction

Use Node.js 24.21.0 and an ESM project ("type": "module" in package.json). With Yarn, set nodeLinker: node-modules in .yarnrc.yml.

yarn add [email protected] [email protected]
yarn add -D [email protected] @types/[email protected] [email protected]

repro.ts:

import { LazyValue, TestBackgroundLogger } from "braintrust";

tsconfig.json:

{
  "compilerOptions": {
    "strict": true,
    "target": "ES2023",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "types": ["node"],
    "skipLibCheck": false,
    "noEmit": true
  },
  "files": ["repro.ts"]
}

Run yarn exec tsc --extendedDiagnostics. For the baseline, replace the import with export {};.

Results

All checks pass. Measured deterministic counts on TS7:

Case Types Instantiations
No Braintrust import 64,716 62,345
With Braintrust import 624,895 1,791,353

No SDK calls or credentials are required. The root and braintrust/node imports load the same declarations.

Possible fix

Generated schemas import zod/v3. Zod 4 redesigned its generics to reduce compiler instantiations.

Could these schemas migrate to Zod 4 and the public declarations be regenerated? That seems like the first approach to benchmark, while preserving precise public input and output types. We have not measured an actual schema migration yet.

Lenguaje dominante
TypeScript
Estrellas
29
Forks
16
Merge medio
1 d 20 h
PR fusionados (30 d)
70

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de braintrustdata/braintrust-sdk-javascript

Todos los issues de braintrustdata/braintrust-sdk-javascript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.