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 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.inject
imports with newjakarta.inject
namespace 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-server
you need to modifyDevServer
options in yourbuild.gradle.kts
file. 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.d
directory. Please use these bootstrap.js, css.js and file.js files as examples. You can find more information here.kvision-onsenui-css
module was removed and integrated withkvision-onsenui
module.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
@DslMarker
annotation, 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-navigo
module 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.kvision
group identifier. You have to update all KVision dependencies in yourbuild.gradle.kts
.All package names have been renamed with
io.kvision
prefix. You should replace your sources in the following order:pl.treksoft.navigo
withio.kvision.navigo
pl.treksoft.jquery
withio.kvision.jquery
pl.treksoft.kvision
withio.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
moment
module with locale support you need to manuallyrequire()
all or some of the needed locales. You should also updatemoment.js
file in thewebpack.config.d
directory 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.kts
file andwebpack.config.d/webpack.js
file. You can apply the following patch forbuild.gradle.kts
file and just copy new version ofwebpack.js
from the current template project (standard or fullstack, respectively).
Kotlinx.serialization
library 1.0.0 contains a lot of incompatible changes, so you have to migrate your code if you are using this library directly.Jed
was replaced bygettext.js
library. You can safely deletewebpack.config.d/jed.js
file. You need to make sure your*.po
files contain bothLanguage
andPlural forms
headers.All flexbox and grid CSS properties and enums have been moved to the
StyledComponent
and 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.kts
file.
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.kts
file andwebpack.config.d/webpack.js
file. Carefully analyze these changes for frontend projects and these changes for fullstack projects.Kotlinx.serialization
library 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 anInt
instead of aWidget
. The returned value can be used withremoveEventListener(id: Int)
method.The old, deprecated
setEventListener()
method without type parameter has been removed. UseonEvent
instead.Problematic overloaded constructors for all css styling classes in the
core
package -Color
,Border
,Background
,TextDecoration and
TextShadow
has been removed. Each class has only one, primary constructor.There are two new factory extension functions for the
Color
class.Color.hex()
allows you to create aColor
object from a hexadecimalInt
literal.Color.name()
allows you to create aColor
object with anCol
enum value.The dependency on the Pac4J library has been removed. The
p.t.k.remote.Profile
class 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
Root
component is no longer 100% wide. Usewidth = 100.perc
if 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-css
andkvision-fontawesome
were extracted from thekvision-bootstrap
module.The Glyphicons support is dropped. Use Font Awesome icons instead.
The Font Awesome icon names require a style prefix (
fas
,far
orfab
).Components like dropdown, context menu, modal, window, progressbar, navbar, toolbar, responsive grid, tab panel, tooltip and popover were moved into
kvision-bootstrap
module.ButtonStyle.DEFAULT
was removed. TheButtonStyle.PRIMARY
value is the new default. NewButtonStyle.SECONDARY
value is also available.RadioStyle.DEFAULT
andCheckBoxStyle.DEFAULT
were removed and are no longer necessary.The deprecated
Label
component was removed. UseSpan
component instead.TableType.CONDENSED
was removed. Use newTableType.SMALL
value instead.ButtonGroupStyle.JUSTIFIED
was removed. Use a different approach.The
responsive
property of theTable
component was removed. UseresponsiveType
property with a chosen enum value instead.The
dropup
property of theDropDown
component was removed. Use thedirection
property with aDirection.DROPUP
value instead.The
withCaret
parameter of theDropDown
component constructor was removed. No replacement at the moment.NavbarType.STATICTOP
was removed. UseNavbarType.STICKYTOP
instead.Do not use
Tag(TAG.LI)
components when creating links insideNav
component. UseLink
withnav-item
andnav-link
classes (or usenavLink
DSL builder function).When adding links to the
DropDown
orContextMenu
useLink
with adropdown-item
class (or useddLink
andcmLink
DSL builder functions respectively).GridSize.XS
was removed from theResponsiveGridPanel
component.The
buttonsType
is no longer a var property in theSpinner
and theSpinnerInput
components (changing its value didn't work anyway ;-)The
DateTime
andDateTimeInput
components are based on a new version of bootstrap-datetimepicker. Theweekstart
,todayhighlight
andshowmeridian
properties were removed. ThetodayBtn
andclearBtn
properties were renamed toshowTodayButton
andshowClear
respectively.The
ObservableList
class was moved frompl.treksoft.kvision.utils
topl.treksoft.kvision.state
package.The
StateBinding
component was moved frompl.treksoft.kvision.redux
topl.treksoft.kvision.state
package and is available in the main KVision module. It also can be used with any data source implementingObservableState
interface (e.g.ReduxStore
orObservableList
).The mapping of date and time classes between the client and the server code was significantly changed. The
pl.treksoft.kvision.types.Date
class is deprecated and not supported anymore. You should useLocalDateTime
,LocalDate
,LocalTime
,OffsetDateTime
andOffsetTime
frompl.treksoft.kvision.types
package instead. All of these classes are mapped tokotlin.js.Date
on 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.hmr
package was removed and is not needed anymore. All KVision applications should now extendpl.treksoft.kvision.Application
class and are executed with newstartApplication()
function.ReduxStore.subscribe()
method calls the callback function once immediately right after the registration.Service functions for
SelectRemote
/TabulatorRemote
were changed to suspending. The function forSelectRemote
component 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