High TypeScript checking cost from generated Zod 3 schemas
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- performance
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 29
- 派生
- 16
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 72
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
braintrustdata/braintrust-sdk-javascript 的其他 Issue
-
typescript
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2578 ·
维护者通常 1 天内回复
-
[bot] Instrument Letta Agent SDK (87,205 weekly downloads)可能已有人在做 @karthiksenv 于 2 天前认领。 未关闭typescript
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2577 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
braintrustdata/braintrust-sdk-javascript#2527 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 65/100
braintrustdata/braintrust-sdk-javascript#2526 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 56/100
braintrustdata/braintrust-sdk-javascript#2482 ·
维护者通常 1 天内回复
查看 braintrustdata/braintrust-sdk-javascript 的全部 Issue
相似的 Issue
-
fix(frontend): correct VITE_IS_DEVELPOMENT typo in shared/app.ts and align dev environment flags未关闭
难度 2/5 1-3 小时 新手友好度 75/100
vicharanashala/ajrasakha#1439 ·
维护者通常 1 天内回复
-
approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
codex-team/editor.js#3037 ·
-
complexity: trivial good first issue impact: low
难度 1/5 1 小时以内 新手友好度 78/100
ueberdosis/tiptap#8522 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
wormhole-foundation/wormhole#5062 ·
维护者通常 1 天内回复