Skip to content

Errors and validation fixes, docs

Latest

Choose a tag to compare

@darianstlex darianstlex released this 26 May 00:58
· 4 commits to main since this release
099da6f

Release Notes

πŸŽ‰ Major Highlights

πŸ“š Complete Documentation Site

  • New Docusaurus documentation site with comprehensive API reference
  • Examples section with basic, validation, and advanced patterns
  • AI integration guide for form generation
  • Deployed to GitHub Pages

πŸš€ New Features

Type Safety Improvements

  • 9 new type aliases replacing Record<string, any>:
    • IRValues, IRErrors, IRError, IRBoolean, IRTrue
    • IValuePayload, IBooleanPayload, IErrorsPayload
    • TFieldValidator
  • Better TypeScript intellisense and error messages
  • No breaking changes - fully backward compatible

Error Handling Documentation

  • setErrors vs replaceErrors clearly documented
  • setErrors: merges errors (preserves existing)
  • replaceErrors: replaces all errors (for server validation)
  • Submit validation uses replaceErrors for clean state

Form-Level Error Pattern documented

  • __form__ or similar key for form-level errors
  • Access via error.__form__ from useFormData()
  • Coexists with field-level errors
  • No new API - uses existing error store

πŸ”§ Improvements

Hook API Corrections

  • resetField and resetUntouched properly exported from useForm
  • Documentation matches actual implementation
  • Config methods documented as EventCallable (not synchronous functions)

πŸ› Bug Fixes

Validation Behavior

  • Changes submit validation logic, replaces all errors including client
  • skipClientValidation checks use consistent data access pattern
  • FormComponent uses useLayoutEffect for config synchronization