Migration from 5.x to 6.x
This is the list of incompatibilities you may encounter when migrating your application to KVision 6.0.0.
General changes
Java 17 is now required to develop all KVision applications and to run KVision fullstack applications. You may need to select JDK 17 in the
File -> Project structuremenu in the IntelliJ IDEA.The legacy backend is no longer supported - be sure you are using IR.
The fluent pattern has been removed from many components and containers which means some methods no longer return the component instance. Most notably the
onClickmethod now returns handler id (like all other event methods). It could be a problem if you directly useadd()methods instead of DSL.
// Works in KVision 5, doesn't work in KVision 6
add(Button("OK").onClick {
// do something
})
// Works is KVision 5 and KVision 6
button("OK").onClick {
// do something
}Modules and components
SpinnerandRangecomponents have been moved to the newio.kvision.form.numberpackage.Select,SpinnerandUploadare now different components. The oldUploadcomponent based on bootstrap-fileinput library is still available asBootstrapUpload. The oldSelectandSpinnercomponents are no longer available. If you need advanced features use newTomSelect,Spinner,NumericandIMaskNumericcomponents.The
Spinnercomponent is now only for integer values. UseNumericorImaskNumericcomponents for decimal/float values.Typeaheadcomponent is no longer available. UseTomTypeaheadfromkvision-tom-selectmodule instead.The
kvision-bootstrap-cssandkvision-bootstrap-dialogmodules have been removed and are no longer necessary.BootstrapCssModuleinitializer works like before but is contained in the mainkvision-bootstrapmodule.When using
Tabulatorcomponent you need to use one of available css initializers. UseTabulatorCssBootstrapModuleinitializer for Bootstrap 5 theme.The
serializerparameter is now required when initializingTabulatorwith Kotlin data model. In most cases it should be enough to useserializer = serializer(). Of course your data model must be@Serializablenow.The Navigo 7 router from
kvision-routing-navigomodule uses#as the default hash sign. UseRouting.init(hash = "#!")if you want to restore the previous behaviour.The
routingglobal variable has been removed. The internal router instance is returned by theRouting.init()method.The
kvision-toastmodule is no longer available. Usekvision-toastifyinstead withToastifyModuleinitializer. The newToastcomponent has a bit different API (e.g. usedanger()method instead oferror())
Other changes
The
getElement()method returnsHTMLElementtype instead ofNode. In some rare cases your code may not compile until the type is changed.The Cordova KVision API uses now
kotlin.Result<T>instead of a self-implementedResultclass. You need to adjust your code if you develop Cordova applications with KVision.The
panelsCompatibilityModeoption (compatibility with KVision 4) has been removed.Lots of old, deprecated API has been removed. Be sure you to fix all your deprecation warnings before upgrading to KVision 6.