diff --git a/README.md b/README.md
index 12696d169a..e8b928f2fb 100644
--- a/README.md
+++ b/README.md
@@ -43,8 +43,9 @@
-
+
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
+
# TanStack Form
diff --git a/docs/framework/lit/guides/form-composition.md b/docs/framework/lit/guides/form-composition.md
index e9157095ae..f48da06f1f 100644
--- a/docs/framework/lit/guides/form-composition.md
+++ b/docs/framework/lit/guides/form-composition.md
@@ -45,11 +45,13 @@ export class TextField extends LitElement {
this.field.handleChange((e.target as HTMLInputElement).value)}
/>
- ${this.field.state.meta.isTouched && this.field.state.meta.errors.length
- ? html`
- ${this.field.state.meta.errors.join(', ')}
-
`
- : ''}
+ ${
+ this.field.state.meta.isTouched && this.field.state.meta.errors.length
+ ? html`
+ ${this.field.state.meta.errors.join(', ')}
+
`
+ : ''
+ }
`
}
}
diff --git a/docs/framework/lit/guides/form-groups.md b/docs/framework/lit/guides/form-groups.md
index 1736602ffa..dddf177fe8 100644
--- a/docs/framework/lit/guides/form-groups.md
+++ b/docs/framework/lit/guides/form-groups.md
@@ -70,61 +70,65 @@ export class MyForm extends LitElement {
render() {
return html`
- ${this.step === 0
- ? this.#form.group(
- {
- name: 'step1',
- onGroupSubmit: () => {
- // We can move the step forward when validation passes
- this.step++
+ ${
+ this.step === 0
+ ? this.#form.group(
+ {
+ name: 'step1',
+ onGroupSubmit: () => {
+ // We can move the step forward when validation passes
+ this.step++
+ },
+ onGroupSubmitInvalid: () => {
+ // Or handle invalid submissions, just like a top-level form
+ },
+ onSubmitMeta: {} as SomeType,
},
- onGroupSubmitInvalid: () => {
- // Or handle invalid submissions, just like a top-level form
+ (group) => html`
+
+ `,
+ )
+ : nothing
+ }
+ ${
+ this.step === 1
+ ? this.#form.group(
+ {
+ name: 'step2',
+ onGroupSubmit: () => {
+ // Then, use `this.#form.api.handleSubmit()` to submit the entire form
+ this.#form.api.handleSubmit()
+ },
},
- onSubmitMeta: {} as SomeType,
- },
- (group) => html`
-
- `,
- )
- : nothing}
- ${this.step === 1
- ? this.#form.group(
- {
- name: 'step2',
- onGroupSubmit: () => {
- // Then, use `this.#form.api.handleSubmit()` to submit the entire form
- this.#form.api.handleSubmit()
- },
- },
- (group) => html`
-
- `,
- )
- : nothing}
+ (group) => html`
+
+ `,
+ )
+ : nothing
+ }
`
}
}
diff --git a/docs/framework/lit/guides/validation.md b/docs/framework/lit/guides/validation.md
index 4c8b693c4b..359e98a04c 100644
--- a/docs/framework/lit/guides/validation.md
+++ b/docs/framework/lit/guides/validation.md
@@ -38,9 +38,11 @@ import { html, nothing } from 'lit'
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`
},
)}`
@@ -72,9 +74,11 @@ import { html, nothing } from 'lit'
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`
},
)}`
@@ -107,9 +111,11 @@ import { html, nothing } from 'lit'
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`
},
)}`
@@ -134,9 +140,11 @@ import { html, nothing } from 'lit'
(field) => {
return html`
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(',')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(',')}`
+ : nothing
+ }
`
},
)}`
@@ -157,9 +165,11 @@ import { html, nothing } from 'lit'
(field) => {
return html`
- ${field.state.meta.errorMap['onChange']
- ? html`${field.state.meta.errorMap['onChange']}`
- : nothing}
+ ${
+ field.state.meta.errorMap['onChange']
+ ? html`${field.state.meta.errorMap['onChange']}`
+ : nothing
+ }
`
},
)}`
@@ -225,16 +235,18 @@ export class MyForm extends LitElement {
return html`
- ${this.#form.api.state.errorMap.onChange
- ? html`
-
- There was an error on the form:
- ${this.#form.api.state.errorMap.onChange}
-
- `
- : nothing}
+ ${
+ this.#form.api.state.errorMap.onChange
+ ? html`
+
+ There was an error on the form:
+ ${this.#form.api.state.errorMap.onChange}
+
+ `
+ : nothing
+ }
`
@@ -306,23 +318,27 @@ export class MyForm extends LitElement {
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`,
)}
- ${this.#form.api.state.errorMap.onSubmit
- ? html`
-
- There was an error on the form:
- ${this.#form.api.state.errorMap.onSubmit}
-
- `
- : nothing}
+ ${
+ this.#form.api.state.errorMap.onSubmit
+ ? html`
+
+ There was an error on the form:
+ ${this.#form.api.state.errorMap.onSubmit}
+
+ `
+ : nothing
+ }
@@ -400,9 +416,11 @@ import { html, nothing } from 'lit'
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`
},
)}`
@@ -438,9 +456,11 @@ import { html, nothing } from 'lit'
field.handleChange(target.valueAsNumber)
}}"
/>
- ${!field.state.meta.isValid
- ? html`${field.state.meta.errors.join(', ')}`
- : nothing}
+ ${
+ !field.state.meta.isValid
+ ? html`${field.state.meta.errors.join(', ')}`
+ : nothing
+ }
`
},
)}`
@@ -613,9 +633,7 @@ You can access this flag via `this.#form.api.state` and use the value in order t
```ts
class MyForm extends LitElement {
- #form = new TanStackFormController(this, {
- /* ... */
- })
+ #form = new TanStackFormController(this, {/* ... */})
render() {
return html`
diff --git a/docs/framework/preact/guides/form-composition.md b/docs/framework/preact/guides/form-composition.md
index 207863b6ae..84efa7b10f 100644
--- a/docs/framework/preact/guides/form-composition.md
+++ b/docs/framework/preact/guides/form-composition.md
@@ -282,9 +282,7 @@ Usage:
```tsx
// sharedOpts.ts
-const formOpts = formOptions({
- /* ... */
-})
+const formOpts = formOptions({/* ... */})
function ParentComponent() {
const form = useAppForm({ ...formOptions /* ... */ })
diff --git a/docs/framework/react/guides/form-composition.md b/docs/framework/react/guides/form-composition.md
index cf2db1cc19..ddaa63ce9a 100644
--- a/docs/framework/react/guides/form-composition.md
+++ b/docs/framework/react/guides/form-composition.md
@@ -355,9 +355,7 @@ Usage:
```tsx
// sharedOpts.ts
-const formOpts = formOptions({
- /* ... */
-})
+const formOpts = formOptions({/* ... */})
function ParentComponent() {
const form = useAppForm({ ...formOptions /* ... */ })
diff --git a/docs/framework/solid/guides/validation.md b/docs/framework/solid/guides/validation.md
index c1ff12dbf0..712d8afafd 100644
--- a/docs/framework/solid/guides/validation.md
+++ b/docs/framework/solid/guides/validation.md
@@ -543,9 +543,7 @@ The form state object has a `canSubmit` flag that is false when any field is inv
You can subscribe to it via `form.Subscribe` and use the value in order to, for example, disable the submit button when the form is invalid (in practice, disabled buttons are not accessible, use `aria-disabled` instead).
```tsx
-const form = createForm(() => ({
- /* ... */
-}))
+const form = createForm(() => ({/* ... */}))
return (
/* ... */
diff --git a/docs/overview.md b/docs/overview.md
index 4ea563e014..e23f0fea9b 100644
--- a/docs/overview.md
+++ b/docs/overview.md
@@ -779,18 +779,22 @@ export class TanStackFormDemo extends LitElement {
field.handleChange(target.value)
}}"
/>
- ${field.state.meta.isTouched && !field.state.meta.isValid
- ? html`${repeat(
- field.state.meta.errors,
- (__, idx) => idx,
- (error) => {
- return html`${error}
`
- },
- )}`
- : nothing}
- ${field.state.meta.isValidating
- ? html`Validating...
`
- : nothing}
+ ${
+ field.state.meta.isTouched && !field.state.meta.isValid
+ ? html`${repeat(
+ field.state.meta.errors,
+ (__, idx) => idx,
+ (error) => {
+ return html`${error}
`
+ },
+ )}`
+ : nothing
+ }
+ ${
+ field.state.meta.isValidating
+ ? html`Validating...
`
+ : nothing
+ }
`
},
)}
diff --git a/examples/lit/large-form/src/components/text-field.ts b/examples/lit/large-form/src/components/text-field.ts
index 27003af42f..759c1a6275 100644
--- a/examples/lit/large-form/src/components/text-field.ts
+++ b/examples/lit/large-form/src/components/text-field.ts
@@ -34,14 +34,16 @@ export class TextField extends LitElement {
field.handleChange((e.target as HTMLInputElement).value)}
/>
- ${field.state.meta.isTouched && field.state.meta.errors.length
- ? repeat(
- field.state.meta.errors,
- (_, idx) => idx,
- (error: unknown) =>
- html`${String(error)}
`,
- )
- : nothing}
+ ${
+ field.state.meta.isTouched && field.state.meta.errors.length
+ ? repeat(
+ field.state.meta.errors,
+ (_, idx) => idx,
+ (error: unknown) =>
+ html`${String(error)}
`,
+ )
+ : nothing
+ }
${field.state.meta.isValidating ? html`Validating...
` : nothing}
`
diff --git a/examples/lit/multi-step-wizard/src/components/text-field.ts b/examples/lit/multi-step-wizard/src/components/text-field.ts
index 190a06bcdd..37fe656143 100644
--- a/examples/lit/multi-step-wizard/src/components/text-field.ts
+++ b/examples/lit/multi-step-wizard/src/components/text-field.ts
@@ -34,19 +34,21 @@ export class TextField extends LitElement {
field.handleChange((e.target as HTMLInputElement).value)}
/>
- ${field.state.meta.isTouched && field.state.meta.errors.length
- ? repeat(
- field.state.meta.errors,
- (_, idx) => idx,
- (error: unknown) => {
- const message =
- error && typeof error === 'object' && 'message' in error
- ? String((error as { message: unknown }).message)
- : String(error)
- return html`${message}
`
- },
- )
- : nothing}
+ ${
+ field.state.meta.isTouched && field.state.meta.errors.length
+ ? repeat(
+ field.state.meta.errors,
+ (_, idx) => idx,
+ (error: unknown) => {
+ const message =
+ error && typeof error === 'object' && 'message' in error
+ ? String((error as { message: unknown }).message)
+ : String(error)
+ return html`${message}
`
+ },
+ )
+ : nothing
+ }
${field.state.meta.isValidating ? html`Validating...
` : nothing}
`
diff --git a/examples/lit/multi-step-wizard/src/features/wizard/page.ts b/examples/lit/multi-step-wizard/src/features/wizard/page.ts
index 2bd19029da..59c39ad594 100644
--- a/examples/lit/multi-step-wizard/src/features/wizard/page.ts
+++ b/examples/lit/multi-step-wizard/src/features/wizard/page.ts
@@ -40,20 +40,24 @@ export class WizardPage extends LitElement {
render() {
return html`
- ${this.step === 0
- ? html``
- : nothing}
- ${this.step === 1
- ? html``
- : nothing}
+ ${
+ this.step === 0
+ ? html``
+ : nothing
+ }
+ ${
+ this.step === 1
+ ? html``
+ : nothing
+ }
`
}
}
diff --git a/examples/lit/simple/src/index.ts b/examples/lit/simple/src/index.ts
index b81e8563a3..a337814ac6 100644
--- a/examples/lit/simple/src/index.ts
+++ b/examples/lit/simple/src/index.ts
@@ -59,18 +59,22 @@ export class TanStackFormDemo extends LitElement {
field.handleChange(target.value)
}}"
/>
- ${field.state.meta.isTouched && !field.state.meta.isValid
- ? html`${repeat(
- field.state.meta.errors,
- (__, idx) => idx,
- (error) => {
- return html`${error}
`
- },
- )}`
- : nothing}
- ${field.state.meta.isValidating
- ? html`Validating...
`
- : nothing}
+ ${
+ field.state.meta.isTouched && !field.state.meta.isValid
+ ? html`${repeat(
+ field.state.meta.errors,
+ (__, idx) => idx,
+ (error) => {
+ return html`${error}
`
+ },
+ )}`
+ : nothing
+ }
+ ${
+ field.state.meta.isValidating
+ ? html`Validating...
`
+ : nothing
+ }
`
},
)}
diff --git a/examples/lit/standard-schema/src/index.ts b/examples/lit/standard-schema/src/index.ts
index 160a027bb4..d4082f9e0c 100644
--- a/examples/lit/standard-schema/src/index.ts
+++ b/examples/lit/standard-schema/src/index.ts
@@ -97,20 +97,24 @@ export class TanStackFormDemo extends LitElement {
field.handleChange(target.value)
}}"
/>
- ${field.state.meta.isTouched && !field.state.meta.isValid
- ? html`${repeat(
- field.state.meta.errors,
- (__, idx) => idx,
- (error) => {
- return html`
- ${error?.message}
-
`
- },
- )}`
- : nothing}
- ${field.state.meta.isValidating
- ? html`Validating...
`
- : nothing}
+ ${
+ field.state.meta.isTouched && !field.state.meta.isValid
+ ? html`${repeat(
+ field.state.meta.errors,
+ (__, idx) => idx,
+ (error) => {
+ return html`
+ ${error?.message}
+
`
+ },
+ )}`
+ : nothing
+ }
+ ${
+ field.state.meta.isValidating
+ ? html`Validating...
`
+ : nothing
+ }
`
},
)}
@@ -133,20 +137,24 @@ export class TanStackFormDemo extends LitElement {
field.handleChange(target.value)
}}"
/>
- ${field.state.meta.isTouched && !field.state.meta.isValid
- ? html`${repeat(
- field.state.meta.errors,
- (__, idx) => idx,
- (error) => {
- return html`
- ${error?.message}
-
`
- },
- )}`
- : nothing}
- ${field.state.meta.isValidating
- ? html`Validating...
`
- : nothing}
+ ${
+ field.state.meta.isTouched && !field.state.meta.isValid
+ ? html`${repeat(
+ field.state.meta.errors,
+ (__, idx) => idx,
+ (error) => {
+ return html`
+ ${error?.message}
+
`
+ },
+ )}`
+ : nothing
+ }
+ ${
+ field.state.meta.isValidating
+ ? html`Validating...
`
+ : nothing
+ }
`
},
)}
diff --git a/examples/lit/ui-libraries/src/index.ts b/examples/lit/ui-libraries/src/index.ts
index 6e1448765a..c96247e3f4 100644
--- a/examples/lit/ui-libraries/src/index.ts
+++ b/examples/lit/ui-libraries/src/index.ts
@@ -120,43 +120,47 @@ export class TanStackFormDemo extends LitElement {
@blur="${() => employedField.handleBlur()}"
>
- ${employedField.state.value
- ? this.#form.field(
- {
- name: `employees[${index}].jobTitle`,
- defaultValue: '',
- validators: {
- onChange: ({ value }) => {
- return value?.length === 0
- ? 'Needs to have a job here'
- : null
+ ${
+ employedField.state.value
+ ? this.#form.field(
+ {
+ name: `employees[${index}].jobTitle`,
+ defaultValue: '',
+ validators: {
+ onChange: ({ value }) => {
+ return value?.length === 0
+ ? 'Needs to have a job here'
+ : null
+ },
},
},
- },
- (jobTitleField) => {
- return html`
-
-
- jobTitleField.handleBlur()}"
- @input="${(e: Event) => {
- const target =
- e.target as HTMLInputElement
- jobTitleField.handleChange(target.value)
- }}"
- .error="${!jobTitleField.state.meta
- .isValid}"
- .errorText="${jobTitleField.state.meta.errors.join(
- ', ',
- )}"
- >
-
`
- },
- )
- : ''} `
+ (jobTitleField) => {
+ return html`
+
+
+ jobTitleField.handleBlur()}"
+ @input="${(e: Event) => {
+ const target =
+ e.target as HTMLInputElement
+ jobTitleField.handleChange(
+ target.value,
+ )
+ }}"
+ .error="${!jobTitleField.state.meta
+ .isValid}"
+ .errorText="${jobTitleField.state.meta.errors.join(
+ ', ',
+ )}"
+ >
+
`
+ },
+ )
+ : ''
+ } `
},
)}
`
diff --git a/examples/react/next-server-actions-zod/package.json b/examples/react/next-server-actions-zod/package.json
index 95d79d374b..e95c3234af 100644
--- a/examples/react/next-server-actions-zod/package.json
+++ b/examples/react/next-server-actions-zod/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@tanstack/react-form-nextjs": "^1.33.5",
- "@tanstack/react-store": "^0.11.0",
+ "@tanstack/react-store": "^0.11.1",
"next": "16.2.6",
"react": "19.1.0",
"react-dom": "19.1.0",
diff --git a/examples/react/next-server-actions/package.json b/examples/react/next-server-actions/package.json
index 5a064c62cf..a14d351ba8 100644
--- a/examples/react/next-server-actions/package.json
+++ b/examples/react/next-server-actions/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@tanstack/react-form-nextjs": "^1.33.5",
- "@tanstack/react-store": "^0.11.0",
+ "@tanstack/react-store": "^0.11.1",
"next": "16.2.6",
"react": "19.1.0",
"react-dom": "19.1.0"
diff --git a/examples/react/remix/package.json b/examples/react/remix/package.json
index 1e2167d93f..7c6bdafe99 100644
--- a/examples/react/remix/package.json
+++ b/examples/react/remix/package.json
@@ -12,7 +12,7 @@
"@remix-run/react": "^2.17.4",
"@remix-run/serve": "^2.17.4",
"@tanstack/react-form-remix": "^1.33.5",
- "@tanstack/react-store": "^0.11.0",
+ "@tanstack/react-store": "^0.11.1",
"isbot": "^5.1.30",
"react": "19.1.0",
"react-dom": "19.1.0"
diff --git a/examples/react/tanstack-start/package.json b/examples/react/tanstack-start/package.json
index 64068a5aa4..72aef4d4f1 100644
--- a/examples/react/tanstack-start/package.json
+++ b/examples/react/tanstack-start/package.json
@@ -12,7 +12,7 @@
"@tanstack/react-form-start": "^1.33.5",
"@tanstack/react-router": "^1.134.9",
"@tanstack/react-start": "^1.168.27",
- "@tanstack/react-store": "^0.11.0",
+ "@tanstack/react-store": "^0.11.1",
"react": "19.1.0",
"react-dom": "19.1.0"
},
diff --git a/knip.json b/knip.json
index a91f5eab51..3bd267bce4 100755
--- a/knip.json
+++ b/knip.json
@@ -1,5 +1,18 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
- "ignoreDependencies": ["@tanstack/devtools"],
- "ignoreWorkspaces": ["examples/**"]
+ "ignoreDependencies": [
+ "@tanstack/devtools",
+ "ts-node",
+ "@vue/runtime-core",
+ "@vue/reactivity"
+ ],
+ "ignoreWorkspaces": ["examples/**"],
+ "workspaces": {
+ "packages/octane-form": {
+ "entry": ["localsrc/program-transformer.cts"]
+ }
+ },
+ "compilers": {
+ "tsrx": true
+ }
}
diff --git a/package.json b/package.json
index 5dabc83e40..052d5b3969 100644
--- a/package.json
+++ b/package.json
@@ -44,14 +44,12 @@
"@changesets/changelog-github": "^1.0.1",
"@changesets/cli": "^3.0.3",
"@eslint-react/eslint-plugin": "^1.53.1",
- "@solidjs/testing-library": "^0.8.10",
"@tanstack/eslint-config": "0.3.2",
"@tanstack/typedoc-config": "0.3.1",
"@tanstack/vite-config": "0.4.1",
"@testing-library/jest-dom": "^6.8.0",
- "@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
- "@testing-library/vue": "^8.1.0",
+ "@tsrx/prettier-plugin": "0.4.7",
"@types/node": "^24.1.0",
"@vitest/coverage-istanbul": "^3.2.4",
"eslint": "9.36.0",
@@ -65,6 +63,7 @@
"publint": "^0.3.15",
"sherif": "^1.9.0",
"tinyglobby": "^0.2.15",
+ "ts-node": "^10.9.2",
"typescript": "5.9.3",
"typescript54": "npm:typescript@5.4.5",
"typescript55": "npm:typescript@5.5.4",
diff --git a/packages/angular-form/src/app-field.ts b/packages/angular-form/src/app-field.ts
index 6e5897f2f3..a41be3aa15 100644
--- a/packages/angular-form/src/app-field.ts
+++ b/packages/angular-form/src/app-field.ts
@@ -24,20 +24,16 @@ export class TanStackAppField<
TOnMount extends undefined | FieldValidateOrFn,
TOnChange extends undefined | FieldValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnBlur extends undefined | FieldValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnSubmit extends undefined | FieldValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnDynamic extends undefined | FieldValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TFormOnMount extends undefined | FormValidateOrFn,
TFormOnChange extends undefined | FormValidateOrFn,
TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn,
diff --git a/packages/angular-form/src/tanstack-field.ts b/packages/angular-form/src/tanstack-field.ts
index e5ff98e964..346d5f67d4 100644
--- a/packages/angular-form/src/tanstack-field.ts
+++ b/packages/angular-form/src/tanstack-field.ts
@@ -41,20 +41,16 @@ export class TanStackField<
TOnMount extends undefined | FieldValidateOrFn,
TOnChange extends undefined | FieldValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnBlur extends undefined | FieldValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnSubmit extends undefined | FieldValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnDynamic extends undefined | FieldValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TFormOnMount extends undefined | FormValidateOrFn,
TFormOnChange extends undefined | FormValidateOrFn,
TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn,
diff --git a/packages/angular-form/src/tanstack-form-group.ts b/packages/angular-form/src/tanstack-form-group.ts
index 5706128944..f51d307bd8 100644
--- a/packages/angular-form/src/tanstack-form-group.ts
+++ b/packages/angular-form/src/tanstack-form-group.ts
@@ -37,27 +37,20 @@ export class TanStackFormGroup<
TData extends DeepValue,
TOnMount extends undefined | FormGroupValidateOrFn,
TOnChange extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnBlur extends undefined | FormGroupValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnSubmit extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnDynamic extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TSubmitMeta,
TFormOnMount extends undefined | FormValidateOrFn,
TFormOnChange extends undefined | FormValidateOrFn,
diff --git a/packages/form-core/package.json b/packages/form-core/package.json
index cc59a8f436..d8def91b5a 100644
--- a/packages/form-core/package.json
+++ b/packages/form-core/package.json
@@ -54,7 +54,7 @@
"dependencies": {
"@tanstack/devtools-event-client": "^0.4.1",
"@tanstack/pacer-lite": "^0.1.1",
- "@tanstack/store": "^0.11.0"
+ "@tanstack/store": "^0.11.1"
},
"devDependencies": {
"arktype": "^2.1.22",
diff --git a/packages/form-core/src/FieldApi.ts b/packages/form-core/src/FieldApi.ts
index 80770f8897..70df6a639c 100644
--- a/packages/form-core/src/FieldApi.ts
+++ b/packages/form-core/src/FieldApi.ts
@@ -162,8 +162,7 @@ export type FieldValidateOrFn<
TName extends DeepKeys,
TData extends DeepValue = DeepValue,
> =
- | FieldValidateFn
- | StandardSchemaV1
+ FieldValidateFn | StandardSchemaV1
/**
* @private
@@ -183,20 +182,16 @@ export interface FieldValidators<
TOnMount extends undefined | FieldValidateOrFn,
TOnChange extends undefined | FieldValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnBlur extends undefined | FieldValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnSubmit extends undefined | FieldValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnDynamic extends undefined | FieldValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
> {
/**
* An optional function, that runs on the mount event of input.
@@ -286,20 +281,16 @@ interface FieldExtraOptions<
TOnMount extends undefined | FieldValidateOrFn,
TOnChange extends undefined | FieldValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnBlur extends undefined | FieldValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnSubmit extends undefined | FieldValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnDynamic extends undefined | FieldValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
> {
/**
* A list of validators to pass to the field
@@ -335,20 +326,16 @@ export interface FieldOptions<
TOnMount extends undefined | FieldValidateOrFn,
TOnChange extends undefined | FieldValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnBlur extends undefined | FieldValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnSubmit extends undefined | FieldValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
TOnDynamic extends undefined | FieldValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
>
extends
FieldExtraOptions<
@@ -385,49 +372,36 @@ export interface FieldApiOptions<
in out TName extends DeepKeys,
in out TData extends DeepValue,
in out TOnMount extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnChange extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnBlur extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnSubmit extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnDynamic extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TFormOnMount extends undefined | FormValidateOrFn,
in out TFormOnChange extends undefined | FormValidateOrFn,
in out TFormOnChangeAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnBlur extends undefined | FormValidateOrFn,
in out TFormOnBlurAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnSubmit extends undefined | FormValidateOrFn,
in out TFormOnSubmitAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnDynamic extends undefined | FormValidateOrFn,
in out TFormOnDynamicAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnServer extends undefined | FormAsyncValidateOrFn,
in out TParentSubmitMeta,
>
@@ -522,49 +496,36 @@ export class FieldApi<
in out TName extends DeepKeys,
in out TData extends DeepValue,
in out TOnMount extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnChange extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnChangeAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnBlur extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnBlurAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnSubmit extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnSubmitAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TOnDynamic extends
- | undefined
- | FieldValidateOrFn,
+ undefined | FieldValidateOrFn,
in out TOnDynamicAsync extends
- | undefined
- | FieldAsyncValidateOrFn,
+ undefined | FieldAsyncValidateOrFn,
in out TFormOnMount extends undefined | FormValidateOrFn,
in out TFormOnChange extends undefined | FormValidateOrFn,
in out TFormOnChangeAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnBlur extends undefined | FormValidateOrFn,
in out TFormOnBlurAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnSubmit extends undefined | FormValidateOrFn,
in out TFormOnSubmitAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnDynamic extends undefined | FormValidateOrFn,
in out TFormOnDynamicAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnServer extends undefined | FormAsyncValidateOrFn,
in out TParentSubmitMeta,
> implements FieldLikeAPI<
diff --git a/packages/form-core/src/FormApi.ts b/packages/form-core/src/FormApi.ts
index 4400017d30..e79c0e8a04 100644
--- a/packages/form-core/src/FormApi.ts
+++ b/packages/form-core/src/FormApi.ts
@@ -117,8 +117,7 @@ export type FormValidateFn = (props: {
* @private
*/
export type FormValidateOrFn =
- | FormValidateFn
- | StandardSchemaV1
+ FormValidateFn | StandardSchemaV1
export type UnwrapFormValidateOrFn<
TValidateOrFn extends undefined | FormValidateOrFn,
@@ -171,8 +170,7 @@ type ValidationPromiseResult =
* @private
*/
export type FormAsyncValidateOrFn =
- | FormValidateAsyncFn
- | StandardSchemaV1
+ FormValidateAsyncFn | StandardSchemaV1
export type UnwrapFormAsyncValidateOrFn<
TValidateOrFn extends undefined | FormAsyncValidateOrFn,
@@ -1120,8 +1118,7 @@ export class FormApi<
).state as never
for (const errKey of Object.keys(baseStoreVal.errorMap)) {
const errKeyMap = baseStoreVal.errorMap[errKey as never] as
- | GlobalFormValidationError
- | undefined
+ GlobalFormValidationError | undefined
if (
errKeyMap === undefined ||
!isGlobalFormValidationError(errKeyMap)
@@ -1302,8 +1299,7 @@ export class FormApi<
// The group's own field-meta entry (its `errorMap` is where the
// group's own validators write via `setFieldMeta`).
const ownFieldMeta = currFieldMeta[groupName] as
- | AnyFieldLikeMeta
- | undefined
+ AnyFieldLikeMeta | undefined
// Aggregate validity / interaction flags across descendant fields
// (excluding the group's own self-entry — its validity is tracked
@@ -2186,8 +2182,7 @@ export class FormApi<
const promises: Promise>[] = []
let fieldErrorsFromFormValidators:
- | Partial, ValidationError>>
- | undefined
+ Partial, ValidationError>> | undefined
for (const validateObj of validates) {
if (!validateObj.validate) continue
@@ -2204,9 +2199,7 @@ export class FormApi<
promises.push(
new Promise>(async (resolve) => {
let rawError!:
- | ValidationError
- | FormValidationError
- | undefined
+ ValidationError | FormValidationError | undefined
try {
rawError = await new Promise((rawResolve, rawReject) => {
setTimeout(async () => {
diff --git a/packages/form-core/src/FormGroupApi.ts b/packages/form-core/src/FormGroupApi.ts
index 4790d5505c..833d8fdd1b 100644
--- a/packages/form-core/src/FormGroupApi.ts
+++ b/packages/form-core/src/FormGroupApi.ts
@@ -202,27 +202,20 @@ export interface FormGroupValidators<
TData extends DeepValue,
TOnMount extends undefined | FormGroupValidateOrFn,
TOnChange extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnChangeAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnBlur extends undefined | FormGroupValidateOrFn,
TOnBlurAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnSubmit extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnSubmitAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
TOnDynamic extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
TOnDynamicAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
> {
/**
* An optional function, that runs on the mount event of input.
@@ -310,50 +303,37 @@ interface FormGroupExtraOptions<
in out TName extends DeepKeys,
in out TData extends DeepValue,
in out TOnMount extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnChange extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnChangeAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TOnBlur extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnBlurAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TOnSubmit extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnSubmitAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TOnDynamic extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnDynamicAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TSubmitMeta,
in out TFormOnMount extends undefined | FormValidateOrFn,
in out TFormOnChange extends undefined | FormValidateOrFn,
in out TFormOnChangeAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnBlur extends undefined | FormValidateOrFn,
in out TFormOnBlurAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnSubmit extends undefined | FormValidateOrFn,
in out TFormOnSubmitAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnDynamic extends undefined | FormValidateOrFn,
in out TFormOnDynamicAsync extends
- | undefined
- | FormAsyncValidateOrFn,
+ undefined | FormAsyncValidateOrFn,
in out TFormOnServer extends undefined | FormAsyncValidateOrFn,
in out TParentSubmitMeta,
> {
@@ -470,50 +450,37 @@ export interface FormGroupOptions<
in out TName extends DeepKeys,
in out TData extends DeepValue,
in out TOnMount extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnChange extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnChangeAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TOnBlur extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnBlurAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn,
in out TOnSubmit extends
- | undefined
- | FormGroupValidateOrFn,
+ undefined | FormGroupValidateOrFn,
in out TOnSubmitAsync extends
- | undefined
- | FormGroupAsyncValidateOrFn,
+ undefined | FormGroupAsyncValidateOrFn