-
Notifications
You must be signed in to change notification settings - Fork 20
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
Question / Readme request #54
Comments
Hi, myzod's key difference is that the api is simpler and that it is more performant. One of the key ways that it is simpler, is that it doesn't cover every Javascript type. It is solely concerned with types that you would parse from JSON or some other data format. Myzod isn't concerned with validating that an Unknown values are generally found at Network boundaries, file loading, essentially when you read and parse data from outside of your application. Myzod, also doesn't copy values unless it deems that it needs to. Which is where the big performance difference between myzod and zod comes in. Personally I do not think zod is performant enough to run on high demand servers. Myzod is. The biggest limitation with myzod is that it is currently blocked for typescript less than 4.7 Personally I do not have the time to try and make it compile, and do not write much typescript these days, so I am hoping that if myzod is going to be made to work with the latest typescript versions that effort will come from the community. the TLDR:
Zod has a bigger community and more APIs and tertiary tools. |
Updating to say that the typescript version issue has been resolved and myzod is now compatible with latest released versions of typescript. 🎉 |
Love the argument regarding simplicity (after all, i really don't need to validate anything that's not a JSON anyways). Good work! |
One difference I noticed between zod and myzod is that the former explicitly requires "strict: true" in your typescript compiler options. There's no mention of this in myzod documentation. Are there limitations/issues caused if you use myzod while not setting For an existing code base, setting strict: true can introduce a lot of code to fix if the code base didn't start off with this. In an ideal world, maybe all projects would, but I could see it being a helpful differentiator for some folks. |
Yes that is a good callout. The same holds true for myzod. I will need to spend time in the readme soon. |
Hi!
Could you summarize some key differences (how to migrate, what to watch out, what is missing in myzod, which is possible in zod) if someone tries to switch from zod to myzod?
The text was updated successfully, but these errors were encountered: