Skip to content

Releases: logaretm/vee-validate

v4.11.0

30 Jul 23:59

Choose a tag to compare

This release contains a couple of new features

🆕 Composition API setters

Added composition functions to set field and form values, meta, and errors from their child components. The functions are:

  • useSetFieldValue: sets a field's value.
  • useSetFieldTouched: sets a field's touched state.
  • useSetFieldError: sets a field's error message.
  • useSetFormValues: sets form values.
  • useSetFormTouched: sets multiple or all fields touched state.
  • useSetFormErrors: sets form error messages.

🆕 Initial support for Valibot

Valibot is an impressive new schema validation library, mainly it offers Zod-like features at a much less bundle size due to its non-chainable API while still being easy to use and fully typed.

Because of this, vee-validate now supports it as a schema provider using the @vee-validate/valibot package that exposes the same API function toTypedSchema that you can use to get TypeScript support into your forms input and output values.

Quick example:

import { useForm } from 'vee-validate';
import { toTypedSchema } from '@vee-validate/valibot';
import { email, string, minLength, object } from 'valibot';

const { errors, values } = useForm({
  validationSchema: toTypedSchema(
    object({
      email: string([minLength(1, 'Email is required'), email()]),
      password: string([minLength(6, 'password too short')]),
    }),
  ),
});

Refer to the docs for live examples and more information on typed schemas.

v4.10.9

30 Jul 14:27

Choose a tag to compare

👕 Types

  • Fixed a type issue where setErrors did not accept an array of strings #4396 (c02337f)

v4.10.8

22 Jul 14:25

Choose a tag to compare

💨 Performance improvement

v4.10.7

16 Jul 22:02

Choose a tag to compare

🐛 Bug fixes

  • Clone values inserted into field arrays #4372 (9290f5a)
  • Do not warn if the validation is for auto-removed paths #4368 (93f8001)

v4.10.6

08 Jul 17:09

Choose a tag to compare

✨ Behavior Changes

  • use silent validation when field is initialized closes #4312 (68080d2)

This is because it was causing modal forms to have errors on mounted which confused users. This does not effectively change anything other than you will no longer need to reset the form whenever the modal is shown or when the fields are mounted. If you relied on this behavior then it could be a breaking change for you and you can get it back by enabling validateOnMount or calling validate whenever.

This does not affect initial errors or validateOnMount option.

🐛 Bug Fixes

  • resetForm should cast typed schema values closes #4347 (e9b215a)
  • validate form values on setValues by default closes #4359 (4e11ff9)
  • normalize error paths to use brackets for indices closes #4211 (e354a13)

⚙️ Misc

v4.10.5

03 Jul 23:59

Choose a tag to compare

🐛 Bug fixes

  • Fixed an issue with defineComponentBinds not adding onBlur binding correctly (6a1dc9b)
  • Fixed an issue with defineComponentBinds not respecting validateOnModelUpdate config #4346 (6a1dc9b)

v4.10.4

03 Jul 23:39

Choose a tag to compare

👕 TypeScript

  • Avoid using DeepReadOnly type for now with useForm#values since it is too aggressive 2f9ca91

v4.10.3

29 Jun 22:30

Choose a tag to compare

🐛 Bug Fixes

  • SSR: Avoid referencing window with setTimeout for validation batching #4339 (#4340) thanks to @userquin 🙌
  • Respect model modifiers when emitting the value with useField v-model integration #4333 (c3698f0)

✨ Enhancements

Made object dirty meta checks less strict by treating undefined and missing keys as the same value #4338 (32537e1)

This may cause some differences with the value of dirty meta for forms and object value fields but it shouldn't affect most cases.

v4.10.2

26 Jun 01:50

Choose a tag to compare

🐛 Bug Fixes

  • defineXXXBinds not respecting validation config events (1660048)

v4.10.1

23 Jun 23:33

Choose a tag to compare

🐛 Bug Fixes

  • handle NaN when parsing number inputs #4328 (fc41691)
  • reset present values after all path mutation (435e785)
  • resetField() should not validate #4323 (273cca7)