Skip to content

Migrate to 0.20 ​

0.20 reads definition format 1.4, which adds the contains and notContains condition operators for multiselect answers. Core 0.19 and older reject a definition that uses them. Upgrade the server that runs validateSubmission() before the clients.

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

Changes ​

AreaOld (0.19)New (0.20)Action
FormatFORMAT_VERSION was "1.3""1.4"Set "formatVersion": "1.4" on definitions with contains or notContains
ConditionsA condition on a multiselect could only test notEmpty: eq and in never match an array{ "field": "interests", "contains": "other" } matches when the answer includes other, and notContains when it does notReplace workarounds, such as a separate checkbox, with contains
Checkscontains was an unknown-operator errorcontains on a field that does not hold a list is a contains-not-list warning, and a value that is not an option a contains-not-in-options warningNone

Native ports that run the conformance suite in packages/core/fixtures/conformance must implement both operators. The new files are scenarios/contains.json, contains-disabled.json, check-contains-not-list.json, check-contains-options.json and check-outdated-version-contains.json.