feat: add Vue 3 integration (@autoform/vue)#200
feat: add Vue 3 integration (@autoform/vue)#200mvtandas wants to merge 4 commits intovantezzen:mainfrom
Conversation
Add the Vue 3 integration for AutoForm, following the same architecture as @autoform/react. Components: - AutoForm: Main form component with schema parsing, validation, and submission - AutoFormField: Renders individual fields based on schema type - ObjectField: Handles nested object schemas - ArrayField: Handles array schemas with add/remove Composables: - useAutoForm: Inject/provide context for nested components - provideAutoForm: Provide context from AutoForm root Utilities: - buildZodFieldConfig: Type-safe Zod field config builder for Vue - buildYupFieldConfig: Type-safe Yup field config builder for Vue - getPathInObject / setPathInObject: Nested path helpers Features: - Reactive form state with Vue 3 reactivity - Automatic validation via SchemaProvider - Custom UI and field components via props - Array field support with add/remove - Nested object field support - Form reset and error clearing - v-model compatible inputProps Closes vantezzen#199
🦋 Changeset detectedLatest commit: 817afc8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@mvtandas is attempting to deploy a commit to the vantezzen Team on Vercel. A member of the Team first needs to authorize it. |
Live Demo 🚀I've deployed a live demo showcasing the Vue 3 integration: 👉 https://mvtandas.github.io/autoform-vue-demo/ It includes three examples:
The demo uses custom UI and field components built with plain Vue 3 |
|
Updated the PR with fixes:
The live demo has been updated and is working well: https://mvtandas.github.io/autoform-vue-demo/ Would love to get your feedback on this @vantezzen — happy to make any adjustments! |
|
Thank you, looks very nice. I'm not too deep into Vue specifics - if you want you can add docs for the Vue integration into the docs folder (https://github.com/vantezzen/autoform/tree/main/apps/docs/content/docs) so they are added to the doc page |
Adds complete documentation for @autoform/vue: - Getting started guide with installation and usage - UI and field component setup examples - Customization guide (custom fields, wrappers, field types) - Full API reference (AutoForm props, events, exposed, useAutoForm) - TypeScript types reference - Link to live demo Also adds Vue to the installation section on the main docs page.
|
@vantezzen Done! I've added the complete Vue documentation:
Also added Vue to the installation section on the main docs index page. Let me know if you'd like any changes! |
|
Added the missing changeset. Everything should be ready to merge now! |
Summary
Adds the Vue 3 integration for AutoForm as
@autoform/vue, following the same architecture as@autoform/react.Closes #199
What's included
Components
AutoFormAutoFormFieldObjectFieldArrayFieldComposables
useAutoForm()AutoFormparentprovideAutoForm()AutoForm)Utilities
buildZodFieldConfig()buildYupFieldConfig()getPathInObject()setPathInObject()Architecture
Follows the exact same pattern as
@autoform/react:Key differences from React version:
reactive()instead ofreact-hook-formfor form stateprovide/injectinstead of React Contexth()render functions (pure TS, no SFC/JSX needed)v-modelcompatibleinputPropsfor field bindingUsage
Build
CJS + ESM builds pass successfully via
tsup. TypeScript types are fully exported.Next steps (future PRs)
@autoform/shadcn-vue— Styled components using shadcn-vue