Changelog¶
0.31.6 (Nov 6, 2025)¶
Scaffolder¶
- Don’t overwrite previously scaffolded ZIP files when scaffolding again.
0.31.5 (Oct 30, 2025)¶
Core¶
- Update Kotlin version to
2.2.21.
React¶
- The
subscribefunction of controllers now allows listeners to return cleanup functions. - Reworked
beforeunloadlogic (browser confirmation when leaving a page with a “dirty” form) as per MDN recommendations: to minimise the effect on performance, thebeforeunloadlistener should only exist while the form is “dirty”. The previous behaviour might cause issues in Safari (according to a reported bug in a different project).
0.31.4 (Oct 23, 2025)¶
Scaffolder¶
change-casehas become a peer dependency, since it’s expected that it will be used directly by consumers.- Improve generation of TypeScript import declarations by preferring
import type { … }syntax toimport { type … }when all named imports of a module are type imports since the prior doesn’t result in runtime imports being generated.
0.31.3 (Oct 21, 2025)¶
JS Bindings¶
- Correctly publish the package’s license.
React¶
- Correctly publish the package’s license.
Scaffolder¶
- Fix binary name.
- Correctly publish the package’s license.
0.31.2 (Oct 16, 2025)¶
Scaffolder¶
- Ensure package is actually side-effect free by not importing CSS styles by default.
0.31.1 (Oct 16, 2025)¶
JS Bindings¶
- Mark package as side-effect free.
React¶
- Export package as ESM only, since the core package was already ESM only anyway, making the CJS version unusable.
- Mark package as side-effect free.
Scaffolder¶
- Export package as ESM only, for simplicity sake.
- Mark package as side-effect free.
0.31.0 (Oct 9, 2025)¶
All¶
All packages are now under the “ostack” umbrella and, as such, have been renamed as follows:
Maven Central packages:¶
io.kform:kform-core->tech.ostack:kform(all imports of the formio.kform.*are nowtech.ostack.kform.*)io.kform:kform-js-bindings->tech.ostack:kform-js-bindings
npm.js packages:¶
@kform/core->@ostack.tech/kform@kform/react->@ostack.tech/kform-react@kform/scaffolder->@ostack.tech/kform-scaffolder
Core¶
- Update
kt-mathversion to0.10.2.
0.30.0 (Sep 17, 2025)¶
Core¶
- Update Kotlin version to
2.2.20. - Update
kotlinx.datetimeversion to0.7.1. - Update
kotlin-loggingversion to7.0.13.
JS Bindings¶
- Longs are now exported as
bigints to JavaScript, due to the Kotlin version update.
React¶
- Support React 19 (currently both 18 and 19 are supported, i.e. no features exclusive to 19 are being used).
- Add an optional peer dependency to
@types/react. - Dependency updates.
Scaffolder¶
- Use React 19.
- Add an optional peer dependency to
@types/react.
0.29.1 (Jul 16, 2025)¶
React¶
- Fix
AtPathErrorerror message (path was missing a closing').
Scaffolder¶
- Add support for configurations:
- Add configs for specifying where to use the
File.Base64Serializerand/orTable.ValuesSerializer.
- Add configs for specifying where to use the
- Style tweaks/improvements.
0.29.0 (Jul 10, 2025)¶
Core¶
- Rename
ExceptionAtPathexception toAtPathExceptionsince exceptions should end inExceptionas per Java naming conventions; further allow the exception to receive an optionalcause. - Rename
ValidationExceptionError/LocatedValidationExceptionErrorissue classes toValidationFailure/LocatedValidationFailurerespectively.- Change data of these issues to contain the
validationname of the validation that failed,exceptionname/message andstackTraceof the exception that caused the validation to fail. validation/exception/stackTracecan now be accessed directly as properties of the issues.- The code of such issues is now always a stable
"validationFailed"rather than the name of the exception. toStringhas been improved to show the name of the validation and the whole exception message.
- Change data of these issues to contain the
- When validating a form via form utilities or via a
FormValidatorwithvalidate/validateExternally/isValid, we no longer wrap validation failures inValidationExceptionError/LocatedValidationExceptionErrorissues. Instead, exceptions thrown while running validations are “wrapped” in aValidationFailureExceptionand rethrown, causing these functions/methods to possibly fail where they didn’t before.- The original thrown exception can be accessed as the
causeof the thrownValidationFailureException. - The
FormManagerbehaviour hasn’t changed, and validation failures still result in special error issues (nowValidationFailureinstances) wrapping the thrown exception. - These changes were made because validating via form utilities or
FormValidatoris typically done server-side, were it makes more sense for a validation failure to result in a500error being sent to the client than a400indicating that something is wrong with user data.
- The original thrown exception can be accessed as the
JS Bindings¶
- Change bindings appropriately, in respect to the above-mentioned changes.
React¶
- Rename
PathErrortoAtPathError, the JS counterpart toAtPathException. - Introduce
InvalidPathError(as a counterpart toInvalidPathException) and throw it from hooks which were previously throwingPathErrors.
0.28.2 (Jul 8, 2025)¶
Scaffolder¶
- Remove unnecessary
encodeToString/decodeFromStringimports in scaffolded serializer. - Fix incorrect type signature for
propertyAnnotations.
0.28.1 (Jul 2, 2025)¶
Scaffolder¶
- Scaffold
Fileproperties with the serializer set toFile.Base64Serializer.
0.28.0 (Jul 2, 2025)¶
Core¶
- Due to updating the Kotlin and
kotlinx.datetimeversions,Instanthas been removed fromkotlinx.datetimeand is now part of the standard Kotlin library. TheInstantSchemawas updated to reflect this. For users: imports tokotlinx.datetime.Instantnow become imports tokotlin.time.Instantand currently require opting in. - Fix typo in
emptyPlaceholderFilefunction name (wasemplyPlaceholderFile).
Scaffolder¶
- Tweak the generated serialization code to support pretty printing and rename variable names to be format agnostic.
- Add support for annotating scaffolded class properties.
- Annotate scaffolded
Instantproperties withOptIn(ExperimentalTime::class).
- Annotate scaffolded
Dependencies¶
- Update Kotlin version to
2.2.0. - Update
kotlinx.datetimeversion to0.7.0. - Update
kotlinx.serializationversion to1.9.0. - Update other dependencies to latest versions.
0.27.5 (May 8, 2025)¶
React¶
- Fix issue where the state of a controller was not immediately synchronised with the input passed
to the
useControllerhook.
0.27.4 (Apr 30, 2025)¶
Dependencies¶
- Update Kotlin version to
2.1.20. - Update other dependencies to latest versions.
0.27.3 (Apr 16, 2025)¶
React¶
-
Support string schemas in the
useNumericInputhook and numeric utilities.This is useful in order to treat “numeric strings” the same way we treat other numeric values.
0.27.2 (Mar 25, 2025)¶
Scaffolder¶
- Force use of latest
http-serverversion when launching the scaffolder.
0.27.1 (Mar 25, 2025)¶
Scaffolder¶
npx @kform/scaffolder@latestnow, by default, opens a browser window with the scaffolder.
0.27.0 (Mar 25, 2025)¶
Scaffolder¶
- This release introduces
@kform/scaffolder, a library which can be used to scaffold new KForm forms.- Use it as a library to build a (more complete) scaffolder;
- Or try it as-is by running:
npx @kform/scaffolder@latest.
0.26.2 (Jan 23, 2025)¶
Core¶
- Fix computed value not being recomputed when directly setting its value via the form manager. This behaviour may become adjustable in the future.
0.26.1 (Jan 16, 2025)¶
Core¶
- Fix publication issue with the
kotlin-reflectdependency.
0.26.0 (Jan 8, 2025)¶
Core¶
-
Introduce computed schemas and values:
-
A computed schema is a schema representing a computed value of a certain type: a form value that should equal the result of evaluating a given computation over other values of the form.
A common example of a computed value would be a field whose value should equal the sum of other form values.
Example usage:
data class ItemPurchase( val price: Double?, val amount: Int?, val tax: Float?, val total: Double ) object Total : ComputedValue<Double> { private val ComputedValueContext.price: Double? by dependency("../price") private val ComputedValueContext.amount: Int? by dependency("../amount") private val ComputedValueContext.tax: Float? by dependency("../tax") override suspend fun ComputedValueContext.compute(): Double { val totalPrice = (price ?: 0.0) * (amount ?: 0) return totalPrice + totalPrice * (tax ?: 0f) } } val itemPurchaseSchema = ClassSchema { ItemPurchase::price { NullableSchema { DoubleSchema() } } ItemPurchase::amount { NullableSchema { IntSchema() } } ItemPurchase::tax { NullableSchema { FloatSchema() } } ItemPurchase::total { ComputedSchema(Total) { DoubleSchema() } } }Computed schemas automatically include a validation which checks that the form value equals the result of evaluating its computed value.
-
-
Introduce a
SumOfcomputed value for the common case of computing the sum of all values within a table column: -
Support specifying the initial value of the form manager via an optional constructor argument.
0.25.5 (Dec 16, 2024)¶
JS Bindings¶
- Tweak more exported types with bogus
__doNotUseOrImplementItproperties so that they are compatible with type definitions generated by the Kotlin compiler.
0.25.4 (Dec 3, 2024)¶
JS Bindings¶
- Tweak
BigInteger/BigDecimalTypeScript definitions to make them compatible with those generated by the Kotlin compiler. - Remove unneeded big decimal utility function.
0.25.3 (Dec 2, 2024)¶
Core¶
- Add missing comparable restrictions to big integer/decimal schemas.
- Tweak schema conversions from other numeric types to big integer/decimal to prevent precision loss.
JS Bindings¶
- Fix comparable-bounds validation wrappers to support big integers/decimals.
React¶
- Tweak big decimal parsing to prevent precision loss.
0.25.2 (Dec 2, 2024)¶
React¶
- Dependencies (
from-exponential/zustand) are no longer incorrectly bundled. - Fix issues with our usage of
zustandselectors since the update to v5.
0.25.0 (Nov 28, 2024)¶
Core¶
-
Provide support for big integers and big decimals via the
kt-mathlibrary:- Introduce two new schemas:
BigIntegerSchemaandBigDecimalSchema. -
Use the newly added
Scalevalidation to ensure thatBigDecimals have a specific scale. Example usage: -
Provide
BigIntegerSerializerandBigDecimalSerializerserializers to serializeBigIntegers andBigDecimals respectively. - Provide
io.kform.datatypes.BigIntegerandio.kform.datatypes.BigDecimaltypealiases toorg.gciatto.kt.math.BigIntegerandorg.gciatto.kt.math.BigDecimalrespectively, with the above serializers already applied.
- Introduce two new schemas:
JS Bindings¶
- Expose
bigIntegerSchemaandbigDecimalSchemafunctions to create the aforementioned schemas from JavaScript, as well as thescalevalidation function. - Expose some (mostly internal) utility functions to deal with big integers/decimals.
React¶
- Add big integer/big decimal support to the
useNumericInputhook.
Dependencies¶
- Update Kotlin version to
2.1.0. - Update Zustand version to 5.
0.24.7 (Nov 1, 2024)¶
React¶
- Make sure that the result of the issues tracker is immutable.
0.24.6 (Oct 31, 2024)¶
React¶
- Improve issues tracker performance.
0.24.5 (Oct 29, 2024)¶
Core¶
- Retry fix for issue with subscriptions occurring during initialisation/destruction of a form manager.
0.24.4 (Oct 29, 2024)¶
Core¶
- Fix issue with subscriptions occurring during initialisation/destruction of a form manager.
0.24.3 (Oct 24, 2024)¶
Core¶
- The
UniqueItemsByandUniqueItemsvalidations now also report the ids of repeated rows when running on tables: this is done via data propertiesfirstRowIdandsecondRowId. - Introduce
Schema<*>.comparePathsfunction to compare two paths by the order in which fields were defined in the schema.
JS Bindings¶
- Expose
Schema<*>.comparePathsascompareSchemaPaths.
React¶
- Issues tracked by
useIssuesTrackerare now, by default, sorted viacompareSchemaPaths.- A new option
issuesOrderCompareFnwas introduced to make it possible to change/tweak the default ordering.
- A new option
0.24.2 (Oct 16, 2024)¶
JS Bindings¶
- Adjust type of
PromiseCancellationExceptionto include the constructor.
0.24.1 (Oct 16, 2024)¶
React¶
- Rework form submission:
- Rename previous
onFailedSubmittoonInvalidSubmitas the function responsible for handling the case where a form submission fails due to it being invalid. onFailedSubmitstill exists, but now handles the case where the submission failed due to other errors (e.g., connectivity problems).- Automatically set the form as pristine after a successful submission, unless
setPristineOnSuccessfulSubmitis set tofalse. - Add
onSuccessfulSubmit, which runs after the form has been successfully submitted and set as pristine (this ensures that the “form unload” confirmation message isn’t triggered in the case where a redirection is intended after submission).
- Rename previous
- Fix the
Formcomponent which had some issues introduced in the previously released version.
0.23.2 (Oct 15, 2024)¶
React¶
- Support returning external issues within
onSubmit, which are automatically added to the form manager viaaddExternalIssues. - Fix issues in the type signature of the
onSubmit/onFailedSubmitfunctions.
0.23.1 (Oct 2, 2024)¶
Core¶
- Fix bug causing certain validations to not be invalidated on value changes.
Dependencies¶
- Update to latest dependencies.
0.23.0 (Sep 12, 2024)¶
Core¶
-
Schema events are now only emitted after changes to the underlying data have actually been performed.
Previously, events such as
ValueEvent.Changewere being emitted just before properties were reassigned, which proved troublesome in a few scenarios. - This introduces some breaking changes toSchemamethods which were hopefully not being implemented externally anywhere. -
Rename test utility classes for use from Java:
ValidationIssueAssertsandLocatedValidationIssueAssertsboth becomeTestUtils:ValidationIssueAsserts.assertMatchingIssuesbecomesTestUtils.assertMatchingIssues;LocatedValidationIssueAsserts.assertMatchingIssuesbecomesTestUtils.assertMatchingLocatedIssues;- Other methods received similar renames.
-
Introduce assertion utilities to check that a collection of issues does not contain a given issue, e.g.
assertNotContainsIssue.- Projects using
assertFailstogether withassertContainsIssue(s)should migrate to usingassertNotContainsIssue(s), since the former may accidentally swallow other errors.
- Projects using
-
Split the form utility function
validateintovalidateandvalidateExternally(similarlyisValidandisValidExternally).validatenow only runs internal schema validations, whilevalidateExternallycan be used to run external validations.
-
The
FormValidator’svalidateandisValidmethods now receive an optionalrunCriteriaargument to specify when to run internal and/or external validations.- The default criteria is still the same as before: external validations run after internal ones iff no errors were found when running the internal validations.
- Other criteria are especially useful for testing purposes.
-
Async wrappers for using KForm from Java were simplified to use
GlobalScopeby default.AsyncFormValidatornow optionally receives a coroutine scope rather than a coroutine context as constructor argument.
JS Bindings¶
- Bindings were updated according to core changes:
validateandisValidwere updated;validateExternallyandisValidExternallywere introduced.
React¶
-
Improve performance by using Zustand internally to manage state.
When using controllers, rerenders now only happen when users explicitly subscribe to controller state changes via newly provided hooks. Furthermore, these rerenders only occur for the components which actually subscribe to said changes.
This is an improvement over the previous behaviour where, for example, when using the
useFormhook, any change performed on the form would most likely cause a rerender of the whole form, due to state changes within theFormController(the form’s “validating” state would likely change).Unfortunately, to support these performance improvements, the hooks API had to break substantially.
These changes are hopefully mostly relevant to component libraries and should not break most existing user code. However, code like the following will stop working:
and should be replaced by something similar to:
-
Remove
observeDescendantsproperty from hooks and provided components. Instead, you should now add/**to the provided path (this aligns the API with what we use in validations):As an example, if you previously had something like:
const controller = useController("/path/to/field", { observeDescendants: true, ...otherOptions, }); const formattedValue = ( <FormattedValue path="/path/to/field" observeDescendants {...otherOptions} /> );it should now become:
Dependencies¶
- Update Kotlin to version
2.0.20. - Update
kotlinx-datetimeto version0.6.1. - Update
kotlinx-serializationto version0.7.2.
0.22.0 (Aug 7, 2024)¶
JS Bindings¶
- Minor type updates to make them more in line with those automatically generated by the Kotlin
compiler.
- Renamed
List/MaptoKtList/KtMap.
- Renamed
Dependencies¶
- Update Kotlin to 2.0.10, as well as other dependencies to their latest versions.
0.21.11 (Aug 1, 2024)¶
Core¶
- Performance improvement: update information on the number of descendants displaying issues in a single action.
0.21.10 (Jul 31, 2024)¶
Core¶
- Add secondary constructor to
Fileto allow creation from Java without specifying a name. - Performance improvement: when writing values, invalidate all dependencies, update all stateful validations, and remove all external issues in a single action, instead of scheduling an action for each invalidation/update/removal.
0.21.9 (Jul 4, 2024)¶
Core¶
- Add
set,reset, andremoveutility functions, as well as their asynchronous counterparts for the JVM target. - Fix infinite loop in
hasAsyncandgetAsyncimplementations.
JS Bindings¶
- Provide bindings for the
set,reset, andremoveutility functions.
0.21.8 (Jul 4, 2024)¶
JS Bindings¶
- Provide utility function to get the next row id of a table.
0.21.6 (Jul 2, 2024)¶
Core¶
- Fix error removing external issue of already removed value.
0.21.4 (Jun 26, 2024)¶
Core¶
- Fix missing API dependency on JS target.
0.21.2 (Jun 18, 2024)¶
Core¶
- Add
addDependencyandaddExternalContextDependencymethods to theValidationclass, which may be called during class initialization instead of relying on property delegation.- These methods have the same API and replace those previously defined in
JvmValidationandScopedJvmValidation.
- These methods have the same API and replace those previously defined in
- Add
addObservermethod to theStatefulValidationclass, serving the same purpose as above. - Minor
ValidationContexttype improvements:dependencySchema/dependencySchemaOrNullfunctions now receive a type argument.
0.21.1 (Jun 13, 2024)¶
Core¶
-
Add utility functions
convertTableRowIndicesToIdswhich convert paths where table rows are indexed by their index into path where said rows are indexed by their id in the corresponding table within a provided form value of a provided form schema.These functions are especially useful when tables are being encoded and decoded as lists (e.g. via
Table.ValuesSerializerand there is a need to convert paths between one representation and the other: this is the often case when needing to add external validation issues obtained from a server. -
Add utility functions
convertTableRowIdsToIndices, which does the opposite of what was described above.This is useful when transforming paths into human-readable names where it makes more sense to reference a table row by its index than by its internal id.
JS Bindings¶
- Provide bindings for the functions described above with names:
convertPathTableRowIndicesToIds,convertPathTableRowIdsToIndices,convertIssueTableRowIndicesToIds, andconvertIssuesTableRowIndicesToIds. - Minor type improvements (define default
unknowntypes for most type arguments).
Dependencies¶
- Reupdate dependencies as the previous downgrades didn’t make a difference regarding the problem they were trying to work around.
0.21.0 (Jun 11, 2024)¶
Core¶
- Add static
invokemethods to createLocatedValidationIssues given their severity. - Better JVM API: rename static
invokemethods tocreateon the JVM. - Set
kotlinx-datetimeas a compile-only dependency since it is an optional feature that is only needed for projects using temporal values/schemas.- This means that projects using temporal schemas (
InstantSchema,LocalDateSchema,LocalDateTimeSchema) may now have to directly depend onkotlinx-datetimeif they weren’t already.
- This means that projects using temporal schemas (
Dependencies¶
- Tweak dependency versions in order to hopefully prevent conflicts when KForm is used alongside other libraries.
0.20.5 (May 30, 2024)¶
Core¶
- Fix errors occurring when attempting to access the state of destroyed values.
0.20.4 (May 30, 2024)¶
Core¶
- When children are destroyed, properly set their state within their parent as
nullwhen the parent value isn’t a collection. - Remove extraneous
$character from the result ofValidationChange.toString().
0.20.3 (May 9, 2024)¶
Dependencies¶
- Update to latest versions.
0.20.2 (May 9, 2024)¶
JS Bindings¶
- Fix JavaScript bindings and types for
UniqueItemsByvalidations (which were not supportingTablevalues).
React¶
- Minor
useInputhook improvement: prevent value from being set in the storage when it hasn’t changed.
0.20.1 (April 10, 2024)¶
Core¶
- Fix infinite recursion in the
NotEmptyvalidation due to a faultyisEmptyimplementation.
0.20.0 (April 4, 2024)¶
Core¶
-
Revamp default offered validations (such as
Required,MinLength, etc.) to fix inconsistencies, improve usability, and increase compatibility with how they affect form inputs via schema restrictions. Some of these changes can be, unfortunately, breaking, and require some code to be changed:-
Requiredno longer simply checks whether a value isnull. It now also checks whether the value isfalseor empty (for strings, arrays, collections, etc.). This makes it more consistent with web inputs and also matches typical expectations: theRequiredvalidation can now be thought of as representing the (∗) icon typically found in UI forms to denote required fields.Requiredhas become the semantically correct way of representing that a value must be filled by the user in the form. As such, previous use ofNotEmpty,MinLength(1),MinSize(1), andMustEqual(true)should likely be replaced withRequired. See the notes on the documentation ofRequiredto better understand when to use each validation.New functions named
isMissing/isNotMissingwere added, which implement the logic used byRequiredto check if a value is missing. These functions can be freely used in custom validations (or elsewhere) to match the notion of “required” used byRequired. -
Length/MinLengthandSize/MinSizeno longer forbid empty values. This means that an empty string is a valid value according toMinLength(5), and that an empty list is a valid value according toMinSize(5).Although this might seem odd at first, it makes it more consistent with how web input validations work and, more importantly, makes it easier to specify validations of the following kind, which previously required custom validations: - Text field X is not required but, if filled, must have exactly (or at least) 4 characters. - Checkbox group Y is not required but, if filled, at least 3 options must be ticked.
This change means that code that is currently using
MinLength(1)orMinSize(1)to make a field required will no longer work, and eitherRequired(preferred) orNotEmptyshould be used instead (see documentation ofRequired/NotEmptyto decide which one to use). -
GreaterThan/LessThanwere renamed toExclusiveMin/ExclusiveMax.This makes the names more consistent with the
Min/Maxvalidations and other validation libraries. -
Unique/UniqueBywere renamed toUniqueItems/UniqueItemsByto better describe what the validations do, since “unique” by itself is more often used on each column of a table than on the table itself. This also makes the naming more consistent with other validation libraries. -
AllowedMimeTypesandAllowedFileExtensionswere merged into a single validation namedAccepts. Besides making the validation more consistent with web inputs, it makes it possible to specify both file extensions and mime types, which wasn’t possible before, since only one of the two validations should be used at once.Similarly to the
acceptattribute of web inputs, accepted file names should now start with a full stop (.). Example usage: -
A new
NotBlankvalidation was created to check that a non-empty string is not blank. - Default issue codes emitted by the default validations were renamed to better explain what
went wrong, rather than the name of validation that triggered them. The new codes were
inspired by the error names of web validations:
Required: default issue code renamed from"required"to"valueMissing".NotEmpty: default issue code renamed from"notEmpty"to"valueMissing".MustEqual/MustNotEqual/OneOf/NotOneOf: default issues codes renamed from"disallowedValue"to"valueDisallowed".Min/Max: default issue codes renamed from"min"/"max"to"rangeUnderflow"/"rangeOverflow".ExclusiveMin/ExclusiveMax: default issues codes (withGreaterThan/LessThan) renamed from"greaterThan"/"lessThan"to"rangeUnderflow"/"rangeOverflow".Length/MinLength/MaxLength: default issue codes renamed from"length"/"minLength"/"maxLength"to"lengthMismatch"/"tooShort"/"tooLong".Size/MinSize/MaxSize: default issue codes renamed from"size"/"minSize"/"maxSize"to"sizeMismatch"/"tooSmall"/"tooLarge".Matches/MatchesEmail: default issue codes renamed from"match"/"invalidEmail"to"patternMismatch"/"emailPatternMismatch".Accepts: default issue codes (withAllowedMimeTypes/AllowedFileExtensions) renamed from"disallowedMimeType"/"disallowedFileExtension"to"fileTypeMismatch".UniqueItems/UniqueItemsBy: default issues codes (withUnique/UniqueBy) renamed from"repeatedElements"to"itemsRepeated".
-
JS Bindings¶
- Expose the core’s
PathMultimapimplementation.
0.19.2 (March 11, 2024)¶
JS Bindings¶
- Add missing schema restrictions to JavaScript-only schemas.
0.19.1 (March 11, 2024)¶
Core¶
- Fix
CharSchemanot being able to initialise values fromChars.
0.19.0 (March 7, 2024)¶
Core¶
- Rename
Table.SerializertoTable.RowsSerializerand add a new serializer namedTable.ValuesSerializerwhich only serialises a table’s values. WhilstTable.RowsSerializerserialises a table as a map of row ids to row values,Table.ValuesSerializerserialises it as a list of row values. - Be more lenient on the kind of values accepted by a schema when a value is being initialised. This
affects the type of values that can be provided when setting a value via
FormManager.set. This is especially useful when callingFormManager.setvia JavaScript, as we can now, for example, provide a regular JavaScript number when setting aLongvalue, as it will be coerced toLongby theLongSchema. -
Expose simple restrictions such as
required,min, ormaxwithin the type information (TypeInfo) of a schema. These are automatically computed based on the validations provided to a schema and can be used by client applications to, for example, provide properties to input fields.This makes it easier to automatically mark fields as required when a
Requiredvalidation was provided, among other behaviours.
JS Bindings¶
- Provide access to the schema type information restrictions.
React¶
- Remove
schemaMin/schemaMaxfrom the controller returned byuseNumericInputsince the exposed schema restrictions can now be accessed and cover the same use-case. - Remove unused type parameter from certain types of input controllers.
- Rename the
schemaMinMaxfunction tonumericTypeMinMaxand the properties of the returned object fromschemaMin/schemaMaxto simplymin/max.
0.18.1 (February 15, 2024)¶
React¶
- Add
getClonefunction to the controller.
0.18.0 (January 30, 2024)¶
JS Bindings¶
- Fix
ValidateOptionstype by setting each property as optional. - Expose utility functions to transform Kotlin maps into JS objects and vice versa.
React¶
- Rename hooks and related components to make them simpler to use and more consistent:
useFormValue->useControlleruseFormValueOutput->useFormatteruseFormValueInput->useInputuseNumericFormValueInput->useNumericInputuseTemporalFormValueInput->useTemporalInputuseListableFormValueInput->useListableInputuseFileFormValueInput->useFileInputOutput->FormattedValue- The names of the types related to each hook have also been changed.
-
Introduce
useFormattedValue: a new hook the wrapsuseFormatter(olduseFormValueOutput) and returns a pair with the formatted value and its controller, for the common use case of storing a form’s value within React’s state. -
Fix type issue with hooks such as
useController(olduseFormValue) where types within the hook’s options weren’t being automatically inferred unlessobserveDescendantswas provided.
0.17.2 (January 3, 2024)¶
Core¶
- Fix bug occurring when checking the validity of validation dependency paths ending in a recursive wildcard.
0.17.1 (January 3, 2024)¶
Core¶
- Fix issue with the type checking of table dependencies within validations.
Dependencies¶
- Update dependencies to latest versions.
0.17.0 (January 2, 2024)¶
Core¶
- Types of validation dependencies are now validated at runtime, during construction of a
FormManagerorFormValidator, or manually via thevalidateSchemaValidations/validateExternalValidationsfunctions. - Introduce standalone form utility functions:
validatePath,validateSchemaValidations,validateExternalValidations,isValidPath,schemaInfo,schema,valueInfo,has,get,getClone,validate, andisValid.- These utility functions are available from Java via the
FormUtilsclass.
- These utility functions are available from Java via the
- Introduce future-returning variants of the async utility functions, available from Java via
AsyncFormUtils. - Remove the
TSchematype argument fromFormValidator, as it is mostly useless to make the API nicer to use. - Remove non-validation related methods from the
FormValidator, e.g.schemaorget. Utility functions should be used instead in scenarios where they’re needed. - Introduce an
AsyncFormValidatorwith future-returning validation methods for usage from Java.- The previous future-returning extension methods on
FormValidatorwere removed.
- The previous future-returning extension methods on
Tableno longer extendsCollectionto prevent method clashes in Java.- The
TableAPI was further simplified and made more coherent.
- The
JS Bindings¶
- Expose functions wrapping all standalone form utility functions.
Migration¶
- If using Kotlin, remove the second type argument of
FormValidator. -
If using Java, migrate usage of
FormValidatortoAsyncFormValidator: -
When using tables, if you were previously relying on
Tablebeing aCollection(e.g., by iterating directly on it, or using Kotlin stdlibCollectionextension functions such asmaporsumOf), access thevaluesproperty of the table instead.- E.g., instead of
table.map { it * 2 }, usetable.values.map { it * 2 }. - The
idsorrowsproperties can also be used instead ofvaluesas appropriate.
- E.g., instead of
0.16.4 (November 13, 2023)¶
Core¶
- Fix
AbstractSimpleSchemaby allowing the schema to possibly represent nullable values.
0.16.3 (November 13, 2023)¶
Core¶
- Make the
AnySchemageneric, making it more ergonomic to use.
0.16.2 (November 6, 2023)¶
Core¶
- Introduce
MustNotEqualvalidation, as a counterpart toMustEqual. - Remove
equalsFnargument inMustEqualsfunction. - Make it possible to construct certain validations via
varargs, for a more ergonomic usage: these includeAllowedMimeTypes,AllowedFileExtensions,OneOf, andNotOneOf.- E.g., instead of
OneOf(listOf(1, 2, 3)), one can simply writeOneOf(1, 2, 3).
- E.g., instead of
Dependencies¶
- Update Kotlin to version 1.9.20.
0.16.1 (October 30, 2023)¶
React¶
- Fix bug when using
useFormValueOutputtogether withobserveDescendants.
0.16.0 (October 26, 2023)¶
Core¶
- Reorganize certain KForm concepts by changing their namespaces:
- Paths, as a core concept, are moved from the
pathsnamespace to the root namespace. - KForm datatypes such as
TableandFileare moved to thedatatypesnamespace.
- Paths, as a core concept, are moved from the
- Make the whole API easier to use by also accepting paths as strings in most places where a
Pathinstance was previously required (e.g., inFormManagermethods). - Add overloads to JVM async form validator methods to avoid having to manually specify the default path.
Dependencies¶
- Updates Node.js usage to version 20.
Migration¶
- Find/replace the following globally on a project:
import io.kform.File->import io.kform.datatypes.Fileimport io.kform.collections.->import io.kform.datatypes.import io.kform.paths.->import io.kform.