feat(apollo-vertex): Form component on TanStack Form + Zod#888
feat(apollo-vertex): Form component on TanStack Form + Zod#888frankkluijtmans wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📊 Coverage + size by packagePer-package bundle size on this PR (no JS/TS source changes detected under
"Coverage" is each package's own |
There was a problem hiding this comment.
Pull request overview
Adds a new composition-first Form abstraction to apollo-vertex using TanStack Form + Zod (Standard Schema), replaces the previous React Hook Form-based implementation, and migrates the Settings template and docs to the new API.
Changes:
- Replaces the old
registry/form/form.tsx(React Hook Form) with a TanStack Form hook (useAppForm) and Apollo-bound field/form components (Text, Textarea, Select, RadioGroup, Checkbox, Switch, SubmitButton, error helpers). - Migrates
WorkspaceSettingsto the new form API and removesreact-hook-form/@hookform/resolversdependencies. - Updates the component registry entry, docs pages, and adds a live demo with i18n-backed validation messages.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Removes RHF deps and adds @tanstack/react-form (and transitive TanStack form/store packages). |
| apps/apollo-vertex/tsconfig.json | Updates the @/components/ui/form path alias to the new registry entrypoint. |
| apps/apollo-vertex/templates/settings/WorkspaceSettings.tsx | Migrates settings page form to useAppForm + bound field components. |
| apps/apollo-vertex/registry/form/use-translated-errors.ts | Adds helper for translating validation error messages via react-i18next. |
| apps/apollo-vertex/registry/form/textarea-field.tsx | Adds TanStack Form-bound textarea field component. |
| apps/apollo-vertex/registry/form/text-field.tsx | Adds TanStack Form-bound text field component. |
| apps/apollo-vertex/registry/form/switch-field.tsx | Adds TanStack Form-bound switch field component. |
| apps/apollo-vertex/registry/form/submit-button.tsx | Adds a submit button component that subscribes to form state. |
| apps/apollo-vertex/registry/form/select-field.tsx | Adds TanStack Form-bound select field component. |
| apps/apollo-vertex/registry/form/radio-group-field.tsx | Adds TanStack Form-bound radio group field component. |
| apps/apollo-vertex/registry/form/index.ts | New public export surface for the form package entrypoint. |
| apps/apollo-vertex/registry/form/form.tsx | Replaces RHF form implementation with createFormHook wiring + exports. |
| apps/apollo-vertex/registry/form/form-error-summary.tsx | Adds a form-level error summary component. |
| apps/apollo-vertex/registry/form/form-context.ts | Adds TanStack Form hook contexts (field/form). |
| apps/apollo-vertex/registry/form/field-utils.ts | Adds shared option type + error normalization utilities. |
| apps/apollo-vertex/registry/form/field-error.tsx | Adds translated FieldError wrapper for custom fields. |
| apps/apollo-vertex/registry/form/checkbox-field.tsx | Adds TanStack Form-bound checkbox field component. |
| apps/apollo-vertex/registry.json | Updates the registry metadata for the new Form component and file set. |
| apps/apollo-vertex/package.json | Removes RHF deps and adds @tanstack/react-form. |
| apps/apollo-vertex/locales/en.json | Adds i18n keys for the form demo validation messages. |
| apps/apollo-vertex/app/templates/settings/page.mdx | Updates Settings template docs to reference the new Form approach. |
| apps/apollo-vertex/app/components/form/page.mdx | Rewrites the Form docs page for TanStack Form + Zod + demo. |
| apps/apollo-vertex/app/components/form/form-demo.tsx | Adds a live demo form used by the docs page. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
a8ea90f to
b494894
Compare
b494894 to
c60c921
Compare
Dependency License Review
License distribution
Excluded packages
|
… Form and Zod component
ef22d73 to
7592dd9
Compare
| <Switch | ||
| id={field.name} | ||
| checked={field.state.value} | ||
| onCheckedChange={field.handleChange} | ||
| /> |
| <Switch | ||
| id={field.name} | ||
| checked={field.state.value} | ||
| onCheckedChange={field.handleChange} | ||
| /> |
| <Switch | ||
| id={field.name} | ||
| checked={field.state.value} | ||
| onCheckedChange={field.handleChange} | ||
| /> |
Adds a composition-first Form component to apollo-vertex built on TanStack Form and Zod (Standard Schema, so schemas pass straight into validators with no resolver), including Apollo-bound field components (Text, Textarea, Select, RadioGroup, Checkbox, Switch), a
SubmitButton, and translatable validation errors viaFieldErrorandFormErrorSummary. It replaces the previous React Hook Formformcomponent, migrates the Settings template (WorkspaceSettings) ontouseAppForm, and removes the now-unusedreact-hook-formand@hookform/resolversdependencies from apollo-vertex. A docs page with a live demo is added and the Settings template docs are updated to match the new approach.👨 Generated with Kluijt Code