Skip to content

Releases: TanStack/form

v0.45.1

25 Feb 07:14
Compare
Choose a tag to compare

Version 0.45.1 - 2/25/25, 7:14 AM

Changes

Fix

  • form-core: clear previous invalid sync validation errors on FormApi (#1157) (b2db36a) by Juan Villa

Packages

v0.45.0

25 Feb 07:03
Compare
Choose a tag to compare

Version 0.45.0 - 2/25/25, 7:02 AM

Changes

Feat

Packages

v0.44.1

25 Feb 06:46
Compare
Choose a tag to compare

Version 0.44.1 - 2/25/25, 6:46 AM

Changes

Fix

  • subfields should now return the correct validation errors in TS (#1176) (2fd4271) by Corbin Crutchley

Packages

v0.44.0

24 Feb 19:30
Compare
Choose a tag to compare

Version 0.44.0 - 2/24/25, 7:30 PM

Changes

Feat

  • core: add getAllErrors to form api (#1155) (a39c1ea) by Harry Whorlow

Chore

  • deps: upgrade @tanstack/config to v0.16.3 (#1170) (b0dc32c) by Lachlan Collins

Packages

v0.43.2

21 Feb 15:11
Compare
Choose a tag to compare

Version 0.43.2 - 2/21/25, 3:11 PM

Changes

Fix

  • RN on Android no longer needs a replaceAll polyfill (#1166) (f8add78) by Corbin Crutchley

Docs

  • remove reference to createServerValidate (c36e218) by Corbin Crutchley

Packages

v0.43.1

21 Feb 11:50
Compare
Choose a tag to compare

Version 0.43.1 - 2/21/25, 11:50 AM

Changes

Fix

  • new lockfile for CI (4bac1f7) by Corbin Crutchley
  • form core should now be pinned to the right version (#1165) (fc7f8a6) by Corbin Crutchley

Packages

v0.43.0

21 Feb 11:15
Compare
Choose a tag to compare

Version 0.43.0 - 2/21/25, 11:14 AM

PRs

  • Allow returning anything in a validator (#1104) (d8ed149) by Corbin Crutchley

The Main Showcase

This PR allows you to return non-string values from validators:

<form.Field name="password" validators={{onChange: () => ({hasUppercase: false, hasLowercase: true}) }} />

In addition, it also enforces type safety on the returned value on both errorMap and the errors array:

const form = new FormApi({
  defaultValues: {
    name: 'test',
  },
} as const)

const field = new FieldApi({
  form,
  name: 'name',
  validators: {
    onChange: () => {
      return 123 as const
    },
  },
})

assertType<123 | undefined>(field.state.meta.errorMap.onChange)

assertType<Array<123 | undefined>>(field.state.meta.errors)

Breaking Changes

  • Removes all validatorAdapters (packages, code, and props alike)
  • When using Standard Schema validators:
    • form.errors is now Record<string, StandardSchemaV1Issue[]>
    • field.errors is now StandardSchemaV1Issue[] (flattened, unless you pass disableErrorFlat in form.Field)
  • Vue 3.4 is the new minimum version
  • Vue JSX usage no longer works

Migration Guide

If you're using Yup today, you'll either need to wait for this community PR to be merged or replace Yup with another schema library.

  • If using schema validation:
    • Remove all validatorAdapter properties
    • Uninstall @tanstack/yup-form-adapter, @tanstack/valibot-form-adapter, and @tanstack/zod-form-adapter
    • Migrate all validation errors on a field away from .map(str => <p>{str}</p>) and towards .map(issue => <p>{issue.messaeg}</p>)
    • Migrate all validation errors on form away from .map(str => <p>{str}</p>) and towards .map(issueObj => <p>{issueObj.issues[0].message}</p>)
  • (If Vue): Migrate form components to use SFCs

Other Changes

  • Vue SFC Works as-intended
  • TanStack Start Adapter has been updated to new APIs

Packages

v0.42.1

20 Feb 17:25
Compare
Choose a tag to compare

Version 0.42.1 - 2/20/25, 5:25 PM

Changes

Fix

Packages

v0.42.0

13 Feb 18:45
Compare
Choose a tag to compare

Version 0.42.0 - 2/13/25, 6:44 PM

Changes

Feat

  • form-core: field meta and errors are shifted when doing array operations (990a916) by Leonardo Montini

Packages

v0.41.4

11 Feb 22:49
Compare
Choose a tag to compare

Version 0.41.4 - 2/11/25, 10:48 PM

Changes

Fix

  • form-core: skip form validation for each single field on form submit (#1147) (5f1bc0b) by Leonardo Montini

Ci

  • pin nx version to fix build (#1143) (136a584) by Leonardo Montini

Docs

  • risks of omitting useStore selector (#1126) (2bd0696) by Harry Whorlow

Packages