Skip to content
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

Support standard schema validators #120

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Support standard schema validators #120

merged 2 commits into from
Feb 7, 2025

Conversation

Xiphe
Copy link
Collaborator

@Xiphe Xiphe commented Feb 7, 2025

add support for all schema validation libraries implementing the standard schema spec as checkValue argument.

So basically we now support

import * as z from 'zod';
import * as v from 'valibot';
import {type} from 'arktype';

cachified({ checkValue: z.string(), /* ... */ });
cachified({ checkValue: v.string(), /* ... */ });
cachified({ checkValue: type('string'), /* ... */ });

deprecates the zod-only implementation
next major may remove the deprecated implementation and require use of zod@>=3.24.0

add support for all schema validation libraries implementing the
standard schema spec (https://github.com/standard-schema/standard-schema)
as checkValue argument

deprecates the zod-only implementation
next major may remove the deprecated implementation and require use
of zod@>=3.24.0
@Xiphe Xiphe requested a review from kentcdodds February 7, 2025 11:21
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

I love it. This is really great. I was wondering if this would get done any time soon. I definitely didn't have time to do it, so I'm so glad that you did. You're doing awesome. Thank you!

@kentcdodds kentcdodds merged commit ad36a59 into main Feb 7, 2025
3 checks passed
@kentcdodds kentcdodds deleted the standard-schema branch February 7, 2025 20:20
Copy link

github-actions bot commented Feb 7, 2025

🎉 This PR is included in version 5.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants