zod icon indicating copy to clipboard operation
zod copied to clipboard

Huge output `.d.ts` files when using `.catchall` with `.passthrough`

Open vmajsuk opened this issue 1 year ago • 1 comments

After upgrading from [email protected] to [email protected], output .d.ts files for schemas combining .catchall with .passthrough grew exponentially - on our project for one particular schema it exploded from 350 lines to 70k lines

This is a problem because it causes worse compile performance & GC failures when using tools like webpack.

You can check out a sample case to reproduce the error here (the repo also contains the comparison of output declaration sizes for different errors): https://github.com/vmajsuk/zod-d-ts-regression

vmajsuk avatar Jul 13 '23 15:07 vmajsuk

We're also experiencing the same problem. Simple types are repeating the same data structures multiple times.

divmgl avatar Jan 31 '24 15:01 divmgl