Skip to content

Chore/650 upgrade zod v4 - #680

Open
shivamvishwakarm wants to merge 2 commits into
mainfrom
chore/650-upgrade-zod-v4
Open

Chore/650 upgrade zod v4#680
shivamvishwakarm wants to merge 2 commits into
mainfrom
chore/650-upgrade-zod-v4

Conversation

@shivamvishwakarm

@shivamvishwakarm shivamvishwakarm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

📃 Why Merge This PR?

This PR update :

  • zod version from v3.23.6 to v4
  • zod resolve from v3.3.4 to v5.7.1

Zod v4:

z.string({ 
  error: (issue) => issue.input === undefined 
    ? "This field is required" 
    : "Not a string" 
});

Zod v3:

z.string({ 
  required_error: "This field is required",
  invalid_type_error: "Not a string", 
});
z.string().email(); // ❌ deprecated
z.email();           // ✅ preferred

Reference: https://zod.dev/v4/changelog

🛠️ Issue Fixed

fixes #650

🔍 PR Type

  • 💡 Feature
  • 🐛 Bug Fix
  • 📃 Documentation
  • 🎨 UI Improvements
  • 💻 Code Refactor
  • ✅ Tests

@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for incredible-eclair-ada155 ready!

Name Link
🔨 Latest commit d1d7726
🔍 Latest deploy log https://app.netlify.com/projects/incredible-eclair-ada155/deploys/6a7c916e57b0d70008c52fe2
😎 Deploy Preview https://deploy-preview-680--incredible-eclair-ada155.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.

@github-actions

Copy link
Copy Markdown

🏷️ [bumpr]
Next version:v3.4.17
Changes:v3.4.16...the-monkeys:chore/650-upgrade-zod-v4

@TanishqSingla

Copy link
Copy Markdown
Collaborator

Link this PR properly, also this PR only upgrades the repo and changes the existing code. When will we incorporate the features provided by the v4 in this?

Comment on lines +5 to +8
.string({
error: (issue) =>
issue.input === undefined ? 'Preview title is required' : undefined,
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A custom error message is already there on the .min function. You should have fixed this if you're changing this code

Comment on lines +11 to +16
.string({
error: (issue) =>
issue.input === undefined
? 'Preview subheading is required'
: undefined,
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same as above

Comment on lines +6 to +8
error: (issue) =>
issue.input === undefined ? 'Password is required' : undefined,
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

for most of the validation error message you don't need to define a callback

refer: https://zod.dev/error-customization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to Zod 4

3 participants