-
Notifications
You must be signed in to change notification settings - Fork 630
Chore/zod 4 update #4041
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?
Chore/zod 4 update #4041
Conversation
…d refine action types.
… type inference for generate calls.
…s in Vertex AI and Google AI plugins.
…ew type strictness and schema generation API.
Summary of ChangesHello @LukeSchlangen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on a significant dependency upgrade, moving the project from Zod v3 to Zod v4 and updating TypeScript to v5. These changes necessitate various code modifications, including API adjustments for schema generation, stricter type definitions, and the introduction of explicit type castings to maintain compatibility and ensure the stability of the application's data validation and typing mechanisms. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a significant and well-executed upgrade of the Zod library to version 4 across the repository. The changes are comprehensive, including updating package dependencies, removing the now-obsolete zod-to-json-schema package, and adapting the codebase to the new Zod v4 APIs, such as z.toJSONSchema and the updated z.record syntax. The test files have also been diligently updated to reflect changes in schema generation, which is great to see.
While the changes are extensive and mostly look correct, I've noticed a large number of type assertions (as any, as unknown as ...) have been added. This is often a pragmatic necessity during large dependency upgrades to resolve complex type-checking issues. However, it does reduce type safety. It would be beneficial to create follow-up tasks to revisit these assertions and try to replace them with stronger types or type guards where possible.
My main concern is the removal of the pnpm-lock.yaml file for the js/testapps/next package, which I've detailed in a specific comment.
| @@ -1,827 +0,0 @@ | |||
| lockfileVersion: '9.0' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lock file was removed. Lock files are important for ensuring reproducible builds by pinning down the exact versions of all dependencies, which is particularly important for test applications to avoid flakiness. Was the removal of this file intentional? If not, it should be restored. If this test application is not intended to have its dependencies locked, it might be better to add pnpm-lock.yaml to a .gitignore file in this directory to prevent it from being tracked accidentally.
Description here... Help the reviewer by:
Checklist (if applicable):