Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformations are not kept in production #1

Open
yairopro opened this issue May 5, 2024 · 3 comments
Open

Transformations are not kept in production #1

yairopro opened this issue May 5, 2024 · 3 comments
Assignees

Comments

@yairopro
Copy link

yairopro commented May 5, 2024

When defining a schema, we sometime add transformations.
zod-dev should still apply transformations in production.

Demo: https://stackblitz.com/edit/typescript-desjd9?file=schemas%2FschemaWithDefaultType.ts

@schalkventer
Copy link
Owner

Thanks for the heads-up @yairopro. I'll have a look at this tomorrow. 👍

@schalkventer schalkventer self-assigned this May 6, 2024
@punkpeye
Copy link

punkpeye commented Jan 6, 2025

This would be really nice to have ❤️

@schalkventer
Copy link
Owner

Thanks @punkpeye. I looked into this a bit at one point, however couldn't find an easy way to integrate it without rethinking the approach, since at the moment Zod simply gets stubbed, meaning the entire library is omitted in production.

However, I'll give this a look again in 2025, there might be a way to allow optional inclusion of transformation behind some option flag.

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

No branches or pull requests

3 participants