tRPC generated client bundle size considerations for low‑traffic Cloudflare Workers deployments
0 reputation · 08 Mar 2020, 08:54 UTC
Goal
Ensure the tRPC‑generated client bundle stays within the size limits that keep Cloudflare Worker cold‑start latency under 50 ms for low‑traffic workloads.
Constraints / uncertainty
The generated client includes all procedure types, Zod validation schemas, and any procedural middleware. Its exact size depends on the number of procedures, schema complexity, and the tRPC version’s code‑generation output format. It is unclear how much of this code can be tree‑shaken by typical bundlers when targeting the Workers environment.
- What is the typical increase in bundle size per procedure when using tRPC with Zod validation?
- Does enabling the ESM output format affect tree‑shakability for Cloudflare Workers?
- Are there documented client‑size thresholds that still guarantee sub‑50 ms cold‑start latency on Workers?