Skip to content

Migrate to 0.14 ​

0.14 adds the built-in time and hidden field types, sections and repeatable groups, and reads definition format 1.1. Existing definitions keep their meaning. A definition that already used time, hidden, section or group for a custom type now gets the built-in behavior.

bash
npm i @formhaus/core@^0.14 @formhaus/react@^0.14
npm i @formhaus/core@^0.14 @formhaus/vue@^0.14

Upgrade the server that runs validateSubmission() first, then the clients. Core 0.13 and older skip the fields inside a section and pass a group value through without checks.

Changes ​

AreaOld (0.13)New (0.14)Action
Definitiontime was a custom type without checks24-hour HH:mm or HH:mm:ss; other values fail with "Enter a valid time"Store 24-hour times, or rename your custom type
Definitionhidden was a custom type without checksChecked as text; its errors are form-level errorsStore text values, or rename your custom type
Definitionsection and group were custom typesBuilt-in containers with nested fieldsRename your custom type
TypesFormStep.fields and FormDefinition.fields were FormField[]FormNode[], a union of FormField, FormSection and FormGroupNarrow with isSection() and isGroup() before reading field properties
ErrorsEvery error key was a field keyItem errors use paths such as participants.1.emailMap error keys through the path form when you match them to fields
Headless renderersvisibleFields listed everything to drawvisibleNodes holds the tree; visibleFields stays flatRender sections and groups from visibleNodes
ValidationOptions with a repeated value passed checkDefinition() and FormEnginecheckDefinition() and FormEngine reject them with duplicate-option-valueGive every option of a field a unique value
CloudFormhausForm and @formhaus/core/cloud used api.formhaus.devDefault is api.formhaus.cc; api.formhaus.dev keeps workingAdd https://api.formhaus.cc to your CSP connect-src if you use an allowlist
FormatFORMAT_VERSION was "1.0""1.1"Set "formatVersion": "1.1" on definitions with sections or groups
ts
import { isGroup, isSection } from '@formhaus/core';

for (const node of step.fields) {
  if (isSection(node)) renderSection(node);
  else if (isGroup(node)) renderGroup(node);
  else renderField(node);
}

Formhaus is MIT licensed. Legal