Uh oh!
There was an error while loading. Please reload this page.
Add BYO zod version support - #49
Conversation
ochafik
commented
Dec 1, 2025
@jonathanhefner adding you as reviewer in case you know more about implications of zod v3 vs v4 :-) |
jonathanhefner
commented
Dec 2, 2025
We are actually using v4 currently, but we are importing it from the v3 package, which Zod supports since v3.25+ to ease migration. Actually though, I'm more inclined to match what the MCP TypeScript SDK currently does, which should allow users to "bring their own Zod". In our case, it wouldn't benefit the API (the schema objects would still just use @fredericbarthelet Do you see any drawbacks of that approach? |
7178068 to
079f8b0Comparefredericbarthelet
commented
Dec 2, 2025
Thanks for your feedbacks @ochafik@jonathanhefner I did locked zod v4 in the exemple implementation in One of the main difference with TS SDK implementation is not putting zod as a dependency, but rather as a dev dependency. Just so you know and you don't get surprised by the amount of line changed in this PR. Adding a peer dependency in the project for the first time resulted in the following error:
Regenerating a new Let me know if you'd want me to change anything to the implementation. |
fredericbarthelet
commented
Dec 4, 2025
You fixed the npm/cli error with #73 |
1b8e1bf to
9add988CompareHey @jonathanhefner, just rebased this PR on top of the latest implementation of exemple apps you made :) |
f77c70a to
60b6161CompareFollowing recommendations from https://zod.dev/library-authors
60b6161 to
e99517dComparefredericbarthelet
commented
Dec 12, 2025
Hey @ochafik@jonathanhefner, sorry for the ping. Just made another update to resolve conflicts that appeared since my last push. Would you like me to change anything in the implementation ? |
commit: |
Uh oh!
There was an error while loading. Please reload this page.
jonathanhefner
commented
Dec 12, 2025
Thank you, @fredericbarthelet! |
Following fix implementation from @matteo8p in #42 , I suggest directly requiring zod v4 in package.json rather than relying on v4 being exported from v3.
Motivation and Context
zod subpath import allows easier migration. Since the previous PR solves npm i, you can now finish migration with a final update of zod versions
How Has This Been Tested?
running
npm i & npm starton a fresh install of the project and check that it renders correctly on localhost:8080Breaking Changes
major upgrade in package.json, but was already up in previous PR #42
Types of changes
Checklist
Additional context