-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add section on Zod 4 to v6 migration guide #12848
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: v6
Are you sure you want to change the base?
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks, @matthewp ! Also checking that none of these examples here where we describe using Zod for content collections look outdated to you? (This whole section on "Defining the collection schema" including the subsections for defining data types and collection references): https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/content-collections/#defining-datatypes-with-zod We also do mention and show examples of Zod schemas on the actions page, but it's probably the two sections here about validation where we have text/examples that we should double check are still accurate for Zod 4: https://deploy-preview-12322--astro-docs-2.netlify.app/en/guides/actions/#using-validators-with-form-inputs Lastly, even though Zod's migration guide shows everything, I would suspect there would be some changes that are common that most people would have to make to content collections schemas that are worth showing here, a way of focusing their attention on things that they'd very likely have to deal with. Can you suggest what some of those might be? If for example there were one or two things ONLY thing that will affect the majority of people, but maybe that's all they need to do, it would be much better for us to show those here. If it would be possible to help a number of people avoid needing to go to Zod's guide at all, then we really should do that. |
|
In addition to what Sarah just said, I noticed another change in the implementation regarding the use of the -heroImage: image().optional(),
+heroImage: z.optional(image()),Does this mean that |
Yes, I wasn't sure if updating other docs was in scope for these PRs or not, since in the last one it was not. Happy to update other docs though, just tell me.
Not really, no. I can only say what was common in updating Astro itself, but I wouldn't presume that holds over to CC users. For example |
It should still be chainable, I'll check to confirm. |
|
Just noting that we're holding on this one as some aspects of the implementation PR might determine what kind of guidance is needed here! |
|
@sarah11918 Which aspects? So I can unblock if possible. |
Description (required)
Adds Zod 4 under the "Dependency Upgrades" section.
Mostly just refers to the Zod 4's own migration guide.
Related issues & labels (optional)
For Astro version:
6.x. See astro PR #14956.