Standard schema always async
Describe the bug
The standard schema implementation always uses the asynchronous version of schema.validate (not schema.validateSync) even if none of the validators requires async logic.
To Reproduce This Stackblitz shows a case using yup in Tanstack forms. If you pass any yup schema as a validator, you will get an error like "Error: async function passed to sync validator".
Expected behavior Ideally, this would work like Zod (stackblitz demo) - only return a promise when the validation actually includes asynchronous logic.
It also might be reasonable (and easier) to add some kind of flag to manually tell the schema when it should behave as async/sync.
Platform (please complete the following information):
- Browser Chrome
- Version: 1.7.1
Additional context Kind of relates to this standard schema issue: https://github.com/standard-schema/standard-schema/issues/22
Source: jquense/yup