seasonedcc / composable-functions

Types and functions to make composition easy and safe
MIT License
656 stars 13 forks source link

Support for custom schema validators #30

Closed marcus-sa closed 2 years ago

marcus-sa commented 2 years ago

Have you considered allowing developers to use custom schema validators? I'd much rather use https://deepkit.io/library/type instead of https://zod.dev

gustavoguichard commented 2 years ago

Hey @marcus-sa ! Thank you for submitting the issue, sorry for closing it out prior to commenting, I'm testing this feature on my mobile's github app 😅

That said we don't plan to support custom serializers in the foreseeable feature - which may be the next major release.

It doesn't seem to be too hard to do it so we will keep an eye on "Type" and this sort of request tho.

Is there any specific reason you'd use one over another? Do you have any API suggestions?

Cheers

marcus-sa commented 2 years ago

@gustavoguichard Zod is slow and the DX is bad, whereas with Deepkit Type we can use pure TypeScript classes/interfaces & define constraints using nothing but types. It also has the best performance for schema validation, serialization & deseralization of any library available.

FlurryNight commented 2 years ago

+1

gustavoguichard commented 4 months ago

Hey @marcus-sa and @FlurryNight , just an update: we released v4 which is now called composable-functions and should work just fine with any custom parser. Zod is no longer a dependency.

We prepared some instructions and an example which uses @arktypeio/arktype : https://github.com/seasonedcc/composable-functions/blob/main/examples/arktype/README.md

FlurryNight commented 4 months ago

Hey @marcus-sa and @FlurryNight , just an update: we released v4 which is now called composable-functions and should work just fine with any custom parser. Zod is no longer a dependency.

We prepared some instructions and an example which uses @arktypeio/arktype : https://github.com/seasonedcc/composable-functions/blob/main/examples/arktype/README.md

Hey, awesome. nice work Thanks for the info