Skip to content

Conversation

@HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Dec 15, 2025

Description

This PR updates the Astro 6 upgrade guide to include a link to the community codemod for migrating from Zod 3 to Zod 4.

I went with the minimal change to add this link right now, but I guess a few questions could be raised:

  • I introduce it at the end of the Zod 4 section, I guess another option could be near the beginning of the section, after linking to the Zod migration guide.
  • I only went with a link, not even a command example on how to run the codemod (it's available on the linked README).
  • I only mention it in the Zod 4 section, not in the "Deprecated: astro:schema and z from astro:content" section even tho it can also be relevant there. Should it be mentioned there too?

Related issues & labels

  • Closes #
  • Suggested label: 6.0

@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit f2e16ec
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/694025304e379f00085d1b3a
😎 Deploy Preview https://deploy-preview-12905--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Dec 15, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/upgrade-to/v6.mdx Localization changed, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@HiDeoo HiDeoo added the 6.0 label Dec 15, 2025
@sarah11918
Copy link
Member

sarah11918 commented Dec 15, 2025

Let's get this in like this for now!

  • I could see posting both the upgrade link and the code mod right at the top, too (before the what should I do). Maybe something like:
### Zod 4

Astro v6.0 upgrades to [Zod 4 (CHANGELOG)](https://zod.dev/v4/changelog)), a major dependency update that may require changes to custom Zod schemas in your project. A [community Zod v3 to Zod v4 codemod](https://github.com/nicoespeon/zod-v3-to-v4) is also available.
  • I think anyone dealing with upgrading the z schema stuff from other imports/exports will also end up here, so the codemod only here seems fine. BUT, we probably could update that entry to also link to the Zod 4 one? Just to be safe? It could be something like:
Astro 6.0 deprecates `astro:schema` and `z` from `astro:content` in favor of `astro/zod`. (Note that Astro 6.0 also [upgrades to Zod 4](#zod-4) and may require additional upgrades to your project.)

Co-authored-by: Sarah Rainsberger <[email protected]>
@HiDeoo
Copy link
Member Author

HiDeoo commented Dec 15, 2025

Let's get this in like this for now!

Sounds like a good call to me (and also why I initially did not go with adding it to multiple places, etc but kept it as simple as possible) 👍

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as is, or if you'd like to include any extras as shown in my comment either now, or later!

@HiDeoo HiDeoo merged commit af2b495 into withastro:v6 Dec 15, 2025
10 checks passed
@HiDeoo HiDeoo deleted the hd/docs-zod-codemod branch December 15, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants