tjinauyeung / svelte-forms-lib

📝. A lightweight library for managing forms in Svelte
https://svelte-forms-lib-sapper-docs.now.sh/
MIT License
604 stars 59 forks source link

Add alternatives to validationSchema #192

Open taronaeo opened 1 year ago

taronaeo commented 1 year ago

Problem to solve

As a developer, I want to be able to choose my validation library, so that I can have choices. Personally, I prefer using Zod over Yup but there seems to be no official support for alternate validation libraries.

Intended users

Developer.

User experience goal

The developer should be able to use Zod seamlessly with svelte-forms-lib to validate input.

Proposal

I'm unsure yet of how react-hook-form implements, but maybe add a check to see if the code is using Zod or Yup to validate. Then, utilise the validation code accordingly.

Further details

Documentation

Links / references

react-hook-form -- https://www.react-hook-form.com/

taronaeo commented 1 year ago

I understand that this is a low-priority issue as it boils down to preference. I'll be switching over to Yup while using this library for now as it's a school-based project work.

But if this issue ever gains traction and be implemented, do let me know! It'll be pretty cool :)