Skip to content

feat(typescript): generate SDKs across worker shards - #17161

Open
teamchong wants to merge 1 commit into
fern-api:mainfrom
teamchong:teamchong/typescript-sharded-generation
Open

feat(typescript): generate SDKs across worker shards#17161
teamchong wants to merge 1 commit into
fern-api:mainfrom
teamchong:teamchong/typescript-sharded-generation

Conversation

@teamchong

@teamchong teamchong commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Add internal worker sharding for TypeScript SDK generation and merge each worker's output into one SDK.

Benchmark

Cloudflare's canonical TypeScript IR, three alternating runs:

  • Single worker: 188.1s median
  • Three workers: 41.9s median
  • Improvement: 77.7%

Both modes generated 22,573 files. After the workflow's formatting step, there were zero normalized content differences.

Testing

  • Added shard assignment and output merge coverage
  • Added sharded/unsharded generation parity coverage
  • TypeScript generator and CLI tests pass

Open in Devin Review

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

Adds worker-based sharding for TypeScript SDK generation. The core sharding logic, merge routine, and orchestration are reasonable, but there are a few correctness concerns: the validation error message wording doesn't match the tests, a potential unhandled rejection in the CLI entrypoint, and the merge's aggregate-variant single-source shortcut could still leave unmerged content.

  • 🟡 3 warning(s)
  • 🔵 3 suggestion(s)

Comment thread generators/typescript/sdk/generator/src/generationShard.ts Outdated
Comment thread generators/typescript/sdk/cli/src/cli.ts Outdated
Comment thread generators/typescript/sdk/cli/src/sharding/mergeShardOutputs.ts Outdated
Comment thread generators/typescript/sdk/cli/src/sharding/runShardedGeneration.ts
Comment thread generators/typescript/sdk/cli/src/sharding/runShardedGeneration.ts
Comment thread generators/typescript/sdk/generator/src/generationShard.ts

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread generators/typescript/sdk/generator/src/SdkGenerator.ts
@teamchong
teamchong force-pushed the teamchong/typescript-sharded-generation branch 2 times, most recently from 73a1a90 to 50417ba Compare July 22, 2026 02:45
@teamchong
teamchong force-pushed the teamchong/typescript-sharded-generation branch from 50417ba to 53aa06d Compare July 22, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant