Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

High TypeScript checking cost from generated Zod 3 schemas

Aperta
#2,624 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lforst ci sta già lavorando.

Dal 15/10/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
nodejs, typescript
Ambito
performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
29
Fork
16
Merge medio
1g 20h
PR unite (30g)
70

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di braintrustdata/braintrust-sdk-javascript

Tutte le issue di braintrustdata/braintrust-sdk-javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.