Appearance
Upgrading from v2 to v3
BaseForm
Omission of fields with undefined values (Breaking Change)
Commit 26c0d0e changed how BaseForm.buildPayload() handles undefined values returned by transformers (getters).
In v2, returning undefined from a getter would still include the key in the resulting payload object. In v3, the field is omitted entirely from the payload.
This applies to:
- Field Getters:
getFieldName(value) - Composite Getters:
getParentFieldNestedField(value) - Appended Fields: Getters for fields defined in the
appendarray. - Nested Objects/Arrays: Recursive transformation of nested data structures.
How to upgrade: If you previously relied on a field being present with an undefined value in the JS object, you should now return null if you want the field to be included in the request payload.
ts
// v2: payload was { name: undefined }
// v3: payload is {}
protected getName(value: string) {
return value ? value : undefined
}
// v3: if you want the field to be included
protected getName(value: string) {
return value ? value : null // payload is { name: null }
}Removal of Suggestions (Breaking Change)
The suggestions feature has been removed from BaseForm in commit f21d6ce.
Changes:
- Removed
fillSuggestions()method fromBaseForm. - Removed
suggestionsproperty from thepropertiestree (e.g.,form.properties.email.suggestionsis no longer available). - Removed
suggestionsfromPropertyAwareFieldandPropertyAwaretypes.
How to upgrade: If you were using the suggestions feature, you should now manage suggestions independently of the form state, for example, by using a separate reactive object or a dedicated composable.
File Upload Support and Form Data Handling
Commit d765cae introduced native support for File and Blob objects in BaseForm.
Changes:
BaseFormnow detects if the payload containsFileorBlobobjects.- When sending a request with a
FileorBlobin the payload, the library will automatically useFormDataand set the appropriateContent-Typeheader (multipart/form-data). Filevalues are kept intact during the transformation process and are not converted into plain objects.