Skip to content

fix: harmonize validation modes and core type inference#124

Merged
ladparth merged 4 commits intomainfrom
fix/validation-engine-and-type-sync
Apr 12, 2026
Merged

fix: harmonize validation modes and core type inference#124
ladparth merged 4 commits intomainfrom
fix/validation-engine-and-type-sync

Conversation

@ladparth
Copy link
Copy Markdown
Contributor

Description

This PR synchronizes the BuzzForm documentation with the current codebase while resolving several critical behavioral/type gaps identified during the audit. It fixes the validation trigger waterfall logic and corrects primitive array type inference for named items.

Key Changes

Core (form-core)

  • Primitive Array Inference: Fixed a bug in InferType where named child fields in primitive: true arrays were incorrectly inferred as flat values. They now correctly resolve to object-wrapped arrays (e.g., { name: value }[]), matching the UI component's runtime behavior.

React Adapter (form-react)

  • Validation Waterfall: Implemented cumulative validation for derivedValidationMode. Triggers now follow a "waterfall" logic:
    • "submit" (default): Runs on submit.
    • "blur": Runs on blur AND submit.
    • "change": Runs on change, blur, AND submit.
  • Synchronized Defaults: Updated the internal default for derivedValidationMode to "submit" to match documentation and expected core behavior.

Docs / Web (apps/web)

  • Technical Audit & Cleanup: Verified and synchronized all .mdx files.
  • Validator Return Types: Updated all custom validator examples to return boolean (correct) instead of string or ternary results.
  • UI Constraints: Clarified that maxTagLength is a UI-level constraint enforced by the tag component rather than an auto-derived schema validator.
  • Primitive Array Docs: Updated array.mdx to accurately describe flat vs. object-wrapped inference choices.

Type of change

  • feat (New feature)
  • fix (Bug fix)
  • docs (Documentation changes)
  • refactor (Refactoring code without changing behavior)
  • test (Adding or updating tests)
  • chore (Maintenance, CI/CD, or Ops-related changes)

Related Issues

  • Closes # [Issue number not provided]

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
buzzform Ready Ready Preview, Comment Apr 12, 2026 1:56pm

@ladparth ladparth merged commit 0c2937c into main Apr 12, 2026
3 checks passed
@ladparth ladparth deleted the fix/validation-engine-and-type-sync branch April 12, 2026 13:58
@github-actions github-actions Bot mentioned this pull request Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant