Migration
Check this page when upgrading to a new version of KVision. Any backwards-incompatibilities will be described here. This is an evolving framework and things may change as refactorings and improvements take place, but we aim to keep the core as stable as possible.
Check Migration guide for KVision 9.0.0.
Check Migration guide for KVision 8.0.0.
Check Migration guide for KVision 7.0.0.
----
This is the list of incompatibilities you may encounter when migrating your application to KVision 6.4.0:
Guice was upgraded to 7.0.0 and you need to replace your
javax.injectimports with newjakarta.injectnamespace when using Guice with Javalin, Jooby, Ktor or Vert.x. See: https://github.com/google/guice/wiki/Guice700#jee-jakarta-transitionJooby was upgraded to 3.0.0.M9 (a milestone release). See: https://github.com/jooby-project/jooby/blob/3.x/docs/asciidoc/migration.adoc
----
Check Migration guide for KVision 6.0.0.
----
Check Migration guide for KVision 5.0.0.
----
This is the list of incompatibilities you may encounter when migrating your application to KVision 4.7.0:
You need to upgrade Kotlin to 1.5.10.
Due to changes in
webpack-dev-serveryou need to modifyDevServeroptions in yourbuild.gradle.ktsfile. Please replace:proxy = mapOf(...)withproxy = mutableMapOf(...)contentBase = listOf(...)withstatic = mutableListOf(...)
This is the list of incompatibilities you may encounter when migrating your application to KVision 4.5.0:
You need to upgrade Kotlin to 1.5.0 and serialization to 1.2.0 in your project
gradle.properties.Webpack used internally by Kotlin/JS plugin was upgraded to 5.x. You need to adjust any custom configuration in your
webpack.config.ddirectory. Please use these bootstrap.js, css.js and file.js files as examples. You can find more information here.kvision-onsenui-cssmodule was removed and integrated withkvision-onsenuimodule.When developing full-stack application with Spring Boot 2.4.5, you need to add this snippet to your
build.gradle.kts:
This is the list of incompatibilities you may encounter when migrating your application to KVision 4.1.0:
DSL builder functions have been annotated with
@DslMarkerannotation, which provides strict scope control over implicit receivers. It can lead to compile errors for existing code with hard to notice bugs. Sometimes it may also be necessary to specify the receivers explicitly.Routing functionality has been externalized to optional modules. If your application uses built-in KVision routing, you need to add
kvision-routing-navigomodule to your dependencies and callRouting.init()at the beginning of yourApplication.start()method.
This is the list of incompatibilities you may encounter when migrating your application to KVision 4.0.0:
Artifacts publication has been moved to Maven Central under new maven coordinates with
io.kvisiongroup identifier. You have to update all KVision dependencies in yourbuild.gradle.kts.All package names have been renamed with
io.kvisionprefix. You should replace your sources in the following order:pl.treksoft.navigowithio.kvision.navigopl.treksoft.jquerywithio.kvision.jquerypl.treksoft.kvisionwithio.kvision
Make sure you are not using any deprecated code before migrating. All methods, classes and functions deprecated before version 4.0.0 have been removed.
If you use web sockets with Ktor backend you need to manually install WebSockets feature in your
main()function.If you use Ktor backend you should move
kvisionInit()call to the end of yourmain()function.If you use
momentmodule with locale support you need to manuallyrequire()all or some of the needed locales. You should also updatemoment.jsfile in thewebpack.config.ddirectory from the current template.You should remove all Bintray repository addresses from your Gradle build files.
This is the list of incompatibilities you may encounter when migrating your application to KVision 3.13.x:
Due to changes in the Kotlin/JS gradle plugin for Kotlin 1.4.0 it is necessary to fix your
build.gradle.ktsfile andwebpack.config.d/webpack.jsfile. You can apply the following patch forbuild.gradle.ktsfile and just copy new version ofwebpack.jsfrom the current template project (standard or fullstack, respectively).
Kotlinx.serializationlibrary 1.0.0 contains a lot of incompatible changes, so you have to migrate your code if you are using this library directly.Jedwas replaced bygettext.jslibrary. You can safely deletewebpack.config.d/jed.jsfile. You need to make sure your*.pofiles contain bothLanguageandPlural formsheaders.All flexbox and grid CSS properties and enums have been moved to the
StyledComponentand the core package. Deprecated type aliases for refactored enums were added. Follow deprecation messages to remove deprecated types from your code.If you are using fullstack configuration with Spring Boot add
extra["kotlin.version"] = "1.4.0"to yourbuild.gradle.ktsfile.
This is the list of incompatibilities you may encounter when migrating your application to KVision 3.5.x:
Due to changes in the Kotlin/JS gradle plugin it is necessary to fix your
build.gradle.ktsfile andwebpack.config.d/webpack.jsfile. Carefully analyze these changes for frontend projects and these changes for fullstack projects.Kotlinx.serializationlibrary 0.20.0 contains also some incompatible changes, so you have to migrate your code if you are using this library directly.
This is the list of incompatibilities you may encounter when migrating your application to KVision 3:
The
setEventListener()method and theonEvent()extension function return now anIntinstead of aWidget. The returned value can be used withremoveEventListener(id: Int)method.The old, deprecated
setEventListener()method without type parameter has been removed. UseonEventinstead.Problematic overloaded constructors for all css styling classes in the
corepackage -Color,Border,Background,TextDecoration andTextShadowhas been removed. Each class has only one, primary constructor.There are two new factory extension functions for the
Colorclass.Color.hex()allows you to create aColorobject from a hexadecimalIntliteral.Color.name()allows you to create aColorobject with anColenum value.The dependency on the Pac4J library has been removed. The
p.t.k.remote.Profileclass has been removed as well. You can add Pac4J to your own project if you still want to use it.Jooby has been updated to version 2.x. You need to upgrade your application if you are using Jooby integration. See upgrade docs.
This is the list of incompatibilities you may encounter when migrating your application to KVision 2:
All DSL builder functions have been moved out of the companion objects to allow better auto-completion in IntelliJ IDEA. This change is incompatible with KVision 1 code. To migrate you should just remove code based on this regular expression:
[^\.]+\.Companion\.from all your frontend code imports (Kotlin compiler will help you easily find all possible errors afterwards).The default font size in Bootstrap 4 is larger. You may have to adjust your application layout manually or use a custom CSS theme.
The direct child of the
Rootcomponent is no longer 100% wide. Usewidth = 100.percif you want it to be.The modules names have changed (the API of the components, package names, class names, methods and properties are mostly the same, with the differences described in details below).
KVision 1 module name
KVision 2+ module name
kvision-select
kvision-bootstrap-select
kvision-select-remote
kvision-bootstrap-select-remote
kvision-datetime
kvision-bootstrap-datetime
kvision-spinner
kvision-bootstrap-spinner
kvision-upload
kvision-bootstrap-upload
kvision-dialog
kvision-bootstrap-dialog
Two new modules:
kvision-bootstrap-cssandkvision-fontawesomewere extracted from thekvision-bootstrapmodule.The Glyphicons support is dropped. Use Font Awesome icons instead.
The Font Awesome icon names require a style prefix (
fas,farorfab).Components like dropdown, context menu, modal, window, progressbar, navbar, toolbar, responsive grid, tab panel, tooltip and popover were moved into
kvision-bootstrapmodule.ButtonStyle.DEFAULTwas removed. TheButtonStyle.PRIMARYvalue is the new default. NewButtonStyle.SECONDARYvalue is also available.RadioStyle.DEFAULTandCheckBoxStyle.DEFAULTwere removed and are no longer necessary.The deprecated
Labelcomponent was removed. UseSpancomponent instead.TableType.CONDENSEDwas removed. Use newTableType.SMALLvalue instead.ButtonGroupStyle.JUSTIFIEDwas removed. Use a different approach.The
responsiveproperty of theTablecomponent was removed. UseresponsiveTypeproperty with a chosen enum value instead.The
dropupproperty of theDropDowncomponent was removed. Use thedirectionproperty with aDirection.DROPUPvalue instead.The
withCaretparameter of theDropDowncomponent constructor was removed. No replacement at the moment.NavbarType.STATICTOPwas removed. UseNavbarType.STICKYTOPinstead.Do not use
Tag(TAG.LI)components when creating links insideNavcomponent. UseLinkwithnav-itemandnav-linkclasses (or usenavLinkDSL builder function).When adding links to the
DropDownorContextMenuuseLinkwith adropdown-itemclass (or useddLinkandcmLinkDSL builder functions respectively).GridSize.XSwas removed from theResponsiveGridPanelcomponent.The
buttonsTypeis no longer a var property in theSpinnerand theSpinnerInputcomponents (changing its value didn't work anyway ;-)The
DateTimeandDateTimeInputcomponents are based on a new version of bootstrap-datetimepicker. Theweekstart,todayhighlightandshowmeridianproperties were removed. ThetodayBtnandclearBtnproperties were renamed toshowTodayButtonandshowClearrespectively.The
ObservableListclass was moved frompl.treksoft.kvision.utilstopl.treksoft.kvision.statepackage.The
StateBindingcomponent was moved frompl.treksoft.kvision.reduxtopl.treksoft.kvision.statepackage and is available in the main KVision module. It also can be used with any data source implementingObservableStateinterface (e.g.ReduxStoreorObservableList).The mapping of date and time classes between the client and the server code was significantly changed. The
pl.treksoft.kvision.types.Dateclass is deprecated and not supported anymore. You should useLocalDateTime,LocalDate,LocalTime,OffsetDateTimeandOffsetTimefrompl.treksoft.kvision.typespackage instead. All of these classes are mapped tokotlin.js.Dateon the client side, but to the correspondingjava.time.*class on the server side. This way you can easily use new Java types in your server side applications.The
pl.treksoft.kvision.hmrpackage was removed and is not needed anymore. All KVision applications should now extendpl.treksoft.kvision.Applicationclass and are executed with newstartApplication()function.ReduxStore.subscribe()method calls the callback function once immediately right after the registration.Service functions for
SelectRemote/TabulatorRemotewere changed to suspending. The function forSelectRemotecomponent takes additionalstate: String?parameter.You are strongly encouraged to migrate your server-side interfaces common and frontend code with the help of the new KVision compiler plugin.
Last updated