react-hook-form / resolvers

📋 Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts and VineJS
https://react-hook-form.com/
MIT License
1.72k stars 157 forks source link

Fix schema type error mentioned in issue 549 #563

Closed henrikvolmer closed 1 year ago

henrikvolmer commented 1 year ago

Fixes issue https://github.com/react-hook-form/resolvers/issues/549

bluebill1049 commented 1 year ago

Any chance you could add some test coverage on the fix? thank 🙏

henrikvolmer commented 1 year ago

Do you have any suggestions, how to test a typescript type change? In my opinion, typescript will test it automatically on compile time.

bluebill1049 commented 1 year ago

If you can include usage in the test case would be good, that proof why the issue was there in the first place.

henrikvolmer commented 1 year ago

I changed some more, to improve/fix the type inference for useForm. Now the generic in useForm is unnecessary because it'll be inferred from the schema.

henrikvolmer commented 1 year ago

Any news here? Do you need something?

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

henrikvolmer commented 1 year ago

@jorisre @bluebill1049 : I think this should have been better at least a minor release, since the type was any before and is now specialized. This is probably why some users have a problem with their types. Because of any the type check was disabled before and therefore wrong types didn't cause an error.

bluebill1049 commented 1 year ago

Thanks @henrikvolmer for supporting on this issue. Yes, I think a minor version would probably be the wiser release.

henrikvolmer commented 1 year ago

@bluebill1049 : So how we move on? Can you change the patch version to a minor version?

bluebill1049 commented 1 year ago

It's a little bit of a difficult situation here We can't overwrite the release or re-release. perhaps @jorisre maybe we just added to the release note on this change which may cause breaking changes to existing apps.

jorisre commented 1 year ago

We can:

@bluebill1049 What do you prefer?

bluebill1049 commented 1 year ago

I think we just update the release note would be the better choice, cause the patch is already release. thanks @jorisre 🙏

jorisre commented 1 year ago

Done https://github.com/react-hook-form/resolvers/releases/tag/v3.1.1