-
Notifications
You must be signed in to change notification settings - Fork 32
Add BYO zod version support #49
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
base: main
Are you sure you want to change the base?
Add BYO zod version support #49
Conversation
|
@jonathanhefner adding you as reviewer in case you know more about implications of zod v3 vs v4 :-) |
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
079f8b0
Compare
|
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. |
|
You fixed the npm/cli error with #73 |
218f5fe to
1b8e1bf
Compare
1b8e1bf to
9add988
Compare
|
Hey @jonathanhefner, just rebased this PR on top of the latest implementation of exemple apps you made :) |
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.
It also removes dependency to zod from
simple-hostwhich doesn't require it.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