fix: Field components should now infer state.value properly

* chore: refactor TS typings for React

* fix: field should now infer state.value properly in React adapter

* chore: fix Vue package typings

* chore: fix linting

* chore: fix React adapter

* chore: improve performance of TData type in FieldApi

* chore: add back index and parent type

* chore: add Vue TSC dep on Vue example

* chore: fix lint and type test

* chore: update Vite stuff

* chore: add implicit dep for Vue and React examples

* chore: add type test pre-req

* chore: install deps from examples in PR CI

* chore: remove filter from more installation
This commit is contained in:
Corbin Crutchley
2023-09-09 03:40:29 -07:00
committed by GitHub
parent b5a768f182
commit 160f71275f
14 changed files with 421 additions and 512 deletions

View File

@@ -13,12 +13,11 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"zod": "^3.21.4",
"@tanstack/form-core": "0.3.2",
"@tanstack/vue-form": "0.3.2"
"@tanstack/form-core": "0.3.2"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
"vite": "^3.0.0"
"@vitejs/plugin-react": "^4.0.4",
"vite": "^4.4.9"
},
"browserslist": {
"production": [
@@ -31,5 +30,18 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"nx": {
"implicitDependencies": [
"@tanstack/form-core",
"@tanstack/react-form"
],
"targets": {
"test:types": {
"dependsOn": [
"build"
]
}
}
}
}

View File

@@ -5,17 +5,31 @@
"dev": "vite",
"build": "vite build",
"build:dev": "vite build -m development",
"test:types": "vue-tsc --noEmit",
"serve": "vite preview"
},
"dependencies": {
"@tanstack/vue-form": "0.3.2",
"vue": "^3.3.4",
"@tanstack/form-core": "0.3.2",
"@tanstack/react-form": "0.3.2"
"@tanstack/vue-form": "0.3.2",
"vue": "^3.3.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue": "^4.3.4",
"typescript": "^5.0.4",
"vite": "^4.4.4"
"vite": "^4.4.9",
"vue-tsc": "^1.8.10"
},
"nx": {
"implicitDependencies": [
"@tanstack/form-core",
"@tanstack/vue-form"
],
"targets": {
"test:types": {
"dependsOn": [
"build"
]
}
}
}
}

View File

@@ -15,7 +15,7 @@ const form = useForm({
form.provideFormContext()
async function onChangeFirstName(value) {
async function onChangeFirstName(value: string) {
await new Promise((resolve) => setTimeout(resolve, 1000))
return value.includes(`error`) && `No 'error' allowed in first name`
}